From 700cabfddbb2047be4da511bdbea9afd41d2cadb Mon Sep 17 00:00:00 2001 From: Rahul Sabnis Date: Tue, 14 Dec 2021 00:18:50 +0000 Subject: Revert "Revert "Complete hard removal of BluetoothHeadset#setPri..." Revert "Revert "Hard remove BluetoothHeadset#setPriority System ..." Revert "Revert "Added removal of BluetoothHeadset#setPriority to..." Revert submission 16433519-hfp-setpriority-hardremove Tag: #feature Bug: 209335798 Test: Manual Reason for revert: CTS issue fixed Reverted Changes: I9de1b07f2:Revert "Complete hard removal of BluetoothHeadset#... If5d408e8b:Revert "Added removal of BluetoothHeadset#setPrior... I3c717fad0:Revert "Hard remove BluetoothHeadset#setPriority S... Change-Id: Id86ba6bd922cd862560a635cc9b8bd79ca0f9d28 --- .../java/android/bluetooth/BluetoothHeadset.java | 43 ---------------------- 1 file changed, 43 deletions(-) (limited to 'framework/java/android/bluetooth/BluetoothHeadset.java') diff --git a/framework/java/android/bluetooth/BluetoothHeadset.java b/framework/java/android/bluetooth/BluetoothHeadset.java index c0463243f4..8212eaa4e4 100644 --- a/framework/java/android/bluetooth/BluetoothHeadset.java +++ b/framework/java/android/bluetooth/BluetoothHeadset.java @@ -600,49 +600,6 @@ public final class BluetoothHeadset implements BluetoothProfile { return BluetoothProfile.STATE_DISCONNECTED; } - /** - * Set priority of the profile - * - *

The device should already be paired. - * Priority can be one of {@link BluetoothProfile#PRIORITY_ON} or - * {@link BluetoothProfile#PRIORITY_OFF} - * - * @param device Paired bluetooth device - * @param priority - * @return true if priority is set, false on error - * @hide - * @deprecated Replaced with {@link #setConnectionPolicy(BluetoothDevice, int)} - * @removed - */ - @Deprecated - @SystemApi - @RequiresLegacyBluetoothAdminPermission - @RequiresBluetoothConnectPermission - @RequiresPermission(allOf = { - android.Manifest.permission.BLUETOOTH_CONNECT, - android.Manifest.permission.MODIFY_PHONE_STATE, - }) - public boolean setPriority(BluetoothDevice device, int priority) { - if (DBG) log("setPriority(" + device + ", " + priority + ")"); - final IBluetoothHeadset service = mService; - if (service != null && isEnabled() && isValidDevice(device)) { - if (priority != BluetoothProfile.PRIORITY_OFF - && priority != BluetoothProfile.PRIORITY_ON) { - return false; - } - try { - return service.setPriority( - device, BluetoothAdapter.priorityToConnectionPolicy(priority), - mAttributionSource); - } catch (RemoteException e) { - Log.e(TAG, Log.getStackTraceString(new Throwable())); - return false; - } - } - if (service == null) Log.w(TAG, "Proxy not attached to service"); - return false; - } - /** * Set connection policy of the profile * -- cgit v1.2.3