Revert "Hard remove BluetoothHeadset#setPriority System API that was deprecated"
This reverts commit 5dcd2f74ede8d492106bd9ba469a5ad07469bfdf.
Tag: #feature
Bug: 209335798
Test: Manual
Reason for revert: Failing signature test that will be updated by paulduffin@
Change-Id: I3c717fad005417b5bde197b86c80b724791d535f
diff --git a/android/app/src/com/android/bluetooth/hfp/HeadsetService.java b/android/app/src/com/android/bluetooth/hfp/HeadsetService.java
index 8622215..7c3784e 100644
--- a/android/app/src/com/android/bluetooth/hfp/HeadsetService.java
+++ b/android/app/src/com/android/bluetooth/hfp/HeadsetService.java
@@ -516,6 +516,16 @@
}
@Override
+ public boolean setPriority(BluetoothDevice device, int connectionPolicy,
+ AttributionSource source) {
+ HeadsetService service = getService(source);
+ if (service == null) {
+ return false;
+ }
+ return service.setConnectionPolicy(device, connectionPolicy);
+ }
+
+ @Override
public boolean setConnectionPolicy(BluetoothDevice device, int connectionPolicy,
AttributionSource source) {
HeadsetService service = getService(source);
diff --git a/system/binder/android/bluetooth/IBluetoothHeadset.aidl b/system/binder/android/bluetooth/IBluetoothHeadset.aidl
index 3093b56..e94ce5a 100644
--- a/system/binder/android/bluetooth/IBluetoothHeadset.aidl
+++ b/system/binder/android/bluetooth/IBluetoothHeadset.aidl
@@ -94,6 +94,8 @@
BluetoothDevice getActiveDevice(in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
boolean isInbandRingingEnabled(in AttributionSource attributionSource);
+ @JavaPassthrough(annotation="@android.annotation.RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT,android.Manifest.permission.MODIFY_PHONE_STATE})")
+ boolean setPriority(in BluetoothDevice device, int connectionPolicy, in AttributionSource attributionSource);
@JavaPassthrough(annotation="@android.annotation.RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)")
int getPriority(in BluetoothDevice device, in AttributionSource attributionSource);