diff options
| -rw-r--r-- | services/backup/java/com/android/server/backup/UserBackupManagerService.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/services/backup/java/com/android/server/backup/UserBackupManagerService.java b/services/backup/java/com/android/server/backup/UserBackupManagerService.java index 03f21498766d..32a814468f12 100644 --- a/services/backup/java/com/android/server/backup/UserBackupManagerService.java +++ b/services/backup/java/com/android/server/backup/UserBackupManagerService.java @@ -234,8 +234,10 @@ public class UserBackupManagerService { // CPU on bring-up and increase time-to-UI. private static final long INITIALIZATION_DELAY_MILLIS = 3000; - // Timeout interval for deciding that a bind or clear-data has taken too long - private static final long TIMEOUT_INTERVAL = 10 * 1000; + // Timeout interval for deciding that a bind has taken too long. + private static final long BIND_TIMEOUT_INTERVAL = 10 * 1000; + // Timeout interval for deciding that a clear-data has taken too long. + private static final long CLEAR_DATA_TIMEOUT_INTERVAL = 30 * 1000; // User confirmation timeout for a full backup/restore operation. It's this long in // order to give them time to enter the backup password. @@ -1449,7 +1451,7 @@ public class UserBackupManagerService { // success; wait for the agent to arrive // only wait 10 seconds for the bind to happen - long timeoutMark = System.currentTimeMillis() + TIMEOUT_INTERVAL; + long timeoutMark = System.currentTimeMillis() + BIND_TIMEOUT_INTERVAL; while (mConnecting && mConnectedAgent == null && (System.currentTimeMillis() < timeoutMark)) { try { @@ -1554,16 +1556,22 @@ public class UserBackupManagerService { // can't happen because the activity manager is in this process } - // only wait 10 seconds for the clear data to happen - long timeoutMark = System.currentTimeMillis() + TIMEOUT_INTERVAL; + // Only wait 30 seconds for the clear data to happen. + long timeoutMark = System.currentTimeMillis() + CLEAR_DATA_TIMEOUT_INTERVAL; while (mClearingData && (System.currentTimeMillis() < timeoutMark)) { try { mClearDataLock.wait(5000); } catch (InterruptedException e) { // won't happen, but still. mClearingData = false; + Slog.w(TAG, "Interrupted while waiting for " + packageName + + " data to be cleared", e); } } + + if (mClearingData) { + Slog.w(TAG, "Clearing app data for " + packageName + " timed out"); + } } } |