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

Commit 5f72e168 authored by John Spurlock's avatar John Spurlock Committed by Android (Google) Code Review
Browse files

Merge "AudioService: getMasterStreamType -> RING on tablets." into lmp-dev

parents f99f320d 4f0f1203
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -834,6 +834,7 @@ public class AudioManager {
    /**
     * Get the stream type whose volume is driving the UI sounds volume.
     * UI sounds are screen lock/unlock, camera shutter, key clicks...
     * It is assumed that this stream type is also tied to ringer mode changes.
     * @hide
     */
    public int getMasterStreamType() {
+4 −12
Original line number Diff line number Diff line
@@ -291,14 +291,14 @@ public class AudioService extends IAudioService.Stub {
    };
    private final int[] STREAM_VOLUME_ALIAS_DEFAULT = new int[] {
        AudioSystem.STREAM_VOICE_CALL,      // STREAM_VOICE_CALL
        AudioSystem.STREAM_MUSIC,           // STREAM_SYSTEM
        AudioSystem.STREAM_RING,            // STREAM_SYSTEM
        AudioSystem.STREAM_RING,            // STREAM_RING
        AudioSystem.STREAM_MUSIC,           // STREAM_MUSIC
        AudioSystem.STREAM_ALARM,           // STREAM_ALARM
        AudioSystem.STREAM_RING,            // STREAM_NOTIFICATION
        AudioSystem.STREAM_BLUETOOTH_SCO,   // STREAM_BLUETOOTH_SCO
        AudioSystem.STREAM_MUSIC,           // STREAM_SYSTEM_ENFORCED
        AudioSystem.STREAM_MUSIC,           // STREAM_DTMF
        AudioSystem.STREAM_RING,            // STREAM_SYSTEM_ENFORCED
        AudioSystem.STREAM_RING,            // STREAM_DTMF
        AudioSystem.STREAM_MUSIC            // STREAM_TTS
    };
    private int[] mStreamVolumeAlias;
@@ -1572,15 +1572,7 @@ public class AudioService extends IAudioService.Stub {

    /** @see AudioManager#getMasterStreamType()  */
    public int getMasterStreamType() {
        switch (mPlatformType) {
            case PLATFORM_VOICE:
                return AudioSystem.STREAM_RING;
            case PLATFORM_TELEVISION:
                return AudioSystem.STREAM_MUSIC;
            default:
                break;
        }
        return AudioSystem.STREAM_NOTIFICATION;
        return mStreamVolumeAlias[AudioSystem.STREAM_SYSTEM];
    }

    /** @see AudioManager#setMicrophoneMute(boolean) */
+4 −4
Original line number Diff line number Diff line
@@ -680,15 +680,15 @@ public class VolumePanel extends Handler {
            // never disable touch interactions for remote playback, the muting is not tied to
            // the state of the phone.
            sc.seekbarView.setEnabled(!fixedVolume);
        } else if (fixedVolume ||
                        (sc.streamType != mAudioManager.getMasterStreamType() && muted) ||
                        (sSafetyWarning != null)) {
            sc.seekbarView.setEnabled(false);
        } else if (isRinger && mAudioManager.getRingerMode() == AudioManager.RINGER_MODE_SILENT) {
            sc.seekbarView.setEnabled(false);
            sc.icon.setEnabled(false);
            sc.icon.setAlpha(mDisabledAlpha);
            sc.icon.setClickable(false);
        } else if (fixedVolume ||
                (sc.streamType != mAudioManager.getMasterStreamType() && muted) ||
                (sSafetyWarning != null)) {
            sc.seekbarView.setEnabled(false);
        } else {
            sc.seekbarView.setEnabled(true);
            sc.icon.setEnabled(true);