- Enable Android API to allow disabling of framework backup scheduling

Test: See http://ag/20928723 - It's on the same topic as this
Bug: 261196598
Change-Id: I54b03a9c09e0b05da9c39549e3f62023ec67c817
This commit is contained in:
Andrea Zilio
2023-01-09 18:04:53 +00:00
parent eb07747a21
commit 095406a25f
2 changed files with 6 additions and 2 deletions

View File

@@ -1522,6 +1522,7 @@ package android.app.backup {
method @RequiresPermission(android.Manifest.permission.BACKUP) public void setAncestralSerialNumber(long);
method @RequiresPermission(android.Manifest.permission.BACKUP) public void setAutoRestore(boolean);
method @RequiresPermission(android.Manifest.permission.BACKUP) public void setBackupEnabled(boolean);
method @RequiresPermission(allOf={android.Manifest.permission.BACKUP, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}, conditional=true) public void setFrameworkSchedulingEnabled(boolean);
method @Deprecated @RequiresPermission(android.Manifest.permission.BACKUP) public void updateTransportAttributes(@NonNull android.content.ComponentName, @NonNull String, @Nullable android.content.Intent, @NonNull String, @Nullable android.content.Intent, @Nullable String);
method @RequiresPermission(android.Manifest.permission.BACKUP) public void updateTransportAttributes(@NonNull android.content.ComponentName, @NonNull String, @Nullable android.content.Intent, @NonNull String, @Nullable android.content.Intent, @Nullable CharSequence);
field public static final int ERROR_AGENT_FAILURE = -1003; // 0xfffffc15

View File

@@ -407,16 +407,19 @@ public class BackupManager {
}
/**
* Enable/disable the framework backup scheduling entirely for the current user. When disabled,
* Enable/disable the framework backup scheduling entirely for the context user. When disabled,
* no Key/Value or Full backup jobs will be scheduled by the Android framework.
*
* <p>Note: This does not disable backups: only their scheduling is affected and backups can
* still be triggered manually.
*
* <p>Callers must hold the android.permission.BACKUP permission to use this method.
* <p>Callers must hold the android.permission.BACKUP permission to use this method. If the
* context user is different from the calling user, then the caller must additionally hold the
* android.permission.INTERACT_ACROSS_USERS_FULL permission.
*
* @hide
*/
@SystemApi
@RequiresPermission(allOf = {android.Manifest.permission.BACKUP,
android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}, conditional = true)
public void setFrameworkSchedulingEnabled(boolean isEnabled) {