Loading core/java/android/app/admin/DevicePolicyManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -5462,7 +5462,8 @@ public class DevicePolicyManager { public boolean isActivePasswordSufficient() { if (mService != null) { try { return mService.isActivePasswordSufficient(myUserId(), mParentInstance); return mService.isActivePasswordSufficient( mContext.getPackageName(), myUserId(), mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -5619,7 +5620,8 @@ public class DevicePolicyManager { } try { return mService.getRequiredPasswordComplexity(mParentInstance); return mService.getRequiredPasswordComplexity( mContext.getPackageName(), mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -5743,7 +5745,8 @@ public class DevicePolicyManager { public int getCurrentFailedPasswordAttempts(int userHandle) { if (mService != null) { try { return mService.getCurrentFailedPasswordAttempts(userHandle, mParentInstance); return mService.getCurrentFailedPasswordAttempts( mContext.getPackageName(), userHandle, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -16643,7 +16646,7 @@ public class DevicePolicyManager { return null; } try { return mService.getWifiSsidPolicy(); return mService.getWifiSsidPolicy(mContext.getPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } core/java/android/app/admin/IDevicePolicyManager.aidl +4 −4 Original line number Diff line number Diff line Loading @@ -96,15 +96,15 @@ interface IDevicePolicyManager { long getPasswordExpiration(in ComponentName who, int userHandle, boolean parent); boolean isActivePasswordSufficient(int userHandle, boolean parent); boolean isActivePasswordSufficient(String callerPackageName, int userHandle, boolean parent); boolean isActivePasswordSufficientForDeviceRequirement(); boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser); int getPasswordComplexity(boolean parent); void setRequiredPasswordComplexity(String callerPackageName, int passwordComplexity, boolean parent); int getRequiredPasswordComplexity(boolean parent); int getRequiredPasswordComplexity(String callerPackageName, boolean parent); int getAggregatedPasswordComplexityForUser(int userId, boolean deviceWideOnly); boolean isUsingUnifiedPassword(in ComponentName admin); int getCurrentFailedPasswordAttempts(int userHandle, boolean parent); int getCurrentFailedPasswordAttempts(String callerPackageName, int userHandle, boolean parent); int getProfileWithMinimumFailedPasswordsForWipe(int userHandle, boolean parent); void setMaximumFailedPasswordsForWipe( Loading Loading @@ -572,7 +572,7 @@ interface IDevicePolicyManager { int getMinimumRequiredWifiSecurityLevel(); void setWifiSsidPolicy(String callerPackageName, in WifiSsidPolicy policy); WifiSsidPolicy getWifiSsidPolicy(); WifiSsidPolicy getWifiSsidPolicy(String callerPackageName); List<UserHandle> listForegroundAffiliatedUsers(); void setDrawables(in List<DevicePolicyDrawableResource> drawables); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +12 −10 Original line number Diff line number Diff line Loading @@ -5067,7 +5067,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } @Override public boolean isActivePasswordSufficient(int userHandle, boolean parent) { public boolean isActivePasswordSufficient( String callerPackageName, int userHandle, boolean parent) { if (!mHasFeature) { return true; } Loading @@ -5081,7 +5082,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (isPermissionCheckFlagEnabled()) { int affectedUser = parent ? getProfileParentId(userHandle) : userHandle; enforcePermission(MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, /*callerPackageName=*/ null, affectedUser); callerPackageName, affectedUser); } else { // This API can only be called by an active device admin, // so try to retrieve it to check that the caller is one. Loading Loading @@ -5363,7 +5364,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } @Override public int getRequiredPasswordComplexity(boolean calledOnParent) { public int getRequiredPasswordComplexity(String callerPackageName, boolean calledOnParent) { if (!mHasFeature) { return PASSWORD_COMPLEXITY_NONE; } Loading @@ -5374,7 +5375,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { int affectedUser = calledOnParent ? getProfileParentId(caller.getUserId()) : caller.getUserId(); enforcePermission(MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, /*callerPackageName=*/ null, affectedUser); callerPackageName, affectedUser); } else { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); Loading Loading @@ -5405,7 +5406,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { @Override public int getCurrentFailedPasswordAttempts(int userHandle, boolean parent) { public int getCurrentFailedPasswordAttempts( String callerPackageName, int userHandle, boolean parent) { if (!mLockPatternUtils.hasSecureLockScreen()) { return 0; } Loading @@ -5421,7 +5423,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (isPermissionCheckFlagEnabled()) { int affectedUser = parent ? getProfileParentId(userHandle) : userHandle; enforcePermission(MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, /*callerPackageName=*/ null, affectedUser); callerPackageName, affectedUser); } else { getActiveAdminForCallerLocked( null, DeviceAdminInfo.USES_POLICY_WATCH_LOGIN, parent); Loading Loading @@ -14274,7 +14276,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.LOCK_TASK, EnforcingAdmin.createEnterpriseEnforcingAdmin(who, caller.getUserId()), enforcingAdmin, policy, caller.getUserId()); } Loading Loading @@ -14625,7 +14627,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } CallerIdentity caller = getCallerIdentity(who); if (isPermissionCheckFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_WIFI, /*callerPackageName=*/ null, enforcePermission(MANAGE_DEVICE_POLICY_WIFI, who.getPackageName(), UserHandle.USER_ALL); } else { Preconditions.checkNotNull(who, "ComponentName is null"); Loading Loading @@ -21511,10 +21513,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } @Override public WifiSsidPolicy getWifiSsidPolicy() { public WifiSsidPolicy getWifiSsidPolicy(String callerPackageName) { final CallerIdentity caller = getCallerIdentity(); if (isPermissionCheckFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_WIFI, /*callerPackageName=*/ null, enforcePermission(MANAGE_DEVICE_POLICY_WIFI, callerPackageName, caller.getUserId()); } else { Preconditions.checkCallAuthorization( Loading
core/java/android/app/admin/DevicePolicyManager.java +7 −4 Original line number Diff line number Diff line Loading @@ -5462,7 +5462,8 @@ public class DevicePolicyManager { public boolean isActivePasswordSufficient() { if (mService != null) { try { return mService.isActivePasswordSufficient(myUserId(), mParentInstance); return mService.isActivePasswordSufficient( mContext.getPackageName(), myUserId(), mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -5619,7 +5620,8 @@ public class DevicePolicyManager { } try { return mService.getRequiredPasswordComplexity(mParentInstance); return mService.getRequiredPasswordComplexity( mContext.getPackageName(), mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -5743,7 +5745,8 @@ public class DevicePolicyManager { public int getCurrentFailedPasswordAttempts(int userHandle) { if (mService != null) { try { return mService.getCurrentFailedPasswordAttempts(userHandle, mParentInstance); return mService.getCurrentFailedPasswordAttempts( mContext.getPackageName(), userHandle, mParentInstance); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -16643,7 +16646,7 @@ public class DevicePolicyManager { return null; } try { return mService.getWifiSsidPolicy(); return mService.getWifiSsidPolicy(mContext.getPackageName()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); }
core/java/android/app/admin/IDevicePolicyManager.aidl +4 −4 Original line number Diff line number Diff line Loading @@ -96,15 +96,15 @@ interface IDevicePolicyManager { long getPasswordExpiration(in ComponentName who, int userHandle, boolean parent); boolean isActivePasswordSufficient(int userHandle, boolean parent); boolean isActivePasswordSufficient(String callerPackageName, int userHandle, boolean parent); boolean isActivePasswordSufficientForDeviceRequirement(); boolean isPasswordSufficientAfterProfileUnification(int userHandle, int profileUser); int getPasswordComplexity(boolean parent); void setRequiredPasswordComplexity(String callerPackageName, int passwordComplexity, boolean parent); int getRequiredPasswordComplexity(boolean parent); int getRequiredPasswordComplexity(String callerPackageName, boolean parent); int getAggregatedPasswordComplexityForUser(int userId, boolean deviceWideOnly); boolean isUsingUnifiedPassword(in ComponentName admin); int getCurrentFailedPasswordAttempts(int userHandle, boolean parent); int getCurrentFailedPasswordAttempts(String callerPackageName, int userHandle, boolean parent); int getProfileWithMinimumFailedPasswordsForWipe(int userHandle, boolean parent); void setMaximumFailedPasswordsForWipe( Loading Loading @@ -572,7 +572,7 @@ interface IDevicePolicyManager { int getMinimumRequiredWifiSecurityLevel(); void setWifiSsidPolicy(String callerPackageName, in WifiSsidPolicy policy); WifiSsidPolicy getWifiSsidPolicy(); WifiSsidPolicy getWifiSsidPolicy(String callerPackageName); List<UserHandle> listForegroundAffiliatedUsers(); void setDrawables(in List<DevicePolicyDrawableResource> drawables); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +12 −10 Original line number Diff line number Diff line Loading @@ -5067,7 +5067,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } @Override public boolean isActivePasswordSufficient(int userHandle, boolean parent) { public boolean isActivePasswordSufficient( String callerPackageName, int userHandle, boolean parent) { if (!mHasFeature) { return true; } Loading @@ -5081,7 +5082,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (isPermissionCheckFlagEnabled()) { int affectedUser = parent ? getProfileParentId(userHandle) : userHandle; enforcePermission(MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, /*callerPackageName=*/ null, affectedUser); callerPackageName, affectedUser); } else { // This API can only be called by an active device admin, // so try to retrieve it to check that the caller is one. Loading Loading @@ -5363,7 +5364,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } @Override public int getRequiredPasswordComplexity(boolean calledOnParent) { public int getRequiredPasswordComplexity(String callerPackageName, boolean calledOnParent) { if (!mHasFeature) { return PASSWORD_COMPLEXITY_NONE; } Loading @@ -5374,7 +5375,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { int affectedUser = calledOnParent ? getProfileParentId(caller.getUserId()) : caller.getUserId(); enforcePermission(MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, /*callerPackageName=*/ null, affectedUser); callerPackageName, affectedUser); } else { Preconditions.checkCallAuthorization( isDefaultDeviceOwner(caller) || isProfileOwner(caller)); Loading Loading @@ -5405,7 +5406,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { @Override public int getCurrentFailedPasswordAttempts(int userHandle, boolean parent) { public int getCurrentFailedPasswordAttempts( String callerPackageName, int userHandle, boolean parent) { if (!mLockPatternUtils.hasSecureLockScreen()) { return 0; } Loading @@ -5421,7 +5423,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (isPermissionCheckFlagEnabled()) { int affectedUser = parent ? getProfileParentId(userHandle) : userHandle; enforcePermission(MANAGE_DEVICE_POLICY_LOCK_CREDENTIALS, /*callerPackageName=*/ null, affectedUser); callerPackageName, affectedUser); } else { getActiveAdminForCallerLocked( null, DeviceAdminInfo.USES_POLICY_WATCH_LOGIN, parent); Loading Loading @@ -14274,7 +14276,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { mDevicePolicyEngine.setLocalPolicy( PolicyDefinition.LOCK_TASK, EnforcingAdmin.createEnterpriseEnforcingAdmin(who, caller.getUserId()), enforcingAdmin, policy, caller.getUserId()); } Loading Loading @@ -14625,7 +14627,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } CallerIdentity caller = getCallerIdentity(who); if (isPermissionCheckFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_WIFI, /*callerPackageName=*/ null, enforcePermission(MANAGE_DEVICE_POLICY_WIFI, who.getPackageName(), UserHandle.USER_ALL); } else { Preconditions.checkNotNull(who, "ComponentName is null"); Loading Loading @@ -21511,10 +21513,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { } @Override public WifiSsidPolicy getWifiSsidPolicy() { public WifiSsidPolicy getWifiSsidPolicy(String callerPackageName) { final CallerIdentity caller = getCallerIdentity(); if (isPermissionCheckFlagEnabled()) { enforcePermission(MANAGE_DEVICE_POLICY_WIFI, /*callerPackageName=*/ null, enforcePermission(MANAGE_DEVICE_POLICY_WIFI, callerPackageName, caller.getUserId()); } else { Preconditions.checkCallAuthorization(