Merge "Enforce permission checks in getting app exit reasons" into rvc-dev

This commit is contained in:
Jing Ji
2020-10-06 00:45:31 +00:00
committed by Android (Google) Code Review

View File

@@ -10475,12 +10475,10 @@ public class ActivityManagerService extends IActivityManager.Stub
} finally { } finally {
Binder.restoreCallingIdentity(identity); Binder.restoreCallingIdentity(identity);
} }
if (uid == Process.INVALID_UID) { // If the uid is Process.INVALID_UID, the below 'if' check will be always true
return Process.INVALID_UID;
}
if (UserHandle.getAppId(uid) != UserHandle.getAppId(callingUid)) { if (UserHandle.getAppId(uid) != UserHandle.getAppId(callingUid)) {
// Requires the DUMP permission if the target package doesn't belong // 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); enforceCallingPermission(android.Manifest.permission.DUMP, function);
} }
return uid; return uid;