Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 093aa477 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Move bluetooth priorities from Secure to Global.

Bug: 7231171
Change-Id: I39e3611dcec1104558704ed72855fef85f33c084
parent 018c3c6e
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;
    }
+4 −4
Original line number Diff line number Diff line
@@ -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;
    }
+4 −4
Original line number Diff line number Diff line
@@ -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;
    }