summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java b/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java
index 141f9207b314..d044cb55cd9f 100644
--- a/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java
+++ b/services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java
@@ -77,6 +77,7 @@ import android.os.RemoteException;
import android.os.SELinux;
import android.os.ServiceManager;
import android.os.SystemClock;
+import android.os.Trace;
import android.os.UserHandle;
import android.os.storage.IStorageManager;
import android.os.storage.StorageManager;
@@ -546,9 +547,12 @@ public class RefactoredBackupManagerService implements BackupManagerServiceInter
@Override
public void onUnlockUser(int userId) {
if (userId == UserHandle.USER_SYSTEM) {
+ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "backup init");
sInstance.initialize(userId);
+ Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
// Migrate legacy setting
+ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "backup migrate");
if (!backupSettingMigrated(userId)) {
if (DEBUG) {
Slog.i(TAG, "Backup enable apparently not migrated");
@@ -569,12 +573,15 @@ public class RefactoredBackupManagerService implements BackupManagerServiceInter
}
}
}
+ Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
+ Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "backup enable");
try {
sInstance.setBackupEnabled(readBackupEnableState(userId));
} catch (RemoteException e) {
// can't happen; it's a local object
}
+ Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
}
}
}
@@ -1759,8 +1766,12 @@ public class RefactoredBackupManagerService implements BackupManagerServiceInter
// Can't delete op from mCurrentOperations here. waitUntilOperationComplete may be
// called after we receive cancel here. We need this op's state there.
- // Remove all pending timeout messages for this operation type.
- mBackupHandler.removeMessages(getMessageIdForOperationType(op.type));
+ // Remove all pending timeout messages of types OP_TYPE_BACKUP_WAIT and
+ // OP_TYPE_RESTORE_WAIT. On the other hand, OP_TYPE_BACKUP cannot time out and
+ // doesn't require cancellation.
+ if (op.type == OP_TYPE_BACKUP_WAIT || op.type == OP_TYPE_RESTORE_WAIT) {
+ mBackupHandler.removeMessages(getMessageIdForOperationType(op.type));
+ }
}
mCurrentOpLock.notifyAll();
}