Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -580,6 +580,7 @@ package android.app.admin { method public java.util.List<java.lang.String> getOwnerInstalledCaCerts(@NonNull android.os.UserHandle); method public boolean isCurrentInputMethodSetByOwner(); method public boolean isDeviceManaged(); method public boolean isFactoryResetProtectionPolicySupported(); field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_ALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_ALLOWED"; field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_DISALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_DISALLOWED"; field public static final String ACTION_DATA_SHARING_RESTRICTION_APPLIED = "android.app.action.DATA_SHARING_RESTRICTION_APPLIED"; Loading core/java/android/app/admin/DevicePolicyManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -10952,6 +10952,22 @@ public class DevicePolicyManager { } } /** * Returns whether factory reset protection policy is supported on the device. * * @return {@code true} if the device support factory reset protection policy. * * @hide */ @TestApi public boolean isFactoryResetProtectionPolicySupported() { try { return mService.isFactoryResetProtectionPolicySupported(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Called by the device owner or profile owner to clear application user data of a given * package. The behaviour of this is equivalent to the target application calling Loading core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ interface IDevicePolicyManager { void setFactoryResetProtectionPolicy(in ComponentName who, in FactoryResetProtectionPolicy policy); FactoryResetProtectionPolicy getFactoryResetProtectionPolicy(in ComponentName who); boolean isFactoryResetProtectionPolicySupported(); ComponentName setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList); ComponentName getGlobalProxyAdmin(int userHandle); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +13 −3 Original line number Diff line number Diff line Loading @@ -7326,13 +7326,23 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { return admin != null ? admin.mFactoryResetProtectionPolicy : null; } private int getFrpManagementAgentUidOrThrow() { private int getFrpManagementAgentUid() { PersistentDataBlockManagerInternal pdb = mInjector.getPersistentDataBlockManagerInternal(); if ((pdb == null) || (pdb.getAllowedUid() == -1)) { return pdb != null ? pdb.getAllowedUid() : -1; } private int getFrpManagementAgentUidOrThrow() { int uid = getFrpManagementAgentUid(); if (uid == -1) { throw new UnsupportedOperationException( "The persistent data block service is not supported on this device"); } return pdb.getAllowedUid(); return uid; } @Override public boolean isFactoryResetProtectionPolicySupported() { return getFrpManagementAgentUid() != -1; } @Override Loading Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -580,6 +580,7 @@ package android.app.admin { method public java.util.List<java.lang.String> getOwnerInstalledCaCerts(@NonNull android.os.UserHandle); method public boolean isCurrentInputMethodSetByOwner(); method public boolean isDeviceManaged(); method public boolean isFactoryResetProtectionPolicySupported(); field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_ALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_ALLOWED"; field public static final String ACCOUNT_FEATURE_DEVICE_OR_PROFILE_OWNER_DISALLOWED = "android.account.DEVICE_OR_PROFILE_OWNER_DISALLOWED"; field public static final String ACTION_DATA_SHARING_RESTRICTION_APPLIED = "android.app.action.DATA_SHARING_RESTRICTION_APPLIED"; Loading
core/java/android/app/admin/DevicePolicyManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -10952,6 +10952,22 @@ public class DevicePolicyManager { } } /** * Returns whether factory reset protection policy is supported on the device. * * @return {@code true} if the device support factory reset protection policy. * * @hide */ @TestApi public boolean isFactoryResetProtectionPolicySupported() { try { return mService.isFactoryResetProtectionPolicySupported(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } /** * Called by the device owner or profile owner to clear application user data of a given * package. The behaviour of this is equivalent to the target application calling Loading
core/java/android/app/admin/IDevicePolicyManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -108,6 +108,7 @@ interface IDevicePolicyManager { void setFactoryResetProtectionPolicy(in ComponentName who, in FactoryResetProtectionPolicy policy); FactoryResetProtectionPolicy getFactoryResetProtectionPolicy(in ComponentName who); boolean isFactoryResetProtectionPolicySupported(); ComponentName setGlobalProxy(in ComponentName admin, String proxySpec, String exclusionList); ComponentName getGlobalProxyAdmin(int userHandle); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +13 −3 Original line number Diff line number Diff line Loading @@ -7326,13 +7326,23 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { return admin != null ? admin.mFactoryResetProtectionPolicy : null; } private int getFrpManagementAgentUidOrThrow() { private int getFrpManagementAgentUid() { PersistentDataBlockManagerInternal pdb = mInjector.getPersistentDataBlockManagerInternal(); if ((pdb == null) || (pdb.getAllowedUid() == -1)) { return pdb != null ? pdb.getAllowedUid() : -1; } private int getFrpManagementAgentUidOrThrow() { int uid = getFrpManagementAgentUid(); if (uid == -1) { throw new UnsupportedOperationException( "The persistent data block service is not supported on this device"); } return pdb.getAllowedUid(); return uid; } @Override public boolean isFactoryResetProtectionPolicySupported() { return getFrpManagementAgentUid() != -1; } @Override Loading