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

Commit fbaa64c2 authored by Rubin Xu's avatar Rubin Xu Committed by Android (Google) Code Review
Browse files

Merge "Fix DPMS.isCredentialManagementApp()"

parents 9054df8b 81d4a1ff
Loading
Loading
Loading
Loading
+17 −16
Original line number Diff line number Diff line
@@ -5924,6 +5924,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
     * @return {@code true} if the calling process is the credential management app.
     */
    private boolean isCredentialManagementApp(CallerIdentity caller, String alias) {
        return mInjector.binderWithCleanCallingIdentity(() -> {
            // Should include alias in authentication policy
            try (KeyChainConnection connection = KeyChain.bindAsUser(mContext,
                    caller.getUserHandle())) {
@@ -5939,10 +5940,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            }
            AppOpsManager appOpsManager = mInjector.getAppOpsManager();
        return appOpsManager != null
                ? appOpsManager.noteOpNoThrow(AppOpsManager.OP_MANAGE_CREDENTIALS, caller.getUid(),
                caller.getPackageName(), null, null) == AppOpsManager.MODE_ALLOWED
                : false;
            if (appOpsManager == null) return false;
            return appOpsManager.noteOpNoThrow(AppOpsManager.OP_MANAGE_CREDENTIALS, caller.getUid(),
                    caller.getPackageName(), null, null) == AppOpsManager.MODE_ALLOWED;
        });
    }
    private static boolean containsAlias(AppUriAuthenticationPolicy policy, String alias) {