diff options
author | Santos Cordon <santoscordon@google.com> | 2014-12-16 10:02:44 -0800 |
---|---|---|
committer | Santos Cordon <santoscordon@google.com> | 2014-12-16 13:25:21 -0800 |
commit | 8e6936eae2f949066dcc6e2e66a48ffa50450402 (patch) | |
tree | 9d57389ae931257958f0a033f3b31bb8b5bc7bcb /src | |
parent | 75f77e9970a4b4492e025257fccefcce612bc501 (diff) | |
download | android_packages_apps_Bluetooth-8e6936eae2f949066dcc6e2e66a48ffa50450402.tar.gz android_packages_apps_Bluetooth-8e6936eae2f949066dcc6e2e66a48ffa50450402.tar.bz2 android_packages_apps_Bluetooth-8e6936eae2f949066dcc6e2e66a48ffa50450402.zip |
Allow system process to interact with Bluetooth across users.
Bug: 18688307
Change-Id: If31703fbe515baa40c242f99a61479a1ec8152b1
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/bluetooth/Utils.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/com/android/bluetooth/Utils.java b/src/com/android/bluetooth/Utils.java index 81dc40b81..0b2f836d6 100644 --- a/src/com/android/bluetooth/Utils.java +++ b/src/com/android/bluetooth/Utils.java @@ -25,6 +25,7 @@ import android.content.ContextWrapper; import android.content.pm.UserInfo; import android.os.Binder; import android.os.ParcelUuid; +import android.os.Process; import android.os.UserHandle; import android.os.UserManager; import android.util.Log; @@ -205,10 +206,10 @@ final public class Utils { int foregroundUser = ActivityManager.getCurrentUser(); ok = (foregroundUser == callingUser); if (!ok) { - // Always allow SystemUI access. + // Always allow SystemUI/System access. int systemUiUid = ActivityThread.getPackageManager().getPackageUid( "com.android.systemui", UserHandle.USER_OWNER); - ok = systemUiUid == callingUid; + ok = (systemUiUid == callingUid) || (Process.SYSTEM_UID == callingUid); } } catch (Exception ex) { Log.e(TAG, "checkIfCallerIsSelfOrForegroundUser: Exception ex=" + ex); @@ -239,10 +240,10 @@ final public class Utils { ok = (foregroundUser == callingUser) || (foregroundUser == parentUser); if (!ok) { - // Always allow SystemUI access. + // Always allow SystemUI/System access. int systemUiUid = ActivityThread.getPackageManager().getPackageUid( "com.android.systemui", UserHandle.USER_OWNER); - ok = systemUiUid == callingUid; + ok = (systemUiUid == callingUid) || (Process.SYSTEM_UID == callingUid); } } catch (Exception ex) { Log.e(TAG, "checkCallerAllowManagedProfiles: Exception ex=" + ex); |