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

Commit 57407b3e authored by Faye Yan's avatar Faye Yan Committed by Automerger Merge Worker
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 am: 0ac3cd36

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21479780



Change-Id: Ic5e315db1c02dc2d83ad11d50e4d9db1ee4b1c04
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 61a5183a 0ac3cd36
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());