From c24dbdb57b30f9e8fa6b0c5b48372017b5ae46b0 Mon Sep 17 00:00:00 2001 From: Jaikumar Ganesh Date: Fri, 2 Apr 2010 14:44:43 -0700 Subject: [PATCH] Add an extra for the Disconnect Headset State. This extra tells as to who initiated the disconnection. Bug:2568119 Change-Id: Iea706ad69f79ae0257604dfa84d49126fb851cca --- .../java/android/bluetooth/BluetoothHeadset.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index fff75ca9aff23..95e61b6f6aced 100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/java/android/bluetooth/BluetoothHeadset.java @@ -73,6 +73,17 @@ public final class BluetoothHeadset { public static final String EXTRA_AUDIO_STATE = "android.bluetooth.headset.extra.AUDIO_STATE"; + /** Extra to be used with the Headset State change intent. + * This will be used only when Headset state changes to + * {@link #STATE_DISCONNECTED} from any previous state. + * This extra field is optional and will be used when + * we have deterministic information regarding whether + * the disconnect was initiated by the remote device or + * by the local adapter. + */ + public static final String EXTRA_DISCONNECT_INITIATOR = + "android.bluetooth.headset.extra.DISCONNECT_INITIATOR"; + /** * TODO(API release): Consider incorporating as new state in * HEADSET_STATE_CHANGED @@ -100,6 +111,11 @@ public final class BluetoothHeadset { /** Connection canceled before completetion. */ public static final int RESULT_CANCELED = 2; + /** Values for {@link #EXTRA_DISCONNECT_INITIATOR} */ + public static final int REMOTE_DISCONNECT = 0; + public static final int LOCAL_DISCONNECT = 1; + + /** Default priority for headsets that for which we will accept * inconing connections and auto-connect */ public static final int PRIORITY_AUTO_CONNECT = 1000;