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

Commit 05b07fd2 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "Add new audio mode for audio communications other than telelphony."

parents 1bf397ff 8f677d66
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -156,6 +156,7 @@ public:
        MODE_NORMAL = 0,
        MODE_RINGTONE,
        MODE_IN_CALL,
        MODE_IN_COMMUNICATION,
        NUM_MODES  // not a valid entry, denotes end-of-list
    };

+3 −3
Original line number Diff line number Diff line
@@ -602,9 +602,9 @@ enum audio_device_e {

// Audio mode
enum audio_mode_e {
    AUDIO_MODE_NORMAL,      // phone idle
    AUDIO_MODE_RINGTONE,    // phone ringing
    AUDIO_MODE_IN_CALL      // phone call connected
    AUDIO_MODE_NORMAL,      // device idle
    AUDIO_MODE_RINGTONE,    // device ringing
    AUDIO_MODE_IN_CALL      // audio call connected (VoIP or telephony)
};

// Values for "accessMode" field of buffer_config_t:
+8 −3
Original line number Diff line number Diff line
@@ -984,7 +984,7 @@ public class AudioManager {
     * application when it places a phone call, as it will cause signals from the radio layer
     * to feed the platform mixer.
     *
     * @param mode  the requested audio mode (NORMAL, RINGTONE, or IN_CALL).
     * @param mode  the requested audio mode (NORMAL, RINGTONE, IN_CALL or IN_COMMUNICATION).
     *              Informs the HAL about the current audio state so that
     *              it can route the audio appropriately.
     */
@@ -1000,7 +1000,7 @@ public class AudioManager {
    /**
     * Returns the current audio mode.
     *
     * @return      the current audio mode (NORMAL, RINGTONE, or IN_CALL).
     * @return      the current audio mode (NORMAL, RINGTONE, IN_CALL or IN_COMMUNICATION).
     *              Returns the current current audio state from the HAL.
     */
    public int getMode() {
@@ -1034,9 +1034,14 @@ public class AudioManager {
     */
    public static final int MODE_RINGTONE           = AudioSystem.MODE_RINGTONE;
    /**
     * In call audio mode. A call is established.
     * In call audio mode. A telephony call is established.
     */
    public static final int MODE_IN_CALL            = AudioSystem.MODE_IN_CALL;
    /**
     * @hide
     * In communication audio mode. An audio/video chat or VoIP call is established.
     */
    public static final int MODE_IN_COMMUNICATION   = AudioSystem.MODE_IN_COMMUNICATION;

    /* Routing bits for setRouting/getRouting API */
    /**
+2 −1
Original line number Diff line number Diff line
@@ -718,7 +718,7 @@ public class AudioService extends IAudioService.Stub {
            return;
        }

        if (mode < AudioSystem.MODE_CURRENT || mode > AudioSystem.MODE_IN_CALL) {
        if (mode < AudioSystem.MODE_CURRENT || mode >= AudioSystem.NUM_MODES) {
            return;
        }

@@ -2305,6 +2305,7 @@ public class AudioService extends IAudioService.Stub {
                //      add modify the phone app to take advantage of the new API
                synchronized(mRingingLock) {
                    if (mIsRinging || (getMode() == AudioSystem.MODE_IN_CALL) ||
                            (getMode() == AudioSystem.MODE_IN_COMMUNICATION) ||
                            (getMode() == AudioSystem.MODE_RINGTONE) ) {
                        return;
                    }
+2 −1
Original line number Diff line number Diff line
@@ -106,7 +106,8 @@ public class AudioSystem
    public static final int MODE_NORMAL             = 0;
    public static final int MODE_RINGTONE           = 1;
    public static final int MODE_IN_CALL            = 2;
    public static final int NUM_MODES               = 3;
    public static final int MODE_IN_COMMUNICATION   = 3;
    public static final int NUM_MODES               = 4;


    /* Routing bits for setRouting/getRouting API */
Loading