Loading core/java/android/app/backup/BackupManager.java +22 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,28 @@ public class BackupManager { return false; } /** * Enable/disable data restore at application install time. When enabled, app * installation will include an attempt to fetch the app's historical data from * the archival restore dataset (if any). When disabled, no such attempt will * be made. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @hide */ @SystemApi public void setAutoRestore(boolean isEnabled) { checkServiceBinder(); if (sService != null) { try { sService.setAutoRestore(isEnabled); } catch (RemoteException e) { Log.e(TAG, "setAutoRestore() couldn't connect"); } } } /** * Identify the currently selected transport. Callers must hold the * android.permission.BACKUP permission to use this method. Loading services/backup/java/com/android/server/backup/BackupManagerService.java +10 −2 Original line number Diff line number Diff line Loading @@ -8599,7 +8599,15 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF skip = true; } if (!skip && mAutoRestore && mProvisioned) { if (!mAutoRestore || !mProvisioned) { if (DEBUG) { Slog.w(TAG, "Non-restorable state: auto=" + mAutoRestore + " prov=" + mProvisioned); } skip = true; } if (!skip) { try { // okay, we're going to attempt a restore of this package from this restore set. // The eventual message back into the Package Manager to run the post-install Loading Loading @@ -8632,7 +8640,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF if (skip) { // Auto-restore disabled or no way to attempt a restore; just tell the Package // Manager to proceed with the post-install handling for this package. if (DEBUG) Slog.v(TAG, "Skipping"); if (DEBUG) Slog.v(TAG, "Finishing install immediately"); try { mPackageManagerBinder.finishPackageInstall(token); } catch (RemoteException e) { /* can't happen */ } Loading Loading
core/java/android/app/backup/BackupManager.java +22 −0 Original line number Diff line number Diff line Loading @@ -228,6 +228,28 @@ public class BackupManager { return false; } /** * Enable/disable data restore at application install time. When enabled, app * installation will include an attempt to fetch the app's historical data from * the archival restore dataset (if any). When disabled, no such attempt will * be made. * * <p>Callers must hold the android.permission.BACKUP permission to use this method. * * @hide */ @SystemApi public void setAutoRestore(boolean isEnabled) { checkServiceBinder(); if (sService != null) { try { sService.setAutoRestore(isEnabled); } catch (RemoteException e) { Log.e(TAG, "setAutoRestore() couldn't connect"); } } } /** * Identify the currently selected transport. Callers must hold the * android.permission.BACKUP permission to use this method. Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +10 −2 Original line number Diff line number Diff line Loading @@ -8599,7 +8599,15 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF skip = true; } if (!skip && mAutoRestore && mProvisioned) { if (!mAutoRestore || !mProvisioned) { if (DEBUG) { Slog.w(TAG, "Non-restorable state: auto=" + mAutoRestore + " prov=" + mProvisioned); } skip = true; } if (!skip) { try { // okay, we're going to attempt a restore of this package from this restore set. // The eventual message back into the Package Manager to run the post-install Loading Loading @@ -8632,7 +8640,7 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF if (skip) { // Auto-restore disabled or no way to attempt a restore; just tell the Package // Manager to proceed with the post-install handling for this package. if (DEBUG) Slog.v(TAG, "Skipping"); if (DEBUG) Slog.v(TAG, "Finishing install immediately"); try { mPackageManagerBinder.finishPackageInstall(token); } catch (RemoteException e) { /* can't happen */ } Loading