diff options
author | Christopher Tate <ctate@google.com> | 2015-01-30 00:17:19 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-01-30 00:17:19 +0000 |
commit | 7041420d9b0ca1e0f79157ccace48ac4e29adc29 (patch) | |
tree | 9397c4ef1ff40701c64b64c94c25fb1a7ebb4aea /services | |
parent | 0654196fb08fb8c0dfed65ece00f0a4596ed70c2 (diff) | |
parent | 9b36d1117a2f0eb0402b0f9dda8bc5d94b110061 (diff) | |
download | frameworks_base-7041420d9b0ca1e0f79157ccace48ac4e29adc29.zip frameworks_base-7041420d9b0ca1e0f79157ccace48ac4e29adc29.tar.gz frameworks_base-7041420d9b0ca1e0f79157ccace48ac4e29adc29.tar.bz2 |
am 9b36d111: am b71ac193: Merge "Don\'t run full-data backups when backup is disabled" into lmp-mr1-dev
* commit '9b36d1117a2f0eb0402b0f9dda8bc5d94b110061':
Don't run full-data backups when backup is disabled
Diffstat (limited to 'services')
-rw-r--r-- | services/backup/java/com/android/server/backup/BackupManagerService.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/services/backup/java/com/android/server/backup/BackupManagerService.java b/services/backup/java/com/android/server/backup/BackupManagerService.java index 289152b..c1e4994 100644 --- a/services/backup/java/com/android/server/backup/BackupManagerService.java +++ b/services/backup/java/com/android/server/backup/BackupManagerService.java @@ -382,6 +382,7 @@ public class BackupManagerService { // we're now good to go, so start the backup alarms if (MORE_DEBUG) Slog.d(TAG, "Now provisioned, so starting backups"); startBackupAlarmsLocked(FIRST_BACKUP_INTERVAL); + scheduleNextFullBackupJob(); } } } @@ -3853,6 +3854,16 @@ public class BackupManagerService { PackageInfo currentPackage; try { + if (!mEnabled || !mProvisioned) { + // Backups are globally disabled, so don't proceed. + if (DEBUG) { + Slog.i(TAG, "full backup requested but e=" + mEnabled + + " p=" + mProvisioned + "; ignoring"); + } + mUpdateSchedule = false; + return; + } + IBackupTransport transport = getTransport(mCurrentTransport); if (transport == null) { Slog.w(TAG, "Transport not present; full data backup not performed"); @@ -4150,6 +4161,17 @@ public class BackupManagerService { long now = System.currentTimeMillis(); FullBackupEntry entry = null; + if (!mEnabled || !mProvisioned) { + // Backups are globally disabled, so don't proceed. We also don't reschedule + // the job driving automatic backups; that job will be scheduled again when + // the user enables backup. + if (MORE_DEBUG) { + Slog.i(TAG, "beginFullBackup but e=" + mEnabled + + " p=" + mProvisioned + "; ignoring"); + } + return false; + } + if (DEBUG_SCHEDULING) { Slog.i(TAG, "Beginning scheduled full backup operation"); } |