diff options
author | phaneendra Reddy <quic_phaneend@quicinc.com> | 2022-02-14 11:16:41 +0530 |
---|---|---|
committer | phaneendra Reddy <quic_phaneend@quicinc.com> | 2022-02-14 11:16:41 +0530 |
commit | 8da1b76e65894cd2135826e56a3683ded5a4478b (patch) | |
tree | fa8b58d62ece38ed63f7517bd603552bf2edd4cc /framework/java/android/bluetooth/BluetoothHeadset.java | |
parent | bea85c624eb562d9d93dc015b48dc34fd28ed479 (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
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothHeadset.java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothHeadset.java | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHeadset.java b/framework/java/android/bluetooth/BluetoothHeadset.java index 007e50be9a..7a69f00a0e 100644 --- a/framework/java/android/bluetooth/BluetoothHeadset.java +++ b/framework/java/android/bluetooth/BluetoothHeadset.java @@ -1565,4 +1565,59 @@ 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())); + } + } } |