Permalink
Browse files

Fixed conflicts

  • Loading branch information...
2 parents 149eb9f + 29ad359 commit 42ff75727cc66aaabc6c9673ca24b4be4385a9b3 @nicolas-raoul committed Nov 25, 2011
Showing with 513 additions and 519 deletions.
  1. +1 −1 AndroidManifest.xml
  2. +2 −2 src/com/ichi2/anki/AnkiDb.java
  3. +16 −16 src/com/ichi2/anki/AnkiDroidProxy.java
  4. +8 −8 src/com/ichi2/anki/AnkiDroidWidgetMedium.java
  5. +7 −7 src/com/ichi2/anki/AnkiDroidWidgetSmall.java
  6. +3 −3 src/com/ichi2/anki/BackupManager.java
  7. +12 −12 src/com/ichi2/anki/BroadcastMessages.java
  8. +2 −2 src/com/ichi2/anki/Card.java
  9. +8 −8 src/com/ichi2/anki/CardBrowser.java
  10. +6 −9 src/com/ichi2/anki/CardEditor.java
  11. +2 −2 src/com/ichi2/anki/CardModel.java
  12. +11 −11 src/com/ichi2/anki/CustomExceptionHandler.java
  13. +57 −57 src/com/ichi2/anki/Deck.java
  14. +2 −2 src/com/ichi2/anki/DeckCreator.java
  15. +22 −25 src/com/ichi2/anki/DeckPicker.java
  16. +8 −8 src/com/ichi2/anki/DeckPreferences.java
  17. +23 −23 src/com/ichi2/anki/DeckTask.java
  18. +1 −1 src/com/ichi2/anki/Fact.java
  19. +1 −1 src/com/ichi2/anki/Feedback.java
  20. +3 −3 src/com/ichi2/anki/Image.java
  21. +1 −1 src/com/ichi2/anki/LaTeX.java
  22. +1 −1 src/com/ichi2/anki/Lookup.java
  23. +16 −16 src/com/ichi2/anki/MetaDB.java
  24. +5 −5 src/com/ichi2/anki/MyAccount.java
  25. +11 −11 src/com/ichi2/anki/PersonalDeckPicker.java
  26. +2 −2 src/com/ichi2/anki/Preferences.java
  27. +33 −33 src/com/ichi2/anki/Reviewer.java
  28. +11 −11 src/com/ichi2/anki/SharedDeck.java
  29. +5 −5 src/com/ichi2/anki/SharedDeckPicker.java
  30. +2 −2 src/com/ichi2/anki/Sound.java
  31. +7 −7 src/com/ichi2/anki/Stats.java
  32. +31 −31 src/com/ichi2/anki/StudyOptions.java
  33. +66 −66 src/com/ichi2/anki/SyncClient.java
  34. +9 −9 src/com/ichi2/anki/Utils.java
  35. +8 −8 src/com/ichi2/anki/WidgetStatus.java
  36. +61 −61 src/com/ichi2/anki/services/DownloadManagerService.java
  37. +1 −1 src/com/ichi2/anki/services/NotificationService.java
  38. +17 −17 src/com/ichi2/async/Connection.java
  39. +2 −2 src/com/ichi2/charts/ChartBuilder.java
  40. +1 −1 src/com/ichi2/themes/StyledDialog.java
  41. +3 −3 src/com/ichi2/themes/Themes.java
  42. +11 −11 src/com/tomgibara/android/veecheck/VeecheckReceiver.java
  43. +11 −11 src/com/tomgibara/android/veecheck/VeecheckService.java
  44. +2 −2 src/com/tomgibara/android/veecheck/VeecheckThread.java
  45. +1 −1 src/com/tomgibara/android/veecheck/util/PrefState.java
View
@@ -20,7 +20,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ichi2.anki"
- android:versionName="0.7.1beta2_nobluetooth"
+ android:versionName="1.0nobluetooth"
android:versionCode="22"
android:installLocation="auto">
<instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.ichi2.anki"></instrumentation>
@@ -103,7 +103,7 @@ public AnkiDb(String ankiFilename, boolean forceDeleteJournalMode) {
public void closeDatabase() {
if (mDatabase != null) {
mDatabase.close();
- Log.i(AnkiDroidApp.TAG, "AnkiDb - closeDatabase, database " + mDatabase.getPath() + " closed = " + !mDatabase.isOpen());
+ // Log.i(AnkiDroidApp.TAG, "AnkiDb - closeDatabase, database " + mDatabase.getPath() + " closed = " + !mDatabase.isOpen());
mDatabase = null;
}
}
@@ -192,7 +192,7 @@ public void execSQL(Deck deck, SqlCommandType command, String table, ContentValu
} else if (command == SQL_DEL) {
delete(deck, table, whereClause, null);
} else {
- Log.i(AnkiDroidApp.TAG, "wrong command. no action performed");
+ // Log.i(AnkiDroidApp.TAG, "wrong command. no action performed");
}
}
@@ -134,10 +134,10 @@ public int connect(boolean checkClocks) {
String status = jsonDecks.getString("status");
if (ANKIWEB_STATUS_OK.equalsIgnoreCase(status)) {
mDecks = jsonDecks.getJSONObject("decks");
- Log.i(AnkiDroidApp.TAG, "Server decks = " + mDecks.toString());
+ // Log.i(AnkiDroidApp.TAG, "Server decks = " + mDecks.toString());
mTimestamp = jsonDecks.getDouble("timestamp");
mTimediff = Math.abs(mTimestamp - Utils.now());
- Log.i(AnkiDroidApp.TAG, "Server timestamp = " + mTimestamp);
+ // Log.i(AnkiDroidApp.TAG, "Server timestamp = " + mTimestamp);
if (checkClocks && (mTimediff > 300)) {
Log.e(AnkiDroidApp.TAG, "connect - The clock of the device and that of the server are unsynchronized!");
return LOGIN_CLOCKS_UNSYNCED;
@@ -244,7 +244,7 @@ public boolean finish() {
}
InputStream content = entityResponse.getContent();
String contentString = Utils.convertStreamToString(new InflaterInputStream(content));
- Log.i(AnkiDroidApp.TAG, "finish: " + contentString);
+ // Log.i(AnkiDroidApp.TAG, "finish: " + contentString);
return true;
} catch (UnsupportedEncodingException e) {
Log.e(AnkiDroidApp.TAG, "UnsupportedEncodingException = " + e.getMessage());
@@ -272,7 +272,7 @@ public String getDecks() {
+ "&d=None&sources=" + URLEncoder.encode("[]", "UTF-8") + "&libanki="
+ URLEncoder.encode(AnkiDroidApp.LIBANKI_VERSION, "UTF-8") + "&pversion=5";
- // Log.i(AnkiDroidApp.TAG, "Data json = " + data);
+ // // Log.i(AnkiDroidApp.TAG, "Data json = " + data);
HttpPost httpPost = new HttpPost(SYNC_URL + "getDecks");
StringEntity entity = new StringEntity(data);
httpPost.setEntity(entity);
@@ -289,7 +289,7 @@ public String getDecks() {
HttpEntity entityResponse = response.getEntity();
InputStream content = entityResponse.getContent();
decksServer = Utils.convertStreamToString(new InflaterInputStream(content));
- Log.i(AnkiDroidApp.TAG, "getDecks response = " + decksServer);
+ // Log.i(AnkiDroidApp.TAG, "getDecks response = " + decksServer);
} catch (UnsupportedEncodingException e) {
Log.e(AnkiDroidApp.TAG, "getDecks - UnsupportedEncodingException = " + e.getMessage());
@@ -318,7 +318,7 @@ public String getDecks() {
public Payload createDeck(String name) {
- Log.i(AnkiDroidApp.TAG, "createDeck");
+ // Log.i(AnkiDroidApp.TAG, "createDeck");
Payload result = new Payload();
@@ -339,13 +339,13 @@ public Payload createDeck(String name) {
InputStream content = entityResponse.getContent();
if (respCode != 200) {
String reason = response.getStatusLine().getReasonPhrase();
- Log.i(AnkiDroidApp.TAG, "Failed to create Deck: " + respCode + " " + reason);
+ // Log.i(AnkiDroidApp.TAG, "Failed to create Deck: " + respCode + " " + reason);
result.success = false;
result.returnType = respCode;
result.result = reason;
return result;
} else {
- Log.i(AnkiDroidApp.TAG, "createDeck - response = " + Utils.convertStreamToString(new InflaterInputStream(content)));
+ // Log.i(AnkiDroidApp.TAG, "createDeck - response = " + Utils.convertStreamToString(new InflaterInputStream(content)));
result.success = true;
result.returnType = 200;
// Add created deck to the list of decks on server
@@ -382,7 +382,7 @@ public Payload createDeck(String name) {
*/
public JSONObject summary(double lastSync) {
- Log.i(AnkiDroidApp.TAG, "Summary Server");
+ // Log.i(AnkiDroidApp.TAG, "Summary Server");
JSONObject summaryServer = new JSONObject();
@@ -395,7 +395,7 @@ public JSONObject summary(double lastSync) {
+ URLEncoder.encode(Base64.encodeBytes(Utils.compress(String.format(Utils.ENGLISH_LOCALE, "%f",
lastSync).getBytes())), "UTF-8") + "&base64=" + URLEncoder.encode("true", "UTF-8");
- // Log.i(AnkiDroidApp.TAG, "Data json = " + data);
+ // // Log.i(AnkiDroidApp.TAG, "Data json = " + data);
HttpPost httpPost = new HttpPost(SYNC_URL + "summary");
StringEntity entity = new StringEntity(data);
httpPost.setEntity(entity);
@@ -411,7 +411,7 @@ public JSONObject summary(double lastSync) {
HttpEntity entityResponse = response.getEntity();
InputStream content = entityResponse.getContent();
summaryServer = new JSONObject(Utils.convertStreamToString(new InflaterInputStream(content)));
- Log.i(AnkiDroidApp.TAG, "Summary server = ");
+ // Log.i(AnkiDroidApp.TAG, "Summary server = ");
Utils.printJSONObject(summaryServer);
return summaryServer;
} catch (UnsupportedEncodingException e) {
@@ -440,7 +440,7 @@ public JSONObject summary(double lastSync) {
* @throws JSONException
*/
public JSONObject applyPayload(JSONObject payload) throws JSONException {
- Log.i(AnkiDroidApp.TAG, "applyPayload");
+ // Log.i(AnkiDroidApp.TAG, "applyPayload");
JSONObject payloadReply = new JSONObject();
try {
@@ -451,7 +451,7 @@ public JSONObject applyPayload(JSONObject payload) throws JSONException {
+ URLEncoder.encode(Base64.encodeBytes(Utils.compress(payload.toString().getBytes())), "UTF-8")
+ "&base64=" + URLEncoder.encode("true", "UTF-8");
- // Log.i(AnkiDroidApp.TAG, "Data json = " + data);
+ // // Log.i(AnkiDroidApp.TAG, "Data json = " + data);
HttpPost httpPost = new HttpPost(SYNC_URL + "applyPayload");
StringEntity entity = new StringEntity(data);
httpPost.setEntity(entity);
@@ -468,7 +468,7 @@ public JSONObject applyPayload(JSONObject payload) throws JSONException {
HttpEntity entityResponse = response.getEntity();
InputStream content = entityResponse.getContent();
String contentString = Utils.convertStreamToString(new InflaterInputStream(content));
- Log.i(AnkiDroidApp.TAG, "Payload response = ");
+ // Log.i(AnkiDroidApp.TAG, "Payload response = ");
payloadReply = new JSONObject(contentString);
Utils.printJSONObject(payloadReply, false);
//Utils.saveJSONObject(payloadReply); //XXX: do we really want to append all JSON objects forever? I don't think so.
@@ -506,7 +506,7 @@ public JSONObject applyPayload(JSONObject payload) throws JSONException {
HttpResponse httpResponse = defaultHttpClient.execute(httpGet);
String response = Utils.convertStreamToString(httpResponse.getEntity().getContent());
- // Log.i(AnkiDroidApp.TAG, "Content = " + response);
+ // // Log.i(AnkiDroidApp.TAG, "Content = " + response);
sSharedDecks.addAll(getSharedDecksListFromJSONArray(new JSONArray(response)));
}
} catch (Exception e) {
@@ -527,7 +527,7 @@ public static void resetSharedDecks() {
List<SharedDeck> sharedDecks = new ArrayList<SharedDeck>();
if (jsonSharedDecks != null) {
- // Log.i(AnkiDroidApp.TAG, "Number of shared decks = " + jsonSharedDecks.length());
+ // // Log.i(AnkiDroidApp.TAG, "Number of shared decks = " + jsonSharedDecks.length());
int nbDecks = jsonSharedDecks.length();
for (int i = 0; i < nbDecks; i++) {
@@ -48,22 +48,22 @@
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
- Log.i(AnkiDroidApp.TAG, "MediumWidget: onUpdate");
+ // Log.i(AnkiDroidApp.TAG, "MediumWidget: onUpdate");
WidgetStatus.update(context);
}
@Override
public void onEnabled(Context context) {
super.onEnabled(context);
- Log.i(AnkiDroidApp.TAG, "MediumWidget: Widget enabled");
+ // Log.i(AnkiDroidApp.TAG, "MediumWidget: Widget enabled");
SharedPreferences preferences = PrefSettings.getSharedPrefs(context);
preferences.edit().putBoolean("widgetMediumEnabled", true).commit();
}
@Override
public void onDisabled(Context context) {
super.onDisabled(context);
- Log.i(AnkiDroidApp.TAG, "MediumWidget: Widget disabled");
+ // Log.i(AnkiDroidApp.TAG, "MediumWidget: Widget disabled");
SharedPreferences preferences = PrefSettings.getSharedPrefs(context);
preferences.edit().putBoolean("widgetMediumEnabled", false).commit();
}
@@ -136,7 +136,7 @@ private CharSequence getDeckStatusString(DeckStatus deck) {
@Override
public void onStart(Intent intent, int startId) {
- Log.i(AnkiDroidApp.TAG, "MediumWidget: OnStart");
+ // Log.i(AnkiDroidApp.TAG, "MediumWidget: OnStart");
boolean updateDueDecksNow = true;
if (intent != null) {
@@ -158,7 +158,7 @@ public void onStart(Intent intent, int startId) {
updateDueDecksNow = false;
} else if (ACTION_UPDATE.equals(intent.getAction())) {
// Updating the widget is done below for all actions.
- Log.d(AnkiDroidApp.TAG, "AnkiDroidWidget.UpdateService: UPDATE");
+ // Log.d(AnkiDroidApp.TAG, "AnkiDroidWidget.UpdateService: UPDATE");
}
}
RemoteViews updateViews = buildUpdate(this, updateDueDecksNow);
@@ -169,7 +169,7 @@ public void onStart(Intent intent, int startId) {
}
private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) {
- Log.i(AnkiDroidApp.TAG, "buildUpdate");
+ // Log.i(AnkiDroidApp.TAG, "buildUpdate");
// Resources res = context.getResources();
RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.widget);
@@ -195,7 +195,7 @@ private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
- Log.i(AnkiDroidApp.TAG, "mMountReceiver - Action = Media Mounted");
+ // Log.i(AnkiDroidApp.TAG, "mMountReceiver - Action = Media Mounted");
if (remounted) {
WidgetStatus.update(getBaseContext());
remounted = false;
@@ -335,7 +335,7 @@ private PendingIntent getOpenPendingIntent(Context context, String deckPath) {
@Override
public IBinder onBind(Intent arg0) {
- Log.i(AnkiDroidApp.TAG, "onBind");
+ // Log.i(AnkiDroidApp.TAG, "onBind");
return null;
}
}
@@ -38,22 +38,22 @@
@Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
- Log.i(AnkiDroidApp.TAG, "SmallWidget: onUpdate");
+ // Log.i(AnkiDroidApp.TAG, "SmallWidget: onUpdate");
WidgetStatus.update(context);
}
@Override
public void onEnabled(Context context) {
super.onEnabled(context);
- Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget enabled");
+ // Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget enabled");
SharedPreferences preferences = PrefSettings.getSharedPrefs(context);
preferences.edit().putBoolean("widgetSmallEnabled", true).commit();
}
@Override
public void onDisabled(Context context) {
super.onDisabled(context);
- Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget disabled");
+ // Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget disabled");
SharedPreferences preferences = PrefSettings.getSharedPrefs(context);
preferences.edit().putBoolean("widgetSmallEnabled", false).commit();
}
@@ -71,7 +71,7 @@ public void onDisabled(Context context) {
@Override
public void onStart(Intent intent, int startId) {
- Log.i(AnkiDroidApp.TAG, "SmallWidget: OnStart");
+ // Log.i(AnkiDroidApp.TAG, "SmallWidget: OnStart");
RemoteViews updateViews = buildUpdate(this, true);
@@ -82,7 +82,7 @@ public void onStart(Intent intent, int startId) {
private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) {
- Log.i(AnkiDroidApp.TAG, "buildUpdate");
+ // Log.i(AnkiDroidApp.TAG, "buildUpdate");
// Resources res = context.getResources();
RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_small);
@@ -108,7 +108,7 @@ private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) {
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) {
- Log.i(AnkiDroidApp.TAG, "mMountReceiver - Action = Media Mounted");
+ // Log.i(AnkiDroidApp.TAG, "mMountReceiver - Action = Media Mounted");
if (remounted) {
WidgetStatus.update(getBaseContext());
remounted = false;
@@ -170,7 +170,7 @@ public void onReceive(Context context, Intent intent) {
@Override
public IBinder onBind(Intent arg0) {
- Log.i(AnkiDroidApp.TAG, "onBind");
+ // Log.i(AnkiDroidApp.TAG, "onBind");
return null;
}
}
@@ -177,7 +177,7 @@ public static int backupDeck(String deckpath) {
File backupFile = new File(getBackupDirectory().getPath(), backupFilename);
if (backupFile.exists()) {
- Log.i(AnkiDroidApp.TAG, "No new backup of " + deckFile.getName() + " created. Already made one today");
+ // Log.i(AnkiDroidApp.TAG, "No new backup of " + deckFile.getName() + " created. Already made one today");
deleteDeckBackups(deckBackups, mMaxBackups);
return RETURN_TODAY_ALREADY_BACKUP_DONE;
}
@@ -267,7 +267,7 @@ public static boolean repairDeck(String deckPath) {
// repair file
String execString = "sqlite3 " + deckPath + " .dump | sqlite3 " + deckPath + ".tmp";
- Log.i(AnkiDroidApp.TAG, "repairDeck - Execute: " + execString);
+ // Log.i(AnkiDroidApp.TAG, "repairDeck - Execute: " + execString);
try {
String[] cmd = {"/system/bin/sh", "-c", execString };
Process process = Runtime.getRuntime().exec(cmd);
@@ -287,7 +287,7 @@ public static boolean repairDeck(String deckPath) {
if (!deckFile.renameTo(movedFile)) {
return false;
}
- Log.i(AnkiDroidApp.TAG, "repairDeck - moved corrupt file to " + movedFile.getAbsolutePath());
+ // Log.i(AnkiDroidApp.TAG, "repairDeck - moved corrupt file to " + movedFile.getAbsolutePath());
File repairedFile = new File(deckPath + ".tmp");
if (!repairedFile.renameTo(deckFile)) {
return false;
Oops, something went wrong. Retry.

0 comments on commit 42ff757

Please sign in to comment.