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

Commit b197ea19 authored by Marcel Dopita's avatar Marcel Dopita Committed by Gerrit Code Review
Browse files

Fix forcing media stream control on tablet

There's option volume_keys_control_ring_stream (Volume keys control ringtone
volume / If on, volume keys control ringtone volume. If off, volume keys
control media volume.) in Settings which is also available on tablets but it
doesn't work on these devices (I didn't find reported issue).
As I like this option and think it may be even more wanted on media devices
such as tablets, here's a fix.

Change-Id: Ib4fd2e578df5d2bd6f69626863dca20cb014c96f
parent be849c55
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -3498,9 +3498,15 @@ public class AudioService extends IAudioService.Stub {
                    if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: forcing STREAM_MUSIC");
                    return AudioSystem.STREAM_MUSIC;
                } else {
                    if (DEBUG_VOL) Log.v(TAG,
                            "getActiveStreamType: using STREAM_NOTIFICATION as default");
                    if (mVolumeKeysControlRingStream) {
                        if (DEBUG_VOL)
                            Log.v(TAG, "getActiveStreamType: Forcing STREAM_NOTIFICATION b/c default");
                        return AudioSystem.STREAM_NOTIFICATION;
                    } else {
                        if (DEBUG_VOL)
                            Log.v(TAG, "getActiveStreamType: Forcing STREAM_MUSIC b/c default");
                        return AudioSystem.STREAM_MUSIC;
                    }
                }
            }
            break;