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

Commit 0ac3cd36 authored by Faye Yan's avatar Faye Yan Committed by Android (Google) Code Review
Browse files

Merge "Do not override user set app op permission state when handling...

Merge "Do not override user set app op permission state when handling installer permission change. " into udc-dev
parents bf44dbd9 28385ab9
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3673,9 +3673,9 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
                isAppOpPermission = bp.isAppOp();
            }

            if (shouldGrantRuntimePermission) {
            final int flags = getPermissionFlagsInternal(pkg.getPackageName(), permission,
                    myUid, userId);
            if (shouldGrantRuntimePermission) {
                if (supportsRuntimePermissions) {
                    // Installer cannot change immutable permissions.
                    if ((flags & immutableFlags) == 0) {
@@ -3693,6 +3693,9 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
            } else if (isAppOpPermission
                    && PackageInstallerService.INSTALLER_CHANGEABLE_APP_OP_PERMISSIONS
                    .contains(permission)) {
                if ((flags & PackageManager.FLAG_PERMISSION_USER_SET) != 0) {
                    continue;
                }
                int mode =
                        permissionState == PERMISSION_STATE_GRANTED ? MODE_ALLOWED : MODE_ERRORED;
                int uid = UserHandle.getUid(userId, pkg.getUid());