Merge "Fix CDM package check"

This commit is contained in:
Eugene Susla
2020-10-13 17:59:46 +00:00
committed by Android (Google) Code Review

View File

@@ -391,7 +391,10 @@ public class CompanionDeviceManagerService extends SystemService implements Bind
checkArgument(getCallingUserId() == userId,
"Must be called by either same user or system");
mAppOpsManager.checkPackage(Binder.getCallingUid(), pkg);
int callingUid = Binder.getCallingUid();
if (mAppOpsManager.checkPackage(callingUid, pkg) != AppOpsManager.MODE_ALLOWED) {
throw new SecurityException(pkg + " doesn't belong to uid " + callingUid);
}
}
@Override