diff options
author | Satish Kumar Kodishala <quic_skodisha@quicinc.com> | 2021-12-25 17:40:38 +0530 |
---|---|---|
committer | Satish Kumar Kodishala <quic_skodisha@quicinc.com> | 2022-01-19 18:14:56 +0000 |
commit | 3b81c0d256f2481e9e40b57c88acd1366b04dbcb (patch) | |
tree | 43f12e2e34d09b6b12a2e1585c9a63c1d4b40b7c | |
parent | f04e9a125aa736023961f68e539c1e65b551c4bd (diff) |
BT FWK: Add APIs for call state, call list update for DSDA
Add APIs for call state, call list update for DSDA.
- phoneStateChangedDsDa is used for updating call
state changes from DSDA service.
- clccResponseDsDa is used for updating clcc responses
from DSDA service.
CRs-Fixed: 3108072
Change-Id: I3ba6401070bbaa264e7f81b2f305cd5ab6ae5762
-rw-r--r-- | core/java/android/bluetooth/BluetoothHeadset.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index 95d7f4e4a207..aadd036250fe 100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/java/android/bluetooth/BluetoothHeadset.java @@ -1500,4 +1500,60 @@ public final class BluetoothHeadset implements BluetoothProfile { } } }; + + /** + * Notify Headset of phone state change. + * This is a backdoor for phone app to call BluetoothHeadset since + * there is currently not a good way to get precise call state change outside + * of phone app. + * + * @hide + */ + @RequiresBluetoothConnectPermission + @RequiresPermission(allOf = { + android.Manifest.permission.BLUETOOTH_CONNECT, + android.Manifest.permission.MODIFY_PHONE_STATE, + }) + public void phoneStateChangedDsDa(int numActive, int numHeld, int callState, String number, + int type, String name) { + final IBluetoothHeadset service = mService; + if (service != null && isEnabled()) { + try { + service.phoneStateChangedDsDa(numActive, numHeld, callState, number, type, name, + mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable())); + } + } + + /** + * Send Headset of CLCC response + * + * @hide + */ + @RequiresBluetoothConnectPermission + @RequiresPermission(allOf = { + android.Manifest.permission.BLUETOOTH_CONNECT, + android.Manifest.permission.MODIFY_PHONE_STATE, + }) + public void clccResponseDsDa(int index, int direction, int status, int mode, boolean mpty, + String number, int type) { + final IBluetoothHeadset service = mService; + if (service != null && isEnabled()) { + try { + service.clccResponseDsDa(index, direction, status, mode, mpty, number, type, + mAttributionSource); + } catch (RemoteException e) { + Log.e(TAG, e.toString()); + } + } else { + Log.w(TAG, "Proxy not attached to service"); + if (DBG) Log.d(TAG, Log.getStackTraceString(new Throwable())); + } + } + } |