OSDN Git Service

Check bluetooth app id instead of uid
authorAmith Yamasani <yamasani@google.com>
Mon, 24 Apr 2017 18:30:19 +0000 (11:30 -0700)
committergitbuildkicker <android-build@google.com>
Mon, 24 Apr 2017 19:33:41 +0000 (12:33 -0700)
Fixes the crash on user switches.

Change-Id: If0c003011bd014b437ef5c8bee24a27b68be88d9
Fixes: 37617840
Test: manual - add a user
(cherry picked from commit e259ad280f539aa807ed7627d85099554885d546)

services/core/java/com/android/server/media/MediaSessionService.java

index 64ab848..0db1b5d 100644 (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");
                 }