Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c04cfa35 authored by Eric Laurent's avatar Eric Laurent
Browse files

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
parent 7942b33e
Loading
Loading
Loading
Loading
+89 −1
Original line number Diff line number Diff line
@@ -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="&quot;android.media.SCO_AUDIO_STATE_CHANGED&quot;"
 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="&quot;android.media.extra.SCO_AUDIO_STATE&quot;"
 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>
+1 −17
Original line number Diff line number Diff line
@@ -693,8 +693,6 @@ public class AudioManager {
    //====================================================================
    // 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 class AudioManager {
    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 @@ public class AudioManager {
            "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 @@ public class AudioManager {


    /**
     * @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 @@ public class AudioManager {
    }

    /**
     * @hide
     * TODO unhide for SDK
     * Start bluetooth SCO audio connection.
     * <p>Requires Permission:
     *   {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS}.
@@ -772,7 +758,7 @@ public class AudioManager {
     * 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 @@ public class AudioManager {
    }

    /**
     * @hide
     * TODO unhide for SDK
     * Stop bluetooth SCO audio connection.
     * <p>Requires Permission:
     *   {@link android.Manifest.permission#MODIFY_AUDIO_SETTINGS}.