Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b71fedc4 authored by Michal Karpinski's avatar Michal Karpinski
Browse files

Unhide enabling backup service in DO APIs

Bug: 28628532
Change-Id: I5940735994c7e63fae86549fedcf138ad12151cd
parent 606c2a23
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -6128,6 +6128,7 @@ package android.app.admin {
    method public boolean isActivePasswordSufficient();
    method public boolean isAdminActive(android.content.ComponentName);
    method public boolean isApplicationHidden(android.content.ComponentName, java.lang.String);
    method public boolean isBackupServiceEnabled(android.content.ComponentName);
    method public boolean isCallerApplicationRestrictionsManagingPackage();
    method public boolean isDeviceOwnerApp(java.lang.String);
    method public boolean isLockTaskPermitted(java.lang.String);
@@ -6158,6 +6159,7 @@ package android.app.admin {
    method public void setApplicationRestrictions(android.content.ComponentName, java.lang.String, android.os.Bundle);
    method public void setApplicationRestrictionsManagingPackage(android.content.ComponentName, java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public void setAutoTimeRequired(android.content.ComponentName, boolean);
    method public void setBackupServiceEnabled(android.content.ComponentName, boolean);
    method public void setBluetoothContactSharingDisabled(android.content.ComponentName, boolean);
    method public void setCameraDisabled(android.content.ComponentName, boolean);
    method public void setCertInstallerPackage(android.content.ComponentName, java.lang.String) throws java.lang.SecurityException;
+2 −0
Original line number Diff line number Diff line
@@ -6318,6 +6318,7 @@ package android.app.admin {
    method public boolean isActivePasswordSufficient();
    method public boolean isAdminActive(android.content.ComponentName);
    method public boolean isApplicationHidden(android.content.ComponentName, java.lang.String);
    method public boolean isBackupServiceEnabled(android.content.ComponentName);
    method public boolean isCallerApplicationRestrictionsManagingPackage();
    method public boolean isDeviceManaged();
    method public boolean isDeviceOwnerApp(java.lang.String);
@@ -6353,6 +6354,7 @@ package android.app.admin {
    method public void setApplicationRestrictions(android.content.ComponentName, java.lang.String, android.os.Bundle);
    method public void setApplicationRestrictionsManagingPackage(android.content.ComponentName, java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public void setAutoTimeRequired(android.content.ComponentName, boolean);
    method public void setBackupServiceEnabled(android.content.ComponentName, boolean);
    method public void setBluetoothContactSharingDisabled(android.content.ComponentName, boolean);
    method public void setCameraDisabled(android.content.ComponentName, boolean);
    method public void setCertInstallerPackage(android.content.ComponentName, java.lang.String) throws java.lang.SecurityException;
+2 −0
Original line number Diff line number Diff line
@@ -6149,6 +6149,7 @@ package android.app.admin {
    method public boolean isActivePasswordSufficient();
    method public boolean isAdminActive(android.content.ComponentName);
    method public boolean isApplicationHidden(android.content.ComponentName, java.lang.String);
    method public boolean isBackupServiceEnabled(android.content.ComponentName);
    method public boolean isCallerApplicationRestrictionsManagingPackage();
    method public boolean isDeviceManaged();
    method public boolean isDeviceOwnerApp(java.lang.String);
@@ -6180,6 +6181,7 @@ package android.app.admin {
    method public void setApplicationRestrictions(android.content.ComponentName, java.lang.String, android.os.Bundle);
    method public void setApplicationRestrictionsManagingPackage(android.content.ComponentName, java.lang.String) throws android.content.pm.PackageManager.NameNotFoundException;
    method public void setAutoTimeRequired(android.content.ComponentName, boolean);
    method public void setBackupServiceEnabled(android.content.ComponentName, boolean);
    method public void setBluetoothContactSharingDisabled(android.content.ComponentName, boolean);
    method public void setCameraDisabled(android.content.ComponentName, boolean);
    method public void setCertInstallerPackage(android.content.ComponentName, java.lang.String) throws java.lang.SecurityException;
+11 −8
Original line number Diff line number Diff line
@@ -7122,15 +7122,14 @@ public class DevicePolicyManager {
    }

    /**
     * @hide
     * Enable backup service.
     * <p>This includes all backup and restore mechanisms.
     * Setting this to {@code false} will make backup service no-op or return empty results.
     * Allows the device owner to enable or disable the backup service.
     *
     * <p>There must be only one user on the device, managed by the device owner.
     * Otherwise a {@link SecurityException} will be thrown.
     * <p> Backup service manages all backup and restore mechanisms on the device. Setting this to
     * false will prevent data from being backed up or restored.
     *
     * <p> Backup service is off by default when device owner is present.
     *
     * @throws SecurityException if {@code admin} is not a device owner.
     */
    public void setBackupServiceEnabled(@NonNull ComponentName admin, boolean enabled) {
        try {
@@ -7141,8 +7140,12 @@ public class DevicePolicyManager {
    }

    /**
     * @hide
     * Return whether the backup service is enabled by the device owner.
     *
     * <p> Backup service manages all backup and restore mechanisms on the device.
     *
     * @return {@code true} if backup service is enabled, {@code false} otherwise.
     * @see #setBackupServiceEnabled
     */
    public boolean isBackupServiceEnabled(@NonNull ComponentName admin) {
        try {