Loading core/java/android/app/backup/BackupManager.java +26 −0 Original line number Original line Diff line number Diff line Loading @@ -280,6 +280,32 @@ public class BackupManager { } } } } /** * Convenience method for callers who need to indicate that some other package or * some other user needs a backup pass. This can be useful in the case of groups of * packages that share a uid and/or have user-specific data. * <p> * This method requires that the application hold the "android.permission.BACKUP" * permission if the package named in the package argument does not run under the * same uid as the caller. This method also requires that the application hold the * "android.permission.INTERACT_ACROSS_USERS_FULL" if the user argument is not the * same as the user the caller is running under. * @param userId The user to back up * @param packageName The package name identifying the application to back up. * * @hide */ public static void dataChangedForUser(int userId, String packageName) { checkServiceBinder(); if (sService != null) { try { sService.dataChangedForUser(userId, packageName); } catch (RemoteException e) { Log.e(TAG, "dataChanged(userId,pkg) couldn't connect"); } } } /** /** * @deprecated Applications shouldn't request a restore operation using this method. In Android * @deprecated Applications shouldn't request a restore operation using this method. In Android * P and later, this method is a no-op. * P and later, this method is a no-op. Loading packages/SystemUI/src/com/android/systemui/backup/BackupHelper.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -40,10 +40,10 @@ import com.android.systemui.people.widget.PeopleBackupHelper * After restoring is done, a [ACTION_RESTORE_FINISHED] intent will be send to SystemUI user 0, * After restoring is done, a [ACTION_RESTORE_FINISHED] intent will be send to SystemUI user 0, * indicating that restoring is finished for a given user. * indicating that restoring is finished for a given user. */ */ class BackupHelper : BackupAgentHelper() { open class BackupHelper : BackupAgentHelper() { companion object { companion object { private const val TAG = "BackupHelper" const val TAG = "BackupHelper" internal const val CONTROLS = ControlsFavoritePersistenceWrapper.FILE_NAME internal const val CONTROLS = ControlsFavoritePersistenceWrapper.FILE_NAME private const val NO_OVERWRITE_FILES_BACKUP_KEY = "systemui.files_no_overwrite" private const val NO_OVERWRITE_FILES_BACKUP_KEY = "systemui.files_no_overwrite" private const val PEOPLE_TILES_BACKUP_KEY = "systemui.people.shared_preferences" private const val PEOPLE_TILES_BACKUP_KEY = "systemui.people.shared_preferences" Loading Loading
core/java/android/app/backup/BackupManager.java +26 −0 Original line number Original line Diff line number Diff line Loading @@ -280,6 +280,32 @@ public class BackupManager { } } } } /** * Convenience method for callers who need to indicate that some other package or * some other user needs a backup pass. This can be useful in the case of groups of * packages that share a uid and/or have user-specific data. * <p> * This method requires that the application hold the "android.permission.BACKUP" * permission if the package named in the package argument does not run under the * same uid as the caller. This method also requires that the application hold the * "android.permission.INTERACT_ACROSS_USERS_FULL" if the user argument is not the * same as the user the caller is running under. * @param userId The user to back up * @param packageName The package name identifying the application to back up. * * @hide */ public static void dataChangedForUser(int userId, String packageName) { checkServiceBinder(); if (sService != null) { try { sService.dataChangedForUser(userId, packageName); } catch (RemoteException e) { Log.e(TAG, "dataChanged(userId,pkg) couldn't connect"); } } } /** /** * @deprecated Applications shouldn't request a restore operation using this method. In Android * @deprecated Applications shouldn't request a restore operation using this method. In Android * P and later, this method is a no-op. * P and later, this method is a no-op. Loading
packages/SystemUI/src/com/android/systemui/backup/BackupHelper.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -40,10 +40,10 @@ import com.android.systemui.people.widget.PeopleBackupHelper * After restoring is done, a [ACTION_RESTORE_FINISHED] intent will be send to SystemUI user 0, * After restoring is done, a [ACTION_RESTORE_FINISHED] intent will be send to SystemUI user 0, * indicating that restoring is finished for a given user. * indicating that restoring is finished for a given user. */ */ class BackupHelper : BackupAgentHelper() { open class BackupHelper : BackupAgentHelper() { companion object { companion object { private const val TAG = "BackupHelper" const val TAG = "BackupHelper" internal const val CONTROLS = ControlsFavoritePersistenceWrapper.FILE_NAME internal const val CONTROLS = ControlsFavoritePersistenceWrapper.FILE_NAME private const val NO_OVERWRITE_FILES_BACKUP_KEY = "systemui.files_no_overwrite" private const val NO_OVERWRITE_FILES_BACKUP_KEY = "systemui.files_no_overwrite" private const val PEOPLE_TILES_BACKUP_KEY = "systemui.people.shared_preferences" private const val PEOPLE_TILES_BACKUP_KEY = "systemui.people.shared_preferences" Loading