HFP 1.7 profile update (3/4)
am: 0d98ebf997
* commit '0d98ebf997b24e96d0328b4195a22832f9ae2664':
HFP 1.7 profile update (3/4)
Change-Id: I1594696d1d341026b7bd7f0a65c5cdac7049492e
This commit is contained in:
@@ -220,6 +220,46 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
* {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} of
|
* {@link #EXTRA_STATE} or {@link #EXTRA_PREVIOUS_STATE} of
|
||||||
* {@link #ACTION_AUDIO_STATE_CHANGED} intent.
|
* {@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;
|
public static final int STATE_AUDIO_CONNECTED = 12;
|
||||||
|
|
||||||
private static final int MESSAGE_HEADSET_SERVICE_CONNECTED = 100;
|
private static final int MESSAGE_HEADSET_SERVICE_CONNECTED = 100;
|
||||||
@@ -969,6 +1009,29 @@ public final class BluetoothHeadset implements BluetoothProfile {
|
|||||||
return false;
|
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
|
private final IBluetoothProfileServiceConnection mConnection
|
||||||
= new IBluetoothProfileServiceConnection.Stub() {
|
= new IBluetoothProfileServiceConnection.Stub() {
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -59,4 +59,5 @@ interface IBluetoothHeadset {
|
|||||||
String number, int type);
|
String number, int type);
|
||||||
boolean enableWBS();
|
boolean enableWBS();
|
||||||
boolean disableWBS();
|
boolean disableWBS();
|
||||||
|
void bindResponse(int ind_id, boolean ind_status);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user