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

Commit 47a14467 authored by Anton Potapov's avatar Anton Potapov
Browse files

Handle AudioManager#STREAM_ASSISTANT in the Volume Dialog

Flag: EXEMPT BUG_FIX
Fixes: 425678964
Test: manual on the phone
Change-Id: I28b08458400dbdd3f13d7a78bc3152c3afba10b2
parent cf299f6e
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -1914,6 +1914,7 @@
    <string name="stream_dtmf">Dual multi tone frequency</string> <!-- STREAM_DTMF -->
    <string name="stream_dtmf">Dual multi tone frequency</string> <!-- STREAM_DTMF -->
    <string name="stream_tts" translatable="false">Transmitted Through Speaker</string> <!-- STREAM_TTS -->
    <string name="stream_tts" translatable="false">Transmitted Through Speaker</string> <!-- STREAM_TTS -->
    <string name="stream_accessibility">Accessibility</string> <!-- STREAM_ACCESSIBILITY -->
    <string name="stream_accessibility">Accessibility</string> <!-- STREAM_ACCESSIBILITY -->
    <string name="stream_assistant">Assistant</string> <!-- STREAM_ASSISTANT -->


    <string name="volume_ringer_status_normal">Ring</string>
    <string name="volume_ringer_status_normal">Ring</string>
    <string name="volume_ringer_status_vibrate">Vibrate</string>
    <string name="volume_ringer_status_vibrate">Vibrate</string>
+1 −0
Original line number Original line Diff line number Diff line
@@ -127,6 +127,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
        STREAMS.put(AudioSystem.STREAM_SYSTEM_ENFORCED, R.string.stream_system_enforced);
        STREAMS.put(AudioSystem.STREAM_SYSTEM_ENFORCED, R.string.stream_system_enforced);
        STREAMS.put(AudioSystem.STREAM_TTS, R.string.stream_tts);
        STREAMS.put(AudioSystem.STREAM_TTS, R.string.stream_tts);
        STREAMS.put(AudioSystem.STREAM_VOICE_CALL, R.string.stream_voice_call);
        STREAMS.put(AudioSystem.STREAM_VOICE_CALL, R.string.stream_voice_call);
        STREAMS.put(AudioSystem.STREAM_ASSISTANT, R.string.stream_assistant);
    }
    }


    private final W mWorker;
    private final W mWorker;
+2 −0
Original line number Original line Diff line number Diff line
@@ -145,6 +145,7 @@ constructor(
                AudioManager.STREAM_RING -> ringerOfflineIcon ?: R.drawable.ic_volume_ringer_vibrate
                AudioManager.STREAM_RING -> ringerOfflineIcon ?: R.drawable.ic_volume_ringer_vibrate
                AudioManager.STREAM_ALARM -> R.drawable.ic_volume_alarm_mute
                AudioManager.STREAM_ALARM -> R.drawable.ic_volume_alarm_mute
                AudioManager.STREAM_SYSTEM -> R.drawable.ic_volume_system_mute
                AudioManager.STREAM_SYSTEM -> R.drawable.ic_volume_system_mute
                AudioManager.STREAM_ASSISTANT -> R.drawable.ic_volume_system_mute
                else -> null
                else -> null
            }
            }
        } else {
        } else {
@@ -168,6 +169,7 @@ constructor(
            AudioManager.STREAM_ALARM -> R.drawable.ic_alarm
            AudioManager.STREAM_ALARM -> R.drawable.ic_alarm
            AudioManager.STREAM_VOICE_CALL -> com.android.internal.R.drawable.ic_phone
            AudioManager.STREAM_VOICE_CALL -> com.android.internal.R.drawable.ic_phone
            AudioManager.STREAM_SYSTEM -> R.drawable.ic_volume_system
            AudioManager.STREAM_SYSTEM -> R.drawable.ic_volume_system
            AudioManager.STREAM_ASSISTANT -> R.drawable.ic_volume_system
            else -> error("Unsupported stream: $stream")
            else -> error("Unsupported stream: $stream")
        }
        }
    }
    }