aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Stern <fstern@google.com>2023-09-08 10:54:33 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-09-08 10:54:33 +0000
commit652afdd1d5515e7261cc4020e92282953ad7be5e (patch)
tree8d3f2f6474ff61175706bc67e1a152629e5e6d13
parenta42b0df9faac54a1c14de482544ee47b8cda6cdb (diff)
parentbd727c1e7ff4b9677b0d301af2b6fdcde619ecc4 (diff)
downloadsl4a-652afdd1d5515e7261cc4020e92282953ad7be5e.tar.gz
Revert "Remove the use of deprecasted methods" am: bd727c1e7f
Original change: https://android-review.googlesource.com/c/platform/external/sl4a/+/2746733 Change-Id: Ia75337e8145dbfaa25f2e7ca2eca26a20a049ef1 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, 24 insertions, 27 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 2c200d3e..0a40f9e7 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.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
- sA2dpProfile.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED);
+ if (sA2dpProfile.getPriority(device) > BluetoothProfile.PRIORITY_ON) {
+ sA2dpProfile.setPriority(device, BluetoothProfile.PRIORITY_ON);
}
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.setConnectionPolicy(device, priority);
+ sA2dpProfile.setPriority(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 c725464b..26124bfe 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.setConnectionPolicy(device, priority);
+ sA2dpSinkProfile.setPriority(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.CONNECTION_POLICY_UNKNOWN;
+ if (sA2dpSinkProfile == null) return BluetoothProfile.PRIORITY_UNDEFINED;
BluetoothDevice device =
BluetoothFacade.getDevice(
mBluetoothAdapter.getBondedDevices(), deviceStr);
- return sA2dpSinkProfile.getConnectionPolicy(device);
+ return sA2dpSinkProfile.getPriority(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 0eb0e2fe..8c6f93f8 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.setConnectionPolicy(device, priority);
+ sHfpClientProfile.setPriority(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.CONNECTION_POLICY_UNKNOWN;
+ if (sHfpClientProfile == null) return BluetoothProfile.PRIORITY_UNDEFINED;
BluetoothDevice device = BluetoothFacade.getDevice(
mBluetoothAdapter.getBondedDevices(), deviceStr);
- return sHfpClientProfile.getConnectionPolicy(device);
+ return sHfpClientProfile.getPriority(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 968e471c..6829c90c 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.setConnectionPolicy(device, priority);
+ return sHidProfile.setPriority(device, priority);
}
/**
@@ -363,7 +363,7 @@ public class BluetoothHidFacade extends RpcReceiver {
String deviceID) throws Exception {
BluetoothDevice device = BluetoothFacade.getDevice(sHidProfile.getConnectedDevices(),
deviceID);
- return sHidProfile.getConnectionPolicy(device);
+ return sHidProfile.getPriority(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 e0e80e04..aaeac4c7 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.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
- sMapProfile.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED);
+ if (sMapProfile.getPriority(device) > BluetoothProfile.PRIORITY_ON) {
+ sMapProfile.setPriority(device, BluetoothProfile.PRIORITY_ON);
}
return sMapProfile.disconnect(device);
}
@@ -182,10 +182,8 @@ public class BluetoothMapClientFacade extends RpcReceiver {
connectedMapDevices, deviceID);
if (!connectedMapDevices.isEmpty()
&& connectedMapDevices.get(0).equals(mDevice)) {
- if (sMapProfile.getConnectionPolicy(mDevice)
- > BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
- sMapProfile.setConnectionPolicy(
- mDevice, BluetoothProfile.CONNECTION_POLICY_ALLOWED);
+ if (sMapProfile.getPriority(mDevice) > BluetoothProfile.PRIORITY_ON) {
+ sMapProfile.setPriority(mDevice, BluetoothProfile.PRIORITY_ON);
}
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 2e7c534a..e3fe007b 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.getConnectionPolicy(device) > BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
- sMapProfile.setConnectionPolicy(device, BluetoothProfile.CONNECTION_POLICY_ALLOWED);
+ if (sMapProfile.getPriority(device) > BluetoothProfile.PRIORITY_ON) {
+ sMapProfile.setPriority(device, BluetoothProfile.PRIORITY_ON);
}
return sMapProfile.disconnect(device);
}
@@ -103,10 +103,9 @@ public class BluetoothMapFacade extends RpcReceiver {
BluetoothDevice mDevice = BluetoothFacade.getDevice(connectedMapDevices, deviceID);
if (!connectedMapDevices.isEmpty()
&& connectedMapDevices.get(0).equals(mDevice)) {
- if (sMapProfile.getConnectionPolicy(mDevice)
- > BluetoothProfile.CONNECTION_POLICY_ALLOWED) {
- sMapProfile.setConnectionPolicy(
- mDevice, BluetoothProfile.CONNECTION_POLICY_ALLOWED);
+ if (sMapProfile.getPriority(mDevice)
+ > BluetoothProfile.PRIORITY_ON) {
+ sMapProfile.setPriority(mDevice, BluetoothProfile.PRIORITY_ON);
}
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 717926e9..979a1384 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.setConnectionPolicy(device, priority);
+ sPbapClientProfile.setPriority(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.CONNECTION_POLICY_UNKNOWN;
+ return BluetoothProfile.PRIORITY_UNDEFINED;
}
BluetoothDevice device =
BluetoothFacade.getDevice(mBluetoothAdapter.getBondedDevices(),
deviceStr);
- return sPbapClientProfile.getConnectionPolicy(device);
+ return sPbapClientProfile.getPriority(device);
}
/**