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

Commit c116ddf4 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Automerger Merge Worker
Browse files

VolumeControlService: Fix update volume during ringtone am: 390b15e5

parents e9d096e6 390b15e5
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -1031,10 +1031,23 @@ public class VolumeControlService extends ProfileService {
    // Copied from AudioService.getBluetoothContextualVolumeStream() and modified it.
    int getBluetoothContextualVolumeStream() {
        int mode = mAudioManager.getMode();

        if (DBG) {
            Log.d(TAG, "Volume mode: " + mode + "0: normal, 1: ring, 2,3: call");
        }

        switch (mode) {
            case AudioManager.MODE_IN_COMMUNICATION:
            case AudioManager.MODE_IN_CALL:
                return AudioManager.STREAM_VOICE_CALL;
            case AudioManager.MODE_RINGTONE:
            if (mFeatureFlags.leaudioVolumeChangeOnRingtoneFix()) {
                if (DBG) {
                    Log.d(TAG, " Update during ringtone applied to voice call");
                }
                return AudioManager.STREAM_VOICE_CALL;
            }
            // fall through
            case AudioManager.MODE_NORMAL:
            default:
                // other conditions will influence the stream type choice, read on...