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

Commit 2312f1fd authored by Nate Myren's avatar Nate Myren Committed by Automerger Merge Worker
Browse files

Merge "Make AppOpsService verification error less informative" into sc-dev am: 1a4ff1df

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

Change-Id: I646e805b23a540417220ce76c777423cd7f6445c
parents 902dc55f 1a4ff1df
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -4483,8 +4483,9 @@ public class AppOpsService extends IAppOpsService.Stub {
            // Special case for the shell which is a package but should be able
            // Special case for the shell which is a package but should be able
            // to bypass app attribution tag restrictions.
            // to bypass app attribution tag restrictions.
            if (pkgUid != UserHandle.getAppId(uid)) {
            if (pkgUid != UserHandle.getAppId(uid)) {
                String otherUidMessage = DEBUG ? " but it is really " + pkgUid : " but it is not";
                throw new SecurityException("Specified package " + packageName + " under uid "
                throw new SecurityException("Specified package " + packageName + " under uid "
                        +  UserHandle.getAppId(uid) + " but it is really " + pkgUid);
                        +  UserHandle.getAppId(uid) + otherUidMessage);
            }
            }
            return RestrictionBypass.UNRESTRICTED;
            return RestrictionBypass.UNRESTRICTED;
        }
        }
@@ -4544,8 +4545,9 @@ public class AppOpsService extends IAppOpsService.Stub {
        }
        }


        if (pkgUid != uid) {
        if (pkgUid != uid) {
            String otherUidMessage = DEBUG ? " but it is really " + pkgUid : " but it is not";
            throw new SecurityException("Specified package " + packageName + " under uid " + uid
            throw new SecurityException("Specified package " + packageName + " under uid " + uid
                    + " but it is really " + pkgUid);
                    + otherUidMessage);
        }
        }


        return bypass;
        return bypass;