aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungsoo Lim <sungsoo@google.com>2023-09-08 04:32:38 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-09-08 04:32:38 +0000
commita42b0df9faac54a1c14de482544ee47b8cda6cdb (patch)
treed94483e410a3a9bc6b27d8bdd1a65161c1bf8efd
parent0d35698dfcbc21203dc99445432da6a12631236d (diff)
parent4ec2c8e0023409b4074c44fb185f49c6caef951d (diff)
downloadsl4a-a42b0df9faac54a1c14de482544ee47b8cda6cdb.tar.gz
Remove the use of deprecasted methods am: 4ec2c8e002
Original change: https://android-review.googlesource.com/c/platform/external/sl4a/+/2737117 Change-Id: I913f05c56d9a34be5babdb4224a3f16ddac83352 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpFacade.java6
-rw-r--r--Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothA2dpSinkFacade.java6
-rw-r--r--Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHfpClientFacade.java8
-rw-r--r--Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothHidFacade.java4
-rw-r--r--Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapClientFacade.java10
-rw-r--r--Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothMapFacade.java11
-rw-r--r--Common/src/com/googlecode/android_scripting/facade/bluetooth/BluetoothPbapClientFacade.java6
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);
}
/**