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

Commit aae80a57 authored by Vicky Sehrawat's avatar Vicky Sehrawat Committed by Steve Kondik
Browse files

frameworks/base: Add changes for Incall Music Delivery

- Add Flag and Stream type required for incall music delivery.
- Add Tone types for ToneGenerator

Change-Id: Ic05cd1af1172dda3c527af826c6e9a48d6ae20d5
parent 3fe9e991
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -275,6 +275,9 @@ android_media_AudioTrack_native_setup(JNIEnv *env, jobject thiz, jobject weak_th
    case AUDIO_STREAM_NOTIFICATION:
    case AUDIO_STREAM_BLUETOOTH_SCO:
    case AUDIO_STREAM_DTMF:
#ifdef QCOM_HARDWARE
    case AUDIO_STREAM_INCALL_MUSIC:
#endif
        atStreamType = (audio_stream_type_t) streamType;
        break;
    default:
@@ -834,6 +837,9 @@ static jint android_media_AudioTrack_get_output_sample_rate(JNIEnv *env, jobjec
    case AUDIO_STREAM_NOTIFICATION:
    case AUDIO_STREAM_BLUETOOTH_SCO:
    case AUDIO_STREAM_DTMF:
#ifdef QCOM_HARDWARE
    case AUDIO_STREAM_INCALL_MUSIC:
#endif
        nativeStreamType = (audio_stream_type_t) javaStreamType;
        break;
    default:
+4 −1
Original line number Diff line number Diff line
@@ -222,6 +222,8 @@ public class AudioManager {
    public static final int STREAM_DTMF = AudioSystem.STREAM_DTMF;
    /** @hide The audio stream for text to speech (TTS) */
    public static final int STREAM_TTS = AudioSystem.STREAM_TTS;
    /** @hide The audio stream for incall music delivery */
    public static final int STREAM_INCALL_MUSIC = AudioSystem.STREAM_INCALL_MUSIC;
    /** Number of audio streams */
    /**
     * @deprecated Use AudioSystem.getNumStreamTypes() instead
@@ -240,7 +242,8 @@ public class AudioManager {
        7,  // STREAM_BLUETOOTH_SCO
        7,  // STREAM_SYSTEM_ENFORCED
        11, // STREAM_DTMF
        11  // STREAM_TTS
        11, // STREAM_TTS
        4   // STREAM_INCALL_MUSIC
    };

    /**
+2 −0
Original line number Diff line number Diff line
@@ -52,6 +52,8 @@ public class AudioSystem
    public static final int STREAM_DTMF = 8;
    /* @hide The audio stream for text to speech (TTS) */
    public static final int STREAM_TTS = 9;
    /* @hide The audio stream for incall music delivery */
    public static final int STREAM_INCALL_MUSIC = 10;
    /**
     * @deprecated Use {@link #numStreamTypes() instead}
     */
+18 −0
Original line number Diff line number Diff line
@@ -722,6 +722,24 @@ public class ToneGenerator
     * @see #ToneGenerator(int, int)
     */
    public static final int TONE_CDMA_SIGNAL_OFF = 98;
    /**
     * LOCAL_CW - 440Hz
     *
     * @hide #ToneGenerator(int, int)
     */
    public static final int TONE_LOCAL_CW = 99;
    /**
     * SUPERVISORY_CH - 440Hz
     *
     * @hide #ToneGenerator(int, int)
     */
    public static final int TONE_SUPERVISORY_CH = 100;
    /**
     * HOLD_RECALL - 440Hz
     *
     * @hide #ToneGenerator(int, int)
     */
    public static final int TONE_HOLD_RECALL = 101;

    /** Maximum volume, for use with {@link #ToneGenerator(int,int)} */
    public static final int MAX_VOLUME = 100;