Loading core/java/android/app/admin/DevicePolicyManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -6465,6 +6465,18 @@ public class DevicePolicyManager { } } /** * @hide * Force update user setup completed status */ public void forceUpdateUserSetupComplete() { try { mService.forceUpdateUserSetupComplete(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } private void throwIfParentInstance(String functionName) { if (mParentInstance) { throw new SecurityException(functionName + " cannot be called on the parent instance"); Loading core/java/android/app/admin/IDevicePolicyManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -305,4 +305,6 @@ interface IDevicePolicyManager { boolean isDeviceProvisioned(); boolean isDeviceProvisioningConfigApplied(); void setDeviceProvisioningConfigApplied(); void forceUpdateUserSetupComplete(); } services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +24 −0 Original line number Diff line number Diff line Loading @@ -9131,4 +9131,28 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return policy.mDeviceProvisioningConfigApplied; } } /** * Force update internal persistent state from Settings.Secure.USER_SETUP_COMPLETE. * * It's added for testing only. Please use this API carefully if it's used by other system app * and bare in mind Settings.Secure.USER_SETUP_COMPLETE can be modified by user and other system * apps. */ @Override public void forceUpdateUserSetupComplete() { enforceCanManageProfileAndDeviceOwners(); List<UserInfo> users = mUserManager.getUsers(true); final int N = users.size(); for (int i = 0; i < N; i++) { int userHandle = users.get(i).id; boolean isUserCompleted = mInjector.settingsSecureGetIntForUser( Settings.Secure.USER_SETUP_COMPLETE, 0, userHandle) != 0; DevicePolicyData policy = getUserData(userHandle); policy.mUserSetupComplete = isUserCompleted; synchronized (this) { saveSettingsLocked(userHandle); } } } } Loading
core/java/android/app/admin/DevicePolicyManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -6465,6 +6465,18 @@ public class DevicePolicyManager { } } /** * @hide * Force update user setup completed status */ public void forceUpdateUserSetupComplete() { try { mService.forceUpdateUserSetupComplete(); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } } private void throwIfParentInstance(String functionName) { if (mParentInstance) { throw new SecurityException(functionName + " cannot be called on the parent instance"); Loading
core/java/android/app/admin/IDevicePolicyManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -305,4 +305,6 @@ interface IDevicePolicyManager { boolean isDeviceProvisioned(); boolean isDeviceProvisioningConfigApplied(); void setDeviceProvisioningConfigApplied(); void forceUpdateUserSetupComplete(); }
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +24 −0 Original line number Diff line number Diff line Loading @@ -9131,4 +9131,28 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { return policy.mDeviceProvisioningConfigApplied; } } /** * Force update internal persistent state from Settings.Secure.USER_SETUP_COMPLETE. * * It's added for testing only. Please use this API carefully if it's used by other system app * and bare in mind Settings.Secure.USER_SETUP_COMPLETE can be modified by user and other system * apps. */ @Override public void forceUpdateUserSetupComplete() { enforceCanManageProfileAndDeviceOwners(); List<UserInfo> users = mUserManager.getUsers(true); final int N = users.size(); for (int i = 0; i < N; i++) { int userHandle = users.get(i).id; boolean isUserCompleted = mInjector.settingsSecureGetIntForUser( Settings.Secure.USER_SETUP_COMPLETE, 0, userHandle) != 0; DevicePolicyData policy = getUserData(userHandle); policy.mUserSetupComplete = isUserCompleted; synchronized (this) { saveSettingsLocked(userHandle); } } } }