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

Commit 4351a51a authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix the naming of variables for permission checks." into main

parents 155ea55d 3f3dce4f
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