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

Commit 3f3dce4f authored by Utkarsh Nigam's avatar Utkarsh Nigam
Browse files

Fix the naming of variables for permission checks.


Change-Id: Ibcb54a73c5bef18596370e2f9232ee69f3b894a3
Flag: EXEMPT Trivial change.
Test: No tests exist.
Bug: 357551503
parent e3323b7d
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -79,17 +79,20 @@ class CallerValidatorImpl implements CallerValidator {
    // TODO(b/360864791): Add and honor apps that opt-out from EXECUTE_APP_FUNCTIONS caller.
    public boolean verifyCallerCanExecuteAppFunction(
            @NonNull String callerPackageName, @NonNull String targetPackageName) {
        if (callerPackageName.equals(targetPackageName)) {
            return true;
        }

        int pid = Binder.getCallingPid();
        int uid = Binder.getCallingUid();
        boolean hasExecutionPermission =
        boolean hasTrustedExecutionPermission =
                mContext.checkPermission(
                                Manifest.permission.EXECUTE_APP_FUNCTIONS_TRUSTED, pid, uid)
                        == PackageManager.PERMISSION_GRANTED;
        boolean hasTrustedExecutionPermission =
        boolean hasExecutionPermission =
                mContext.checkPermission(Manifest.permission.EXECUTE_APP_FUNCTIONS, pid, uid)
                        == PackageManager.PERMISSION_GRANTED;
        boolean isSamePackage = callerPackageName.equals(targetPackageName);
        return hasExecutionPermission || hasTrustedExecutionPermission || isSamePackage;
        return hasExecutionPermission || hasTrustedExecutionPermission;
    }

    @Override