Check bluetooth app id instead of uid

Fixes the crash on user switches.

Change-Id: If0c003011bd014b437ef5c8bee24a27b68be88d9
Fixes: 37617840
Test: manual - add a user
This commit is contained in:
Amith Yamasani
2017-04-24 11:30:19 -07:00
parent 41bf42a1c7
commit e259ad280f

View File

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