diff options
author | Sungsoo Lim <sungsoo@google.com> | 2023-09-08 06:59:31 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-09-08 06:59:31 +0000 |
commit | e894e976a4442eb178712bebf6b1f6daa29ddedf (patch) | |
tree | d94483e410a3a9bc6b27d8bdd1a65161c1bf8efd | |
parent | 2df01fa939fcda79fc4286b9dd9b05814d505c10 (diff) | |
parent | 0c6ef9b38a41e53cb17fdcfdb6123d70af159a5f (diff) | |
download | sl4a-e894e976a4442eb178712bebf6b1f6daa29ddedf.tar.gz |
Remove the use of deprecasted methods am: 4ec2c8e002 am: a42b0df9fa am: b1b220378f am: 1129b7e0a4 am: 0c6ef9b38a
Original change: https://android-review.googlesource.com/c/platform/external/sl4a/+/2737117
Change-Id: I3a49704c84c4d8556d6496acffa68934b1237c3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
7 files changed, 27 insertions, 24 deletions
diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java index 0a40f9e7..2c200d3e 100644 --- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java +++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java @@ -129,8 +129,8 @@ public class BluetoothA2dpFacade extends RpcReceiver { */ public Boolean a2dpDisconnect(BluetoothDevice device) { if (sA2dpProfile == null) return false; - if (sA2dpProfile.getPriority(device) > BluetoothProfile.PRIORITY_ON) { - sA2dpProfile.setPriority(device, BluetoothProfile.PRIORITY_ON); + if (sA2dpProfile.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { + sA2dpProfile.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return sA2dpProfile.disconnect(device); } @@ -162,7 +162,7 @@ public class BluetoothA2dpFacade extends RpcReceiver { BluetoothDevice device = BluetoothFacade.getDevice(mBluetoothAdapter.getBondedDevices(), deviceStr); Log.d("Changing priority of device " + device.getAlias() + " p: " + priority); - sA2dpProfile.setPriority(device, priority); + sA2dpProfile.setConnectionPolicy(device, priority); } diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpSinkFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpSinkFacade.java index 26124bfe..c725464b 100644 --- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpSinkFacade.java +++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpSinkFacade.java @@ -101,7 +101,7 @@ public class BluetoothA2dpSinkFacade extends RpcReceiver { mBluetoothAdapter.getBondedDevices(), deviceStr); Log.d("Changing priority of device " + device.getAlias() + " p: " + priority); - sA2dpSinkProfile.setPriority(device, priority); + sA2dpSinkProfile.setConnectionPolicy(device, priority); } /** @@ -114,11 +114,11 @@ public class BluetoothA2dpSinkFacade extends RpcReceiver { @RpcParameter(name = "device", description = "Mac address of a BT device.") String deviceStr) throws Exception { - if (sA2dpSinkProfile == null) return BluetoothProfile.PRIORITY_UNDEFINED; + if (sA2dpSinkProfile == null) return BluetoothProfile.CONNECTION_POLICY_UNKNOWN; BluetoothDevice device = BluetoothFacade.getDevice( mBluetoothAdapter.getBondedDevices(), deviceStr); - return sA2dpSinkProfile.getPriority(device); + return sA2dpSinkProfile.getConnectionPolicy(device); } /** diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHfpClientFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHfpClientFacade.java index 8c6f93f8..0eb0e2fe 100644 --- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHfpClientFacade.java +++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHfpClientFacade.java @@ -114,7 +114,7 @@ public class BluetoothHfpClientFacade extends RpcReceiver { deviceStr); Log.d("Changing priority of device " + device.getAlias() + " p: " + priority); - sHfpClientProfile.setPriority(device, priority); + sHfpClientProfile.setConnectionPolicy(device, priority); } /** @@ -127,10 +127,10 @@ public class BluetoothHfpClientFacade extends RpcReceiver { @RpcParameter(name = "device", description = "Mac address of a BT device.") String deviceStr) throws Exception { - if (sHfpClientProfile == null) return BluetoothProfile.PRIORITY_UNDEFINED; + if (sHfpClientProfile == null) return BluetoothProfile.CONNECTION_POLICY_UNKNOWN; BluetoothDevice device = BluetoothFacade.getDevice( mBluetoothAdapter.getBondedDevices(), deviceStr); - return sHfpClientProfile.getPriority(device); + return sHfpClientProfile.getConnectionPolicy(device); } /** @@ -392,4 +392,4 @@ public class BluetoothHfpClientFacade extends RpcReceiver { @Override public void shutdown() { } -}
\ No newline at end of file +} diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHidFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHidFacade.java index 6829c90c..968e471c 100644 --- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHidFacade.java +++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHidFacade.java @@ -347,7 +347,7 @@ public class BluetoothHidFacade extends RpcReceiver { Integer priority) throws Exception { BluetoothDevice device = BluetoothFacade.getDevice(sHidProfile.getConnectedDevices(), deviceID); - return sHidProfile.setPriority(device, priority); + return sHidProfile.setConnectionPolicy(device, priority); } /** @@ -363,7 +363,7 @@ public class BluetoothHidFacade extends RpcReceiver { String deviceID) throws Exception { BluetoothDevice device = BluetoothFacade.getDevice(sHidProfile.getConnectedDevices(), deviceID); - return sHidProfile.getPriority(device); + return sHidProfile.getConnectionPolicy(device); } /** diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapClientFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapClientFacade.java index aaeac4c7..e0e80e04 100644 --- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapClientFacade.java +++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapClientFacade.java @@ -157,8 +157,8 @@ public class BluetoothMapClientFacade extends RpcReceiver { } public Boolean mapDisconnect(BluetoothDevice device) { - if (sMapProfile.getPriority(device) > BluetoothProfile.PRIORITY_ON) { - sMapProfile.setPriority(device, BluetoothProfile.PRIORITY_ON); + if (sMapProfile.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { + sMapProfile.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return sMapProfile.disconnect(device); } @@ -182,8 +182,10 @@ public class BluetoothMapClientFacade extends RpcReceiver { connectedMapDevices, deviceID); if (!connectedMapDevices.isEmpty() && connectedMapDevices.get(0).equals(mDevice)) { - if (sMapProfile.getPriority(mDevice) > BluetoothProfile.PRIORITY_ON) { - sMapProfile.setPriority(mDevice, BluetoothProfile.PRIORITY_ON); + if (sMapProfile.getConnectionPolicy(mDevice) + > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { + sMapProfile.setConnectionPolicy( + mDevice, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return sMapProfile.disconnect(mDevice); } else { diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapFacade.java index e3fe007b..2e7c534a 100644 --- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapFacade.java +++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapFacade.java @@ -71,8 +71,8 @@ public class BluetoothMapFacade extends RpcReceiver { * @return if the disconnection was successfull or not. */ public Boolean mapDisconnect(BluetoothDevice device) { - if (sMapProfile.getPriority(device) > BluetoothProfile.PRIORITY_ON) { - sMapProfile.setPriority(device, BluetoothProfile.PRIORITY_ON); + if (sMapProfile.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { + sMapProfile.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return sMapProfile.disconnect(device); } @@ -103,9 +103,10 @@ public class BluetoothMapFacade extends RpcReceiver { BluetoothDevice mDevice = BluetoothFacade.getDevice(connectedMapDevices, deviceID); if (!connectedMapDevices.isEmpty() && connectedMapDevices.get(0).equals(mDevice)) { - if (sMapProfile.getPriority(mDevice) - > BluetoothProfile.PRIORITY_ON) { - sMapProfile.setPriority(mDevice, BluetoothProfile.PRIORITY_ON); + if (sMapProfile.getConnectionPolicy(mDevice) + > BluetoothProfile.CONNECTION_POLICY_ALLOWED) { + sMapProfile.setConnectionPolicy( + mDevice, BluetoothProfile.CONNECTION_POLICY_ALLOWED); } return sMapProfile.disconnect(mDevice); } else { diff --git a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothPbapClientFacade.java b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothPbapClientFacade.java index 979a1384..717926e9 100644 --- a/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothPbapClientFacade.java +++ b/Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothPbapClientFacade.java @@ -115,7 +115,7 @@ public class BluetoothPbapClientFacade extends RpcReceiver { deviceStr); Log.d("Changing priority of device " + device.getAlias() + " p: " + priority); - sPbapClientProfile.setPriority(device, priority); + sPbapClientProfile.setConnectionPolicy(device, priority); } /** @@ -128,12 +128,12 @@ public class BluetoothPbapClientFacade extends RpcReceiver { description = "Mac address of a BT device.") String deviceStr) throws Exception { if (sPbapClientProfile == null) { - return BluetoothProfile.PRIORITY_UNDEFINED; + return BluetoothProfile.CONNECTION_POLICY_UNKNOWN; } BluetoothDevice device = BluetoothFacade.getDevice(mBluetoothAdapter.getBondedDevices(), deviceStr); - return sPbapClientProfile.getPriority(device); + return sPbapClientProfile.getConnectionPolicy(device); } /** |