diff options
| author | Govinda Wasserman <gwasserman@google.com> | 2021-08-19 18:36:15 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2021-08-19 18:36:15 +0000 |
| commit | bfbda478d30e6b25cc6d2f5f9367f2d14bb20e26 (patch) | |
| tree | 618aad3b5183bef45f85fe82ee272643113853b4 /core/java | |
| parent | e7ea7111f249877cdeee5df97bfa34fd43bcace1 (diff) | |
| parent | 3de2a1e721319acd5af674d7d7c1ee8413858eff (diff) | |
Merge "Allow BackupHelper to be overridden" into sc-qpr1-dev am: 3de2a1e721
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15596703
Change-Id: I242397f7dd28c8d4df9ccf57010b6072ebfc67cf
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/backup/BackupManager.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/core/java/android/app/backup/BackupManager.java b/core/java/android/app/backup/BackupManager.java index dae565e12fd7..67f631f98f0b 100644 --- a/core/java/android/app/backup/BackupManager.java +++ b/core/java/android/app/backup/BackupManager.java @@ -281,6 +281,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 * P and later, this method is a no-op. * |
