Loading core/java/android/app/backup/IBackupManager.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -596,6 +596,12 @@ interface IBackupManager { @UnsupportedAppUsage boolean isBackupServiceActive(int whichUser); /** * Checks if the user is ready for backup or not. * @param userId User id for which this operation should be performed. */ boolean isUserReadyForBackup(int userId); /** * Ask the framework which dataset, if any, the given package's data would be * restored from if we were to install it right now. Loading services/backup/java/com/android/server/backup/BackupManagerService.java +8 −3 Original line number Diff line number Diff line Loading @@ -274,9 +274,14 @@ public class BackupManagerService extends IBackupManager.Stub { } } // This method should not perform any I/O (e.g. do not call isBackupActivatedForUser), // it's used in multiple places where I/O waits would cause system lock-ups. private boolean isUserReadyForBackup(int userId) { /** * This method should not perform any I/O (e.g. do not call isBackupActivatedForUser), * it's used in multiple places where I/O waits would cause system lock-ups. * @param userId User id for which this operation should be performed. * @return true if the user is ready for backup and false otherwise. */ @Override public boolean isUserReadyForBackup(int userId) { return mUserServices.get(UserHandle.USER_SYSTEM) != null && mUserServices.get(userId) != null; } Loading services/core/java/com/android/server/pm/PackageManagerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -13487,10 +13487,12 @@ public class PackageManagerService extends IPackageManager.Stub } Trace.asyncTraceBegin(TRACE_TAG_PACKAGE_MANAGER, "restore", token); try { if (bm.isBackupServiceActive(userId)) { if (bm.isUserReadyForBackup(userId)) { bm.restoreAtInstallForUser( userId, res.pkg.getAppInfoPackageName(), token); } else { Slog.w(TAG, "User " + userId + " is not ready. Restore at install " + "didn't take place."); return false; } } catch (RemoteException e) { Loading
core/java/android/app/backup/IBackupManager.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -596,6 +596,12 @@ interface IBackupManager { @UnsupportedAppUsage boolean isBackupServiceActive(int whichUser); /** * Checks if the user is ready for backup or not. * @param userId User id for which this operation should be performed. */ boolean isUserReadyForBackup(int userId); /** * Ask the framework which dataset, if any, the given package's data would be * restored from if we were to install it right now. Loading
services/backup/java/com/android/server/backup/BackupManagerService.java +8 −3 Original line number Diff line number Diff line Loading @@ -274,9 +274,14 @@ public class BackupManagerService extends IBackupManager.Stub { } } // This method should not perform any I/O (e.g. do not call isBackupActivatedForUser), // it's used in multiple places where I/O waits would cause system lock-ups. private boolean isUserReadyForBackup(int userId) { /** * This method should not perform any I/O (e.g. do not call isBackupActivatedForUser), * it's used in multiple places where I/O waits would cause system lock-ups. * @param userId User id for which this operation should be performed. * @return true if the user is ready for backup and false otherwise. */ @Override public boolean isUserReadyForBackup(int userId) { return mUserServices.get(UserHandle.USER_SYSTEM) != null && mUserServices.get(userId) != null; } Loading
services/core/java/com/android/server/pm/PackageManagerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -13487,10 +13487,12 @@ public class PackageManagerService extends IPackageManager.Stub } Trace.asyncTraceBegin(TRACE_TAG_PACKAGE_MANAGER, "restore", token); try { if (bm.isBackupServiceActive(userId)) { if (bm.isUserReadyForBackup(userId)) { bm.restoreAtInstallForUser( userId, res.pkg.getAppInfoPackageName(), token); } else { Slog.w(TAG, "User " + userId + " is not ready. Restore at install " + "didn't take place."); return false; } } catch (RemoteException e) {