Skip to content

Commit

Permalink
Merge pull request #745 from garvankeeley/refine-disk-db
Browse files Browse the repository at this point in the history
Data storage timer bugs: (1) upload timer kept being reset (2) new idle timer to flush
  • Loading branch information
garvankeeley committed Aug 1, 2014
2 parents 75fabeb + 096311f commit 53cacb2
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 67 deletions.
2 changes: 1 addition & 1 deletion src/org/mozilla/mozstumbler/client/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public void showUploadStats() {
formatTextView(R.id.reports_sent, R.string.reports_sent, Integer.parseInt(value));
}
catch (IOException ex) {
Log.e(LOGTAG, "Exception in showUploadStats():" + ex.toString());
Log.e(LOGTAG, "Exception in showUploadStats()", ex);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ void updateSyncedStats() {
mTotalDataSentView.setText(String.valueOf(kilobytes));
}
catch (IOException ex) {
Log.e(LOGTAG, "Exception in updateSyncedStats():" + ex.toString());
Log.e(LOGTAG, "Exception in updateSyncedStats()", ex);
}
}

Expand Down
9 changes: 4 additions & 5 deletions src/org/mozilla/mozstumbler/service/StumblerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.io.IOException;

public final class StumblerService extends PersistentIntentService
implements DataStorageManager.DatabaseIsEmptyTracker {
implements DataStorageManager.StorageIsEmptyTracker {
private static final String LOGTAG = StumblerService.class.getName();
public static final String ACTION_BASE = AppGlobals.ACTION_NAMESPACE;
public static final String ACTION_START_PASSIVE = ACTION_BASE + ".START_PASSIVE";
Expand Down Expand Up @@ -161,7 +161,7 @@ public void onDestroy() {
AppGlobals.dataStorageManager.saveCurrentReportsToDisk();
} catch (IOException ex) {
AppGlobals.guiLogInfo(ex.toString());
Log.e(LOGTAG, "Exception in onDestroy saving reports:" + ex.toString());
Log.e(LOGTAG, "Exception in onDestroy saving reports", ex);
}
}
mReporter.shutdown();
Expand Down Expand Up @@ -221,12 +221,11 @@ public void onRebind(Intent intent) {
if (AppGlobals.isDebug)Log.d(LOGTAG,"onRebind");
}

public void databaseIsEmpty(boolean isEmpty) {
public void storageIsEmpty(boolean isEmpty) {
if (isEmpty) {
UploadAlarmReceiver.cancelAlarm(this);
} else {
UploadAlarmReceiver.scheduleAlarm(this);
}
}

}
}
Loading

0 comments on commit 53cacb2

Please sign in to comment.