OSDN Git Service

Move bluetooth priorities from Secure to Global.
authorJeff Sharkey <jsharkey@android.com>
Mon, 1 Oct 2012 19:49:31 +0000 (12:49 -0700)
committerJeff Sharkey <jsharkey@android.com>
Mon, 1 Oct 2012 19:49:40 +0000 (12:49 -0700)
Bug: 7231171
Change-Id: I39e3611dcec1104558704ed72855fef85f33c084

src/com/android/bluetooth/a2dp/A2dpService.java
src/com/android/bluetooth/hfp/HeadsetService.java
src/com/android/bluetooth/hid/HidService.java

index 64818ce..26503b6 100755 (executable)
@@ -139,8 +139,8 @@ public class A2dpService extends ProfileService {
     public boolean setPriority(BluetoothDevice device, int priority) {
         enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
                                        "Need BLUETOOTH_ADMIN permission");
-        Settings.Secure.putInt(getContentResolver(),
-            Settings.Secure.getBluetoothA2dpSinkPriorityKey(device.getAddress()),
+        Settings.Global.putInt(getContentResolver(),
+            Settings.Global.getBluetoothA2dpSinkPriorityKey(device.getAddress()),
             priority);
         if (DBG) Log.d(TAG,"Saved priority " + device + " = " + priority);
         return true;
@@ -149,8 +149,8 @@ public class A2dpService extends ProfileService {
     public int getPriority(BluetoothDevice device) {
         enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
                                        "Need BLUETOOTH_ADMIN permission");
-        int priority = Settings.Secure.getInt(getContentResolver(),
-            Settings.Secure.getBluetoothA2dpSinkPriorityKey(device.getAddress()),
+        int priority = Settings.Global.getInt(getContentResolver(),
+            Settings.Global.getBluetoothA2dpSinkPriorityKey(device.getAddress()),
             BluetoothProfile.PRIORITY_UNDEFINED);
         return priority;
     }
index b603e02..0920be4 100755 (executable)
@@ -338,8 +338,8 @@ public class HeadsetService extends ProfileService {
     public boolean setPriority(BluetoothDevice device, int priority) {
         enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
                                        "Need BLUETOOTH_ADMIN permission");
-        Settings.Secure.putInt(getContentResolver(),
-            Settings.Secure.getBluetoothHeadsetPriorityKey(device.getAddress()),
+        Settings.Global.putInt(getContentResolver(),
+            Settings.Global.getBluetoothHeadsetPriorityKey(device.getAddress()),
             priority);
         if (DBG) Log.d(TAG, "Saved priority " + device + " = " + priority);
         return true;
@@ -348,8 +348,8 @@ public class HeadsetService extends ProfileService {
     public int getPriority(BluetoothDevice device) {
         enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
                                        "Need BLUETOOTH_ADMIN permission");
-        int priority = Settings.Secure.getInt(getContentResolver(),
-            Settings.Secure.getBluetoothHeadsetPriorityKey(device.getAddress()),
+        int priority = Settings.Global.getInt(getContentResolver(),
+            Settings.Global.getBluetoothHeadsetPriorityKey(device.getAddress()),
             BluetoothProfile.PRIORITY_UNDEFINED);
         return priority;
     }
index b606856..f15692c 100755 (executable)
@@ -409,8 +409,8 @@ public class HidService extends ProfileService {
     public boolean setPriority(BluetoothDevice device, int priority) {
         enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
                                        "Need BLUETOOTH_ADMIN permission");
-        Settings.Secure.putInt(getContentResolver(),
-            Settings.Secure.getBluetoothInputDevicePriorityKey(device.getAddress()),
+        Settings.Global.putInt(getContentResolver(),
+            Settings.Global.getBluetoothInputDevicePriorityKey(device.getAddress()),
             priority);
         if (DBG) Log.d(TAG,"Saved priority " + device + " = " + priority);
         return true;
@@ -419,8 +419,8 @@ public class HidService extends ProfileService {
     public  int getPriority(BluetoothDevice device) {
         enforceCallingOrSelfPermission(BLUETOOTH_ADMIN_PERM,
                                        "Need BLUETOOTH_ADMIN permission");
-        int priority = Settings.Secure.getInt(getContentResolver(),
-            Settings.Secure.getBluetoothInputDevicePriorityKey(device.getAddress()),
+        int priority = Settings.Global.getInt(getContentResolver(),
+            Settings.Global.getBluetoothInputDevicePriorityKey(device.getAddress()),
             BluetoothProfile.PRIORITY_UNDEFINED);
         return priority;
     }