Loading services/backup/java/com/android/server/backup/BackupManagerService.java +31 −0 Original line number Diff line number Diff line Loading @@ -867,6 +867,7 @@ public class BackupManagerService extends IBackupManager.Stub { // the timeout is suspended while a restore is in progress. Clean // up now. Slog.w(TAG, "Restore session timed out; aborting"); mActiveRestoreSession.markTimedOut(); post(mActiveRestoreSession.new EndRestoreRunnable( BackupManagerService.this, mActiveRestoreSession)); } Loading Loading @@ -8738,12 +8739,17 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF private IBackupTransport mRestoreTransport = null; RestoreSet[] mRestoreSets = null; boolean mEnded = false; boolean mTimedOut = false; ActiveRestoreSession(String packageName, String transport) { mPackageName = packageName; mRestoreTransport = getTransport(transport); } public void markTimedOut() { mTimedOut = true; } // --- Binder interface --- public synchronized int getAvailableRestoreSets(IRestoreObserver observer) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, Loading @@ -8756,6 +8762,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new IllegalStateException("Restore session already ended"); } if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return -1; } long oldId = Binder.clearCallingIdentity(); try { if (mRestoreTransport == null) { Loading Loading @@ -8787,6 +8798,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new IllegalStateException("Restore session already ended"); } if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return -1; } if (mRestoreTransport == null || mRestoreSets == null) { Slog.e(TAG, "Ignoring restoreAll() with no restore set"); return -1; Loading Loading @@ -8861,6 +8877,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new IllegalStateException("Restore session already ended"); } if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return -1; } if (mRestoreTransport == null || mRestoreSets == null) { Slog.e(TAG, "Ignoring restoreAll() with no restore set"); return -1; Loading Loading @@ -8909,6 +8930,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new IllegalStateException("Restore session already ended"); } if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return -1; } if (mPackageName != null) { if (! mPackageName.equals(packageName)) { Slog.e(TAG, "Ignoring attempt to restore pkg=" + packageName Loading Loading @@ -9006,6 +9032,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF public synchronized void endRestoreSession() { if (DEBUG) Slog.d(TAG, "endRestoreSession"); if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return; } if (mEnded) { throw new IllegalStateException("Restore session already ended"); } Loading Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +31 −0 Original line number Diff line number Diff line Loading @@ -867,6 +867,7 @@ public class BackupManagerService extends IBackupManager.Stub { // the timeout is suspended while a restore is in progress. Clean // up now. Slog.w(TAG, "Restore session timed out; aborting"); mActiveRestoreSession.markTimedOut(); post(mActiveRestoreSession.new EndRestoreRunnable( BackupManagerService.this, mActiveRestoreSession)); } Loading Loading @@ -8738,12 +8739,17 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF private IBackupTransport mRestoreTransport = null; RestoreSet[] mRestoreSets = null; boolean mEnded = false; boolean mTimedOut = false; ActiveRestoreSession(String packageName, String transport) { mPackageName = packageName; mRestoreTransport = getTransport(transport); } public void markTimedOut() { mTimedOut = true; } // --- Binder interface --- public synchronized int getAvailableRestoreSets(IRestoreObserver observer) { mContext.enforceCallingOrSelfPermission(android.Manifest.permission.BACKUP, Loading @@ -8756,6 +8762,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new IllegalStateException("Restore session already ended"); } if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return -1; } long oldId = Binder.clearCallingIdentity(); try { if (mRestoreTransport == null) { Loading Loading @@ -8787,6 +8798,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new IllegalStateException("Restore session already ended"); } if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return -1; } if (mRestoreTransport == null || mRestoreSets == null) { Slog.e(TAG, "Ignoring restoreAll() with no restore set"); return -1; Loading Loading @@ -8861,6 +8877,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new IllegalStateException("Restore session already ended"); } if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return -1; } if (mRestoreTransport == null || mRestoreSets == null) { Slog.e(TAG, "Ignoring restoreAll() with no restore set"); return -1; Loading Loading @@ -8909,6 +8930,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF throw new IllegalStateException("Restore session already ended"); } if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return -1; } if (mPackageName != null) { if (! mPackageName.equals(packageName)) { Slog.e(TAG, "Ignoring attempt to restore pkg=" + packageName Loading Loading @@ -9006,6 +9032,11 @@ if (MORE_DEBUG) Slog.v(TAG, " + got " + nRead + "; now wanting " + (size - soF public synchronized void endRestoreSession() { if (DEBUG) Slog.d(TAG, "endRestoreSession"); if (mTimedOut) { Slog.i(TAG, "Session already timed out"); return; } if (mEnded) { throw new IllegalStateException("Restore session already ended"); } Loading