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

Commit de168c62 authored by Jonathan Scott's avatar Jonathan Scott Committed by Automerger Merge Worker
Browse files

Merge "Fix callerPackageName being null" into udc-dev am: 3a7b0440

parents 471c2eb4 3a7b0440
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -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();
            }
@@ -5619,7 +5620,8 @@ public class DevicePolicyManager {
        }
        try {
            return mService.getRequiredPasswordComplexity(mParentInstance);
            return mService.getRequiredPasswordComplexity(
                    mContext.getPackageName(), mParentInstance);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -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();
            }
@@ -16643,7 +16646,7 @@ public class DevicePolicyManager {
            return null;
        }
        try {
            return mService.getWifiSsidPolicy();
            return mService.getWifiSsidPolicy(mContext.getPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+4 −4
Original line number Diff line number Diff line
@@ -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(
@@ -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);
+12 −10
Original line number Diff line number Diff line
@@ -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;
        }
@@ -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.
@@ -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;
        }
@@ -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));
@@ -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;
        }
@@ -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);
@@ -14274,7 +14276,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                mDevicePolicyEngine.setLocalPolicy(
                        PolicyDefinition.LOCK_TASK,
                        EnforcingAdmin.createEnterpriseEnforcingAdmin(who, caller.getUserId()),
                        enforcingAdmin,
                        policy,
                        caller.getUserId());
            }
@@ -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");
@@ -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(