Unhide AudioManager API to control bluetooth SCO audio connection.
Needed for issue 2416481 in order to allow unbundled applications to play and record
audio to/from a bluetooth SCO headset while not in call.
Change-Id: Ie1f96ded991e65da538c2c4a58bfa1e548d58a01
diff --git a/api/current.xml b/api/current.xml
index d3e673e..64f0c23 100644
--- a/api/current.xml
+++ b/api/current.xml
@@ -80540,6 +80540,17 @@
visibility="public"
>
</method>
+<method name="isBluetoothScoAvailableOffCall"
+ return="boolean"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="isBluetoothScoOn"
return="boolean"
abstract="false"
@@ -80860,6 +80871,28 @@
<parameter name="vibrateType" type="int">
</parameter>
</method>
+<method name="startBluetoothSco"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
+<method name="stopBluetoothSco"
+ return="void"
+ abstract="false"
+ native="false"
+ synchronized="false"
+ static="false"
+ final="false"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</method>
<method name="unloadSoundEffects"
return="void"
abstract="false"
@@ -80895,6 +80928,17 @@
visibility="public"
>
</field>
+<field name="ACTION_SCO_AUDIO_STATE_CHANGED"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.media.SCO_AUDIO_STATE_CHANGED""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="ADJUST_LOWER"
type="int"
transient="false"
@@ -81005,6 +81049,17 @@
visibility="public"
>
</field>
+<field name="EXTRA_SCO_AUDIO_STATE"
+ type="java.lang.String"
+ transient="false"
+ volatile="false"
+ value=""android.media.extra.SCO_AUDIO_STATE""
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="EXTRA_VIBRATE_SETTING"
type="java.lang.String"
transient="false"
@@ -81368,6 +81423,39 @@
visibility="public"
>
</field>
+<field name="SCO_AUDIO_STATE_CONNECTED"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SCO_AUDIO_STATE_DISCONNECTED"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="0"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
+<field name="SCO_AUDIO_STATE_ERROR"
+ type="int"
+ transient="false"
+ volatile="false"
+ value="-1"
+ static="true"
+ final="true"
+ deprecated="not deprecated"
+ visibility="public"
+>
+</field>
<field name="STREAM_ALARM"
type="int"
transient="false"
@@ -385585,7 +385673,7 @@
deprecated="not deprecated"
visibility="public"
>
-<parameter name="message" type="java.lang.String">
+<parameter name="text" type="java.lang.String">
</parameter>
</method>
</class>
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java
index 3a3c66b..47a9004 100644
--- a/media/java/android/media/AudioManager.java
+++ b/media/java/android/media/AudioManager.java
@@ -693,8 +693,6 @@
//====================================================================
// Bluetooth SCO control
/**
- * @hide
- * TODO unhide for SDK
* Sticky broadcast intent action indicating that the bluetoooth SCO audio
* connection state has changed. The intent contains on extra {@link EXTRA_SCO_AUDIO_STATE}
* indicating the new state which is either {@link #SCO_AUDIO_STATE_DISCONNECTED}
@@ -706,8 +704,6 @@
public static final String ACTION_SCO_AUDIO_STATE_CHANGED =
"android.media.SCO_AUDIO_STATE_CHANGED";
/**
- * @hide
- * TODO unhide for SDK
* Extra for intent {@link #ACTION_SCO_AUDIO_STATE_CHANGED} containing the new
* bluetooth SCO connection state.
*/
@@ -715,22 +711,16 @@
"android.media.extra.SCO_AUDIO_STATE";
/**
- * @hide
- * TODO unhide for SDK
* Value for extra {@link #EXTRA_SCO_AUDIO_STATE} indicating that the
* SCO audio channel is not established
*/
public static final int SCO_AUDIO_STATE_DISCONNECTED = 0;
/**
- * @hide
- * TODO unhide for SDK
* Value for extra {@link #EXTRA_SCO_AUDIO_STATE} indicating that the
* SCO audio channel is established
*/
public static final int SCO_AUDIO_STATE_CONNECTED = 1;
/**
- * @hide
- * TODO unhide for SDK
* Value for extra {@link #EXTRA_SCO_AUDIO_STATE} indicating that
* there was an error trying to obtain the state
*/
@@ -738,8 +728,6 @@
/**
- * @hide
- * TODO unhide for SDK
* Indicates if current platform supports use of SCO for off call use cases.
* Application wanted to use bluetooth SCO audio when the phone is not in call
* must first call thsi method to make sure that the platform supports this
@@ -754,8 +742,6 @@
}
/**
- * @hide
- * TODO unhide for SDK
* Start bluetooth SCO audio connection.
* <p>Requires Permission:
* {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS}.
@@ -772,7 +758,7 @@
* down the bluetooth connection.
* <p>Even if a SCO connection is established, the following restrictions apply on audio
* output streams so that they can be routed to SCO headset:
- * - the stream type must be {@link #STREAM_VOICE_CALL} or {@link #STREAM_BLUETOOTH_SCO}
+ * - the stream type must be {@link #STREAM_VOICE_CALL}
* - the format must be mono
* - the sampling must be 16kHz or 8kHz
* <p>The following restrictions apply on input streams:
@@ -797,8 +783,6 @@
}
/**
- * @hide
- * TODO unhide for SDK
* Stop bluetooth SCO audio connection.
* <p>Requires Permission:
* {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS}.