зеркало из https://github.com/mozilla/gecko-dev.git
Bug 827445 - Updater continues to notify about updates
This commit is contained in:
Родитель
aa8d052ed3
Коммит
d8d2db4268
|
@ -115,9 +115,11 @@ public class UpdateService extends IntentService {
|
|||
|
||||
registerForUpdates(false);
|
||||
} else if (UpdateServiceHelper.ACTION_CHECK_FOR_UPDATE.equals(intent.getAction())) {
|
||||
Log.i(LOGTAG, "XYZZY Coming from Point 1");
|
||||
startUpdate(intent.getIntExtra(UpdateServiceHelper.EXTRA_UPDATE_FLAGS_NAME, 0));
|
||||
} else if (UpdateServiceHelper.ACTION_DOWNLOAD_UPDATE.equals(intent.getAction())) {
|
||||
// We always want to do the download here
|
||||
Log.i(LOGTAG, "XYZZY Coming from Point 2");
|
||||
startUpdate(UpdateServiceHelper.FLAG_FORCE_DOWNLOAD);
|
||||
} else if (UpdateServiceHelper.ACTION_APPLY_UPDATE.equals(intent.getAction())) {
|
||||
applyUpdate(intent.getStringExtra(UpdateServiceHelper.EXTRA_PACKAGE_PATH_NAME));
|
||||
|
@ -158,6 +160,7 @@ public class UpdateService extends IntentService {
|
|||
// We've either never attempted an update, or we are passed the desired
|
||||
// time. Start an update now.
|
||||
Log.i(LOGTAG, "no update has ever been attempted, checking now");
|
||||
Log.i(LOGTAG, "XYZZY Coming from Point 3");
|
||||
startUpdate(0);
|
||||
return;
|
||||
}
|
||||
|
@ -201,6 +204,7 @@ public class UpdateService extends IntentService {
|
|||
|
||||
int connectionType = netInfo.getType();
|
||||
int autoDownloadPolicy = getAutoDownloadPolicy();
|
||||
Log.i(LOGTAG, "XYZZY Checking AutoDownloadPolicy " + Integer.toString(autoDownloadPolicy));
|
||||
|
||||
|
||||
/**
|
||||
|
@ -210,6 +214,9 @@ public class UpdateService extends IntentService {
|
|||
* - The preference is set to 'always'
|
||||
* - The preference is set to 'wifi' and we are actually using wifi (or regular ethernet)
|
||||
*/
|
||||
|
||||
Log.i(LOGTAG, "XYZZY " + Integer.toString(flags));
|
||||
|
||||
boolean shouldStartDownload = hasFlag(flags, UpdateServiceHelper.FLAG_FORCE_DOWNLOAD) ||
|
||||
autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_ENABLED ||
|
||||
(autoDownloadPolicy == UpdateServiceHelper.AUTODOWNLOAD_WIFI &&
|
||||
|
@ -560,9 +567,11 @@ public class UpdateService extends IntentService {
|
|||
}
|
||||
|
||||
private void setAutoDownloadPolicy(int policy) {
|
||||
Log.i(LOGTAG, "XYZZY Setting AutoDownloadPolicy " + Integer.toString(policy));
|
||||
SharedPreferences.Editor editor = mPrefs.edit();
|
||||
editor.putInt(KEY_AUTODOWNLOAD_POLICY, policy);
|
||||
editor.commit();
|
||||
Log.i(LOGTAG, "XYZZY Verifying AutoDownloadPolicy " + Integer.toString(getAutoDownloadPolicy()));
|
||||
}
|
||||
|
||||
private void saveUpdateInfo(UpdateInfo info, File downloaded) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче