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

Commit 89091bac authored by Shuhei Miyazaki's avatar Shuhei Miyazaki
Browse files

audioservice: Add a property for default voice call volume

Add a property ro.config.vc_call_vol_default to modify
default voice call value.

Also add a condition to check minimum stream volume
both voice call and music.

Bug: 71843078
Test: verify default voice call volume after factory reset.
Change-Id: I1ebb1dc6d4c9211adf80ac179867af4b84371898
parent 639fe64c
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -685,6 +685,14 @@ public class AudioService extends IAudioService.Stub
        int maxCallVolume = SystemProperties.getInt("ro.config.vc_call_vol_steps", -1);
        if (maxCallVolume != -1) {
            MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] = maxCallVolume;
        }

        int defaultCallVolume = SystemProperties.getInt("ro.config.vc_call_vol_default", -1);
        if (defaultCallVolume != -1 &&
                defaultCallVolume <= MAX_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] &&
                defaultCallVolume >= MIN_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL]) {
            AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] = defaultCallVolume;
        } else {
            AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_VOICE_CALL] =
                    (maxCallVolume * 3) / 4;
        }
@@ -696,7 +704,8 @@ public class AudioService extends IAudioService.Stub

        int defaultMusicVolume = SystemProperties.getInt("ro.config.media_vol_default", -1);
        if (defaultMusicVolume != -1 &&
                defaultMusicVolume <= MAX_STREAM_VOLUME[AudioSystem.STREAM_MUSIC]) {
                defaultMusicVolume <= MAX_STREAM_VOLUME[AudioSystem.STREAM_MUSIC] &&
                defaultMusicVolume >= MIN_STREAM_VOLUME[AudioSystem.STREAM_MUSIC]) {
            AudioSystem.DEFAULT_STREAM_VOLUME[AudioSystem.STREAM_MUSIC] = defaultMusicVolume;
        } else {
            if (isPlatformTelevision()) {