diff options
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())); + } + } } |