diff options
Diffstat (limited to 'framework/java')
-rw-r--r-- | framework/java/android/bluetooth/BluetoothHeadset.java | 63 | ||||
-rwxr-xr-x | framework/java/android/bluetooth/IBluetoothHeadset.aidl | 1 |
2 files changed, 64 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHeadset.java b/framework/java/android/bluetooth/BluetoothHeadset.java index 09a15de877..f46a3b3c73 100644 --- a/framework/java/android/bluetooth/BluetoothHeadset.java +++ b/framework/java/android/bluetooth/BluetoothHeadset.java @@ -220,6 +220,46 @@ public final class BluetoothHeadset implements BluetoothProfile { * {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} of * {@link #ACTION_AUDIO_STATE_CHANGED} intent. */ + + /** + * Intent used to broadcast the headset's indicator status + * + * <p>This intent will have 3 extras: + * <ul> + * <li> {@link #EXTRA_IND_ID} - The Assigned number of headset Indicator which is supported by + the headset ( as indicated by AT+BIND + command in the SLC sequence).or whose value + is changed (indicated by AT+BIEV command)</li> + * <li> {@link #EXTRA_IND_VALUE}- The updated value of headset indicator. </li> + * <li> {@link BluetoothDevice#EXTRA_DEVICE} - The remote device. </li> + * </ul> + * <p>{@link #EXTRA_IND_ID} is defined by Bluetooth SIG and each of the indicators are + * given an assigned number. Below shows the assigned number of Indicator added so far + * - Enhanced Safety - 1 + * <p>Requires {@link android.Manifest.permission#BLUETOOTH} permission to + * receive. + * @hide + */ + public static final String ACTION_HF_INDICATORS_VALUE_CHANGED = + "android.bluetooth.headset.action.HF_INDICATORS_VALUE_CHANGED"; + + /** + * A String extra field in {@link #ACTION_HF_INDICATORS_VALUE_CHANGED} + * intents that contains the UUID of the headset indicator (as defined by Bluetooth SIG) + * that is being sent. + * @hide + */ + public static final String EXTRA_HF_INDICATORS_IND_ID = + "android.bluetooth.headset.extra.HF_INDICATORS_IND_ID"; + + /** + * A int extra field in {@link #ACTION_HF_INDICATORS_VALUE_CHANGED} + * intents that contains the value of the Headset indicator that is being sent. + * @hide + */ + public static final String EXTRA_HF_INDICATORS_IND_VALUE = + "android.bluetooth.headset.extra.HF_INDICATORS_IND_VALUE"; + public static final int STATE_AUDIO_CONNECTED = 12; private static final int MESSAGE_HEADSET_SERVICE_CONNECTED = 100; @@ -969,6 +1009,29 @@ public final class BluetoothHeadset implements BluetoothProfile { return false; } + /** + * Send Headset the BIND response from AG to report change in the status of the + * HF indicators to the headset + * + * @param ind_id Assigned Number of the indicator (defined by SIG) + * @param ind_status + * possible values- false-Indicator is disabled, no value changes shall be sent for this indicator + * true-Indicator is enabled, value changes may be sent for this indicator + * @hide + */ + public void bindResponse(int ind_id, boolean ind_status) { + if (mService != null && isEnabled()) { + try { + mService.bindResponse(ind_id, ind_status); + } 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())); + } + } + private final IBluetoothProfileServiceConnection mConnection = new IBluetoothProfileServiceConnection.Stub() { @Override diff --git a/framework/java/android/bluetooth/IBluetoothHeadset.aidl b/framework/java/android/bluetooth/IBluetoothHeadset.aidl index 0bb4088f62..6ad442b613 100755 --- a/framework/java/android/bluetooth/IBluetoothHeadset.aidl +++ b/framework/java/android/bluetooth/IBluetoothHeadset.aidl @@ -59,4 +59,5 @@ interface IBluetoothHeadset { String number, int type); boolean enableWBS(); boolean disableWBS(); + void bindResponse(int ind_id, boolean ind_status); } |