Skip to content

Commit

Permalink
Fixed conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-raoul committed Nov 25, 2011
2 parents 149eb9f + 29ad359 commit 42ff757
Show file tree
Hide file tree
Showing 45 changed files with 513 additions and 519 deletions.
2 changes: 1 addition & 1 deletion AndroidManifest.xml
Expand Up @@ -20,7 +20,7 @@
--> -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ichi2.anki" package="com.ichi2.anki"
android:versionName="0.7.1beta2_nobluetooth" android:versionName="1.0nobluetooth"
android:versionCode="22" android:versionCode="22"
android:installLocation="auto"> android:installLocation="auto">
<instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.ichi2.anki"></instrumentation> <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.ichi2.anki"></instrumentation>
Expand Down
4 changes: 2 additions & 2 deletions src/com/ichi2/anki/AnkiDb.java
Expand Up @@ -103,7 +103,7 @@ public AnkiDb(String ankiFilename, boolean forceDeleteJournalMode) {
public void closeDatabase() { public void closeDatabase() {
if (mDatabase != null) { if (mDatabase != null) {
mDatabase.close(); 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; mDatabase = null;
} }
} }
Expand Down Expand Up @@ -192,7 +192,7 @@ public void execSQL(Deck deck, SqlCommandType command, String table, ContentValu
} else if (command == SQL_DEL) { } else if (command == SQL_DEL) {
delete(deck, table, whereClause, null); delete(deck, table, whereClause, null);
} else { } else {
Log.i(AnkiDroidApp.TAG, "wrong command. no action performed"); // Log.i(AnkiDroidApp.TAG, "wrong command. no action performed");
} }
} }


Expand Down
32 changes: 16 additions & 16 deletions src/com/ichi2/anki/AnkiDroidProxy.java
Expand Up @@ -134,10 +134,10 @@ public int connect(boolean checkClocks) {
String status = jsonDecks.getString("status"); String status = jsonDecks.getString("status");
if (ANKIWEB_STATUS_OK.equalsIgnoreCase(status)) { if (ANKIWEB_STATUS_OK.equalsIgnoreCase(status)) {
mDecks = jsonDecks.getJSONObject("decks"); mDecks = jsonDecks.getJSONObject("decks");
Log.i(AnkiDroidApp.TAG, "Server decks = " + mDecks.toString()); // Log.i(AnkiDroidApp.TAG, "Server decks = " + mDecks.toString());
mTimestamp = jsonDecks.getDouble("timestamp"); mTimestamp = jsonDecks.getDouble("timestamp");
mTimediff = Math.abs(mTimestamp - Utils.now()); mTimediff = Math.abs(mTimestamp - Utils.now());
Log.i(AnkiDroidApp.TAG, "Server timestamp = " + mTimestamp); // Log.i(AnkiDroidApp.TAG, "Server timestamp = " + mTimestamp);
if (checkClocks && (mTimediff > 300)) { if (checkClocks && (mTimediff > 300)) {
Log.e(AnkiDroidApp.TAG, "connect - The clock of the device and that of the server are unsynchronized!"); Log.e(AnkiDroidApp.TAG, "connect - The clock of the device and that of the server are unsynchronized!");
return LOGIN_CLOCKS_UNSYNCED; return LOGIN_CLOCKS_UNSYNCED;
Expand Down Expand Up @@ -244,7 +244,7 @@ public boolean finish() {
} }
InputStream content = entityResponse.getContent(); InputStream content = entityResponse.getContent();
String contentString = Utils.convertStreamToString(new InflaterInputStream(content)); String contentString = Utils.convertStreamToString(new InflaterInputStream(content));
Log.i(AnkiDroidApp.TAG, "finish: " + contentString); // Log.i(AnkiDroidApp.TAG, "finish: " + contentString);
return true; return true;
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
Log.e(AnkiDroidApp.TAG, "UnsupportedEncodingException = " + e.getMessage()); Log.e(AnkiDroidApp.TAG, "UnsupportedEncodingException = " + e.getMessage());
Expand Down Expand Up @@ -272,7 +272,7 @@ public String getDecks() {
+ "&d=None&sources=" + URLEncoder.encode("[]", "UTF-8") + "&libanki=" + "&d=None&sources=" + URLEncoder.encode("[]", "UTF-8") + "&libanki="
+ URLEncoder.encode(AnkiDroidApp.LIBANKI_VERSION, "UTF-8") + "&pversion=5"; + 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"); HttpPost httpPost = new HttpPost(SYNC_URL + "getDecks");
StringEntity entity = new StringEntity(data); StringEntity entity = new StringEntity(data);
httpPost.setEntity(entity); httpPost.setEntity(entity);
Expand All @@ -289,7 +289,7 @@ public String getDecks() {
HttpEntity entityResponse = response.getEntity(); HttpEntity entityResponse = response.getEntity();
InputStream content = entityResponse.getContent(); InputStream content = entityResponse.getContent();
decksServer = Utils.convertStreamToString(new InflaterInputStream(content)); decksServer = Utils.convertStreamToString(new InflaterInputStream(content));
Log.i(AnkiDroidApp.TAG, "getDecks response = " + decksServer); // Log.i(AnkiDroidApp.TAG, "getDecks response = " + decksServer);


} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
Log.e(AnkiDroidApp.TAG, "getDecks - UnsupportedEncodingException = " + e.getMessage()); Log.e(AnkiDroidApp.TAG, "getDecks - UnsupportedEncodingException = " + e.getMessage());
Expand Down Expand Up @@ -318,7 +318,7 @@ public List<String> getPersonalDecks() {




public Payload createDeck(String name) { public Payload createDeck(String name) {
Log.i(AnkiDroidApp.TAG, "createDeck"); // Log.i(AnkiDroidApp.TAG, "createDeck");


Payload result = new Payload(); Payload result = new Payload();


Expand All @@ -339,13 +339,13 @@ public Payload createDeck(String name) {
InputStream content = entityResponse.getContent(); InputStream content = entityResponse.getContent();
if (respCode != 200) { if (respCode != 200) {
String reason = response.getStatusLine().getReasonPhrase(); 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.success = false;
result.returnType = respCode; result.returnType = respCode;
result.result = reason; result.result = reason;
return result; return result;
} else { } 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.success = true;
result.returnType = 200; result.returnType = 200;
// Add created deck to the list of decks on server // Add created deck to the list of decks on server
Expand Down Expand Up @@ -382,7 +382,7 @@ public Payload createDeck(String name) {
*/ */
public JSONObject summary(double lastSync) { public JSONObject summary(double lastSync) {


Log.i(AnkiDroidApp.TAG, "Summary Server"); // Log.i(AnkiDroidApp.TAG, "Summary Server");


JSONObject summaryServer = new JSONObject(); JSONObject summaryServer = new JSONObject();


Expand All @@ -395,7 +395,7 @@ public JSONObject summary(double lastSync) {
+ URLEncoder.encode(Base64.encodeBytes(Utils.compress(String.format(Utils.ENGLISH_LOCALE, "%f", + URLEncoder.encode(Base64.encodeBytes(Utils.compress(String.format(Utils.ENGLISH_LOCALE, "%f",
lastSync).getBytes())), "UTF-8") + "&base64=" + URLEncoder.encode("true", "UTF-8"); 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"); HttpPost httpPost = new HttpPost(SYNC_URL + "summary");
StringEntity entity = new StringEntity(data); StringEntity entity = new StringEntity(data);
httpPost.setEntity(entity); httpPost.setEntity(entity);
Expand All @@ -411,7 +411,7 @@ public JSONObject summary(double lastSync) {
HttpEntity entityResponse = response.getEntity(); HttpEntity entityResponse = response.getEntity();
InputStream content = entityResponse.getContent(); InputStream content = entityResponse.getContent();
summaryServer = new JSONObject(Utils.convertStreamToString(new InflaterInputStream(content))); summaryServer = new JSONObject(Utils.convertStreamToString(new InflaterInputStream(content)));
Log.i(AnkiDroidApp.TAG, "Summary server = "); // Log.i(AnkiDroidApp.TAG, "Summary server = ");
Utils.printJSONObject(summaryServer); Utils.printJSONObject(summaryServer);
return summaryServer; return summaryServer;
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
Expand Down Expand Up @@ -440,7 +440,7 @@ public JSONObject summary(double lastSync) {
* @throws JSONException * @throws JSONException
*/ */
public JSONObject applyPayload(JSONObject payload) throws JSONException { public JSONObject applyPayload(JSONObject payload) throws JSONException {
Log.i(AnkiDroidApp.TAG, "applyPayload"); // Log.i(AnkiDroidApp.TAG, "applyPayload");
JSONObject payloadReply = new JSONObject(); JSONObject payloadReply = new JSONObject();


try { try {
Expand All @@ -451,7 +451,7 @@ public JSONObject applyPayload(JSONObject payload) throws JSONException {
+ URLEncoder.encode(Base64.encodeBytes(Utils.compress(payload.toString().getBytes())), "UTF-8") + URLEncoder.encode(Base64.encodeBytes(Utils.compress(payload.toString().getBytes())), "UTF-8")
+ "&base64=" + URLEncoder.encode("true", "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"); HttpPost httpPost = new HttpPost(SYNC_URL + "applyPayload");
StringEntity entity = new StringEntity(data); StringEntity entity = new StringEntity(data);
httpPost.setEntity(entity); httpPost.setEntity(entity);
Expand All @@ -468,7 +468,7 @@ public JSONObject applyPayload(JSONObject payload) throws JSONException {
HttpEntity entityResponse = response.getEntity(); HttpEntity entityResponse = response.getEntity();
InputStream content = entityResponse.getContent(); InputStream content = entityResponse.getContent();
String contentString = Utils.convertStreamToString(new InflaterInputStream(content)); String contentString = Utils.convertStreamToString(new InflaterInputStream(content));
Log.i(AnkiDroidApp.TAG, "Payload response = "); // Log.i(AnkiDroidApp.TAG, "Payload response = ");
payloadReply = new JSONObject(contentString); payloadReply = new JSONObject(contentString);
Utils.printJSONObject(payloadReply, false); Utils.printJSONObject(payloadReply, false);
//Utils.saveJSONObject(payloadReply); //XXX: do we really want to append all JSON objects forever? I don't think so. //Utils.saveJSONObject(payloadReply); //XXX: do we really want to append all JSON objects forever? I don't think so.
Expand Down Expand Up @@ -506,7 +506,7 @@ public static List<SharedDeck> getSharedDecks() throws Exception {


HttpResponse httpResponse = defaultHttpClient.execute(httpGet); HttpResponse httpResponse = defaultHttpClient.execute(httpGet);
String response = Utils.convertStreamToString(httpResponse.getEntity().getContent()); 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))); sSharedDecks.addAll(getSharedDecksListFromJSONArray(new JSONArray(response)));
} }
} catch (Exception e) { } catch (Exception e) {
Expand All @@ -527,7 +527,7 @@ private static List<SharedDeck> getSharedDecksListFromJSONArray(JSONArray jsonSh
List<SharedDeck> sharedDecks = new ArrayList<SharedDeck>(); List<SharedDeck> sharedDecks = new ArrayList<SharedDeck>();


if (jsonSharedDecks != null) { 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(); int nbDecks = jsonSharedDecks.length();
for (int i = 0; i < nbDecks; i++) { for (int i = 0; i < nbDecks; i++) {
Expand Down
16 changes: 8 additions & 8 deletions src/com/ichi2/anki/AnkiDroidWidgetMedium.java
Expand Up @@ -48,22 +48,22 @@ public class AnkiDroidWidgetMedium extends AppWidgetProvider {


@Override @Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
Log.i(AnkiDroidApp.TAG, "MediumWidget: onUpdate"); // Log.i(AnkiDroidApp.TAG, "MediumWidget: onUpdate");
WidgetStatus.update(context); WidgetStatus.update(context);
} }


@Override @Override
public void onEnabled(Context context) { public void onEnabled(Context context) {
super.onEnabled(context); super.onEnabled(context);
Log.i(AnkiDroidApp.TAG, "MediumWidget: Widget enabled"); // Log.i(AnkiDroidApp.TAG, "MediumWidget: Widget enabled");
SharedPreferences preferences = PrefSettings.getSharedPrefs(context); SharedPreferences preferences = PrefSettings.getSharedPrefs(context);
preferences.edit().putBoolean("widgetMediumEnabled", true).commit(); preferences.edit().putBoolean("widgetMediumEnabled", true).commit();
} }


@Override @Override
public void onDisabled(Context context) { public void onDisabled(Context context) {
super.onDisabled(context); super.onDisabled(context);
Log.i(AnkiDroidApp.TAG, "MediumWidget: Widget disabled"); // Log.i(AnkiDroidApp.TAG, "MediumWidget: Widget disabled");
SharedPreferences preferences = PrefSettings.getSharedPrefs(context); SharedPreferences preferences = PrefSettings.getSharedPrefs(context);
preferences.edit().putBoolean("widgetMediumEnabled", false).commit(); preferences.edit().putBoolean("widgetMediumEnabled", false).commit();
} }
Expand Down Expand Up @@ -136,7 +136,7 @@ private CharSequence getDeckStatusString(DeckStatus deck) {


@Override @Override
public void onStart(Intent intent, int startId) { public void onStart(Intent intent, int startId) {
Log.i(AnkiDroidApp.TAG, "MediumWidget: OnStart"); // Log.i(AnkiDroidApp.TAG, "MediumWidget: OnStart");


boolean updateDueDecksNow = true; boolean updateDueDecksNow = true;
if (intent != null) { if (intent != null) {
Expand All @@ -158,7 +158,7 @@ public void onStart(Intent intent, int startId) {
updateDueDecksNow = false; updateDueDecksNow = false;
} else if (ACTION_UPDATE.equals(intent.getAction())) { } else if (ACTION_UPDATE.equals(intent.getAction())) {
// Updating the widget is done below for all actions. // 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); RemoteViews updateViews = buildUpdate(this, updateDueDecksNow);
Expand All @@ -169,7 +169,7 @@ public void onStart(Intent intent, int startId) {
} }


private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) { private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) {
Log.i(AnkiDroidApp.TAG, "buildUpdate"); // Log.i(AnkiDroidApp.TAG, "buildUpdate");


// Resources res = context.getResources(); // Resources res = context.getResources();
RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.widget); RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.widget);
Expand All @@ -195,7 +195,7 @@ private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
String action = intent.getAction(); String action = intent.getAction();
if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) { 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) { if (remounted) {
WidgetStatus.update(getBaseContext()); WidgetStatus.update(getBaseContext());
remounted = false; remounted = false;
Expand Down Expand Up @@ -335,7 +335,7 @@ private PendingIntent getOpenPendingIntent(Context context, String deckPath) {


@Override @Override
public IBinder onBind(Intent arg0) { public IBinder onBind(Intent arg0) {
Log.i(AnkiDroidApp.TAG, "onBind"); // Log.i(AnkiDroidApp.TAG, "onBind");
return null; return null;
} }
} }
Expand Down
14 changes: 7 additions & 7 deletions src/com/ichi2/anki/AnkiDroidWidgetSmall.java
Expand Up @@ -38,22 +38,22 @@ public class AnkiDroidWidgetSmall extends AppWidgetProvider {


@Override @Override
public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
Log.i(AnkiDroidApp.TAG, "SmallWidget: onUpdate"); // Log.i(AnkiDroidApp.TAG, "SmallWidget: onUpdate");
WidgetStatus.update(context); WidgetStatus.update(context);
} }


@Override @Override
public void onEnabled(Context context) { public void onEnabled(Context context) {
super.onEnabled(context); super.onEnabled(context);
Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget enabled"); // Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget enabled");
SharedPreferences preferences = PrefSettings.getSharedPrefs(context); SharedPreferences preferences = PrefSettings.getSharedPrefs(context);
preferences.edit().putBoolean("widgetSmallEnabled", true).commit(); preferences.edit().putBoolean("widgetSmallEnabled", true).commit();
} }


@Override @Override
public void onDisabled(Context context) { public void onDisabled(Context context) {
super.onDisabled(context); super.onDisabled(context);
Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget disabled"); // Log.i(AnkiDroidApp.TAG, "SmallWidget: Widget disabled");
SharedPreferences preferences = PrefSettings.getSharedPrefs(context); SharedPreferences preferences = PrefSettings.getSharedPrefs(context);
preferences.edit().putBoolean("widgetSmallEnabled", false).commit(); preferences.edit().putBoolean("widgetSmallEnabled", false).commit();
} }
Expand All @@ -71,7 +71,7 @@ public static class UpdateService extends Service {


@Override @Override
public void onStart(Intent intent, int startId) { public void onStart(Intent intent, int startId) {
Log.i(AnkiDroidApp.TAG, "SmallWidget: OnStart"); // Log.i(AnkiDroidApp.TAG, "SmallWidget: OnStart");


RemoteViews updateViews = buildUpdate(this, true); RemoteViews updateViews = buildUpdate(this, true);


Expand All @@ -82,7 +82,7 @@ public void onStart(Intent intent, int startId) {




private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) { private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) {
Log.i(AnkiDroidApp.TAG, "buildUpdate"); // Log.i(AnkiDroidApp.TAG, "buildUpdate");


// Resources res = context.getResources(); // Resources res = context.getResources();
RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_small); RemoteViews updateViews = new RemoteViews(context.getPackageName(), R.layout.widget_small);
Expand All @@ -108,7 +108,7 @@ private RemoteViews buildUpdate(Context context, boolean updateDueDecksNow) {
public void onReceive(Context context, Intent intent) { public void onReceive(Context context, Intent intent) {
String action = intent.getAction(); String action = intent.getAction();
if (action.equals(Intent.ACTION_MEDIA_MOUNTED)) { 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) { if (remounted) {
WidgetStatus.update(getBaseContext()); WidgetStatus.update(getBaseContext());
remounted = false; remounted = false;
Expand Down Expand Up @@ -170,7 +170,7 @@ public void onReceive(Context context, Intent intent) {


@Override @Override
public IBinder onBind(Intent arg0) { public IBinder onBind(Intent arg0) {
Log.i(AnkiDroidApp.TAG, "onBind"); // Log.i(AnkiDroidApp.TAG, "onBind");
return null; return null;
} }
} }
Expand Down
6 changes: 3 additions & 3 deletions src/com/ichi2/anki/BackupManager.java
Expand Up @@ -177,7 +177,7 @@ public static int backupDeck(String deckpath) {


File backupFile = new File(getBackupDirectory().getPath(), backupFilename); File backupFile = new File(getBackupDirectory().getPath(), backupFilename);
if (backupFile.exists()) { 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); deleteDeckBackups(deckBackups, mMaxBackups);
return RETURN_TODAY_ALREADY_BACKUP_DONE; return RETURN_TODAY_ALREADY_BACKUP_DONE;
} }
Expand Down Expand Up @@ -267,7 +267,7 @@ public static boolean repairDeck(String deckPath) {


// repair file // repair file
String execString = "sqlite3 " + deckPath + " .dump | sqlite3 " + deckPath + ".tmp"; String execString = "sqlite3 " + deckPath + " .dump | sqlite3 " + deckPath + ".tmp";
Log.i(AnkiDroidApp.TAG, "repairDeck - Execute: " + execString); // Log.i(AnkiDroidApp.TAG, "repairDeck - Execute: " + execString);
try { try {
String[] cmd = {"/system/bin/sh", "-c", execString }; String[] cmd = {"/system/bin/sh", "-c", execString };
Process process = Runtime.getRuntime().exec(cmd); Process process = Runtime.getRuntime().exec(cmd);
Expand All @@ -287,7 +287,7 @@ public static boolean repairDeck(String deckPath) {
if (!deckFile.renameTo(movedFile)) { if (!deckFile.renameTo(movedFile)) {
return false; 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"); File repairedFile = new File(deckPath + ".tmp");
if (!repairedFile.renameTo(deckFile)) { if (!repairedFile.renameTo(deckFile)) {
return false; return false;
Expand Down

0 comments on commit 42ff757

Please sign in to comment.