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

Commit bc4d3b86 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Volume curves: alarm and accessibility can't be muted

Add new "non mutable" default volume curves, use them for alarm
  and accessibility.
Volume curves that start at 1 can be muted (at 0, attenuation
  is -infinity): modify alarm and a11y curves to start at 0.

Bug: 72403580
Bug: 74985293
Test: try to mute alarms through UI and fail
Change-Id: Ieed1143f392b359198acabf986caa183536761a5
parent 1f03085b
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -76,17 +76,17 @@ volume index from 0 to 100.
    <volume stream="AUDIO_STREAM_MUSIC" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
                                        ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_HEADSET"
                                        ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
                                        ref="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_SPEAKER">
        <point>1,-2970</point>
        <point>0,-2970</point>
        <point>33,-2010</point>
        <point>66,-1020</point>
        <point>100,0</point>
    </volume>
    <volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_EARPIECE"
                                        ref="DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE"/>
                                        ref="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_ALARM" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
                                        ref="DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE"/>
                                        ref="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_HEADSET"
                                               ref="DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_NOTIFICATION" deviceCategory="DEVICE_CATEGORY_SPEAKER">
@@ -152,13 +152,13 @@ volume index from 0 to 100.
    <volume stream="AUDIO_STREAM_TTS" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
                                      ref="SILENT_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_HEADSET"
                                                ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
                                                ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_SPEAKER"
                                                ref="DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE"/>
                                                ref="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_EARPIECE"
                                                ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
                                                ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_ACCESSIBILITY" deviceCategory="DEVICE_CATEGORY_EXT_MEDIA"
                                                ref="DEFAULT_MEDIA_VOLUME_CURVE"/>
                                                ref="DEFAULT_NON_MUTABLE_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_HEADSET"
                                            ref="FULL_SCALE_VOLUME_CURVE"/>
    <volume stream="AUDIO_STREAM_REROUTING" deviceCategory="DEVICE_CATEGORY_SPEAKER"
+44 −0
Original line number Diff line number Diff line
@@ -67,4 +67,48 @@
        <point>60,-2100</point>
        <point>100,-1000</point>
    </reference>
    <!-- **************************************************************** -->
    <!-- Non-mutable default volume curves:                               -->
    <!--     * first point is always for index 0                          -->
    <!--     * attenuation is small enough that stream can still be heard -->
    <reference name="DEFAULT_NON_MUTABLE_VOLUME_CURVE">
	<!-- Default non-mutable reference Volume Curve -->
	<!--        based on DEFAULT_MEDIA_VOLUME_CURVE -->
        <point>0,-5800</point>
        <point>20,-4000</point>
        <point>60,-1700</point>
        <point>100,0</point>
    </reference>
    <reference name="DEFAULT_NON_MUTABLE_HEADSET_VOLUME_CURVE">
	<!--Default non-mutable Volume Curve for headset -->
	<!--    based on DEFAULT_DEVICE_CATEGORY_HEADSET_VOLUME_CURVE -->
        <point>0,-4950</point>
        <point>33,-3350</point>
        <point>66,-1700</point>
        <point>100,0</point>
    </reference>
    <reference name="DEFAULT_NON_MUTABLE_SPEAKER_VOLUME_CURVE">
	<!-- Default non-mutable Speaker Volume Curve -->
	<!--    based on DEFAULT_DEVICE_CATEGORY_SPEAKER_VOLUME_CURVE -->
        <point>0,-5800</point>
        <point>20,-4000</point>
        <point>60,-1700</point>
        <point>100,0</point>
    </reference>
    <reference name="DEFAULT_NON_MUTABLE_EARPIECE_VOLUME_CURVE">
	<!--Default non-mutable Volume Curve -->
	<!--    based on DEFAULT_DEVICE_CATEGORY_EARPIECE_VOLUME_CURVE -->
        <point>0,-4950</point>
        <point>33,-3350</point>
        <point>66,-1700</point>
        <point>100,0</point>
    </reference>
    <reference name="DEFAULT_NON_MUTABLE_EXT_VOLUME_CURVE">
	<!-- Default non-mutable Ext Media System Volume Curve -->
	<!--     based on DEFAULT_DEVICE_CATEGORY_EXT_MEDIA_VOLUME_CURVE -->
        <point>0,-5800</point>
        <point>20,-4000</point>
        <point>60,-2100</point>
        <point>100,-1000</point>
    </reference>
</volumes>