Merge "Check bluetooth app id instead of uid" into oc-dev

This commit is contained in:
Amith Yamasani
2017-04-24 19:04:49 +00:00
committed by Android (Google) Code Review

View File

@@ -965,7 +965,7 @@ public class MediaSessionService extends SystemService implements Monitor {
final int uid = Binder.getCallingUid(); final int uid = Binder.getCallingUid();
final long token = Binder.clearCallingIdentity(); final long token = Binder.clearCallingIdentity();
try { try {
if (uid != Process.BLUETOOTH_UID) { if (!UserHandle.isSameApp(uid, Process.BLUETOOTH_UID)) {
throw new SecurityException("Only Bluetooth service processes can set" throw new SecurityException("Only Bluetooth service processes can set"
+ " Callback"); + " Callback");
} }