Merge "Enforce permission checks in getting app exit reasons" into rvc-dev am: f36b9764e0 am: e1c2448e6b

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

Change-Id: If3d542e2a0790d49d7c0709e63a0aa280fffe6a9
This commit is contained in:
Jing Ji
2020-10-06 01:26:53 +00:00
committed by Automerger Merge Worker

View File

@@ -10459,12 +10459,10 @@ public class ActivityManagerService extends IActivityManager.Stub
} finally {
Binder.restoreCallingIdentity(identity);
}
if (uid == Process.INVALID_UID) {
return Process.INVALID_UID;
}
// If the uid is Process.INVALID_UID, the below 'if' check will be always true
if (UserHandle.getAppId(uid) != UserHandle.getAppId(callingUid)) {
// Requires the DUMP permission if the target package doesn't belong
// to the caller.
// to the caller or it doesn't exist.
enforceCallingPermission(android.Manifest.permission.DUMP, function);
}
return uid;