Merge "Make AppOpsService verification error less informative" into sc-dev am: 1a4ff1df12 am: 2312f1fd57

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

Change-Id: Ifd308b730f57707477681887b9b56dc171b00963
This commit is contained in:
Nate Myren
2021-06-07 16:36:47 +00:00
committed by Automerger Merge Worker

View File

@@ -4483,8 +4483,9 @@ public class AppOpsService extends IAppOpsService.Stub {
// Special case for the shell which is a package but should be able
// to bypass app attribution tag restrictions.
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 "
+ UserHandle.getAppId(uid) + " but it is really " + pkgUid);
+ UserHandle.getAppId(uid) + otherUidMessage);
}
return RestrictionBypass.UNRESTRICTED;
}
@@ -4544,8 +4545,9 @@ public class AppOpsService extends IAppOpsService.Stub {
}
if (pkgUid != uid) {
String otherUidMessage = DEBUG ? " but it is really " + pkgUid : " but it is not";
throw new SecurityException("Specified package " + packageName + " under uid " + uid
+ " but it is really " + pkgUid);
+ otherUidMessage);
}
return bypass;