diff options
author | Zhihai Xu <zhihaixu@google.com> | 2012-10-08 18:04:32 -0700 |
---|---|---|
committer | Zhihai Xu <zhihaixu@google.com> | 2012-10-09 10:45:00 -0700 |
commit | 37510150ee738ccfa5913f7120e28f25ae7768df (patch) | |
tree | 151f1e680aa3fa0ee5532afbdeadccc23b40ae02 /src/com/android/bluetooth/hid | |
parent | 344036be03c7bb0ef5eb101416b122152b61ca0c (diff) | |
download | android_packages_apps_Bluetooth-37510150ee738ccfa5913f7120e28f25ae7768df.tar.gz android_packages_apps_Bluetooth-37510150ee738ccfa5913f7120e28f25ae7768df.tar.bz2 android_packages_apps_Bluetooth-37510150ee738ccfa5913f7120e28f25ae7768df.zip |
Bluetooth multi-user updates: change bluetooth service
to reject background user access.
bug 6925422
Change-Id: I11d5ebf007c2843a72a9870055fc96672daf8409
Diffstat (limited to 'src/com/android/bluetooth/hid')
-rwxr-xr-x | src/com/android/bluetooth/hid/HidService.java | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/bluetooth/hid/HidService.java b/src/com/android/bluetooth/hid/HidService.java index f15692c84..ade3aff3d 100755 --- a/src/com/android/bluetooth/hid/HidService.java +++ b/src/com/android/bluetooth/hid/HidService.java @@ -10,6 +10,7 @@ import android.bluetooth.BluetoothProfile; import android.bluetooth.IBluetooth; import android.bluetooth.IBluetoothInputDevice; import android.content.Intent; +import android.content.pm.PackageManager; import android.os.Bundle; import android.os.IBinder; import android.os.Handler; @@ -18,15 +19,15 @@ import android.os.RemoteException; import android.os.ServiceManager; import android.provider.Settings; import android.util.Log; +import com.android.bluetooth.btservice.AdapterService; +import com.android.bluetooth.btservice.ProfileService; +import com.android.bluetooth.Utils; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.android.bluetooth.Utils; -import android.content.pm.PackageManager; -import com.android.bluetooth.btservice.ProfileService; -import com.android.bluetooth.btservice.AdapterService; + /** * Provides Bluetooth Hid Host profile, as a service in @@ -274,6 +275,11 @@ public class HidService extends ProfileService { } private HidService getService() { + if (!Utils.checkCaller()) { + Log.w(TAG,"InputDevice call not allowed for non-active user"); + return null; + } + if (mService != null && mService.isAvailable()) { return mService; } |