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

Commit 861c4a6b authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "AudioService-sysUI: sound dose dialogs and interfaces"

parents 53fd9072 a5321ff9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2011,6 +2011,9 @@
    <!-- The default volume for the ring stream -->
    <integer name="config_audio_ring_vol_default">5</integer>

    <!-- Enable sound dose computation and warnings -->
    <bool name="config_audio_csd_enabled_default">false</bool>

    <!-- The default value for whether head tracking for
         spatial audio is enabled for a newly connected audio device -->
    <bool name="config_spatial_audio_head_tracking_enabled_default">false</bool>
+22 −0
Original line number Diff line number Diff line
@@ -4572,6 +4572,28 @@
       "Raise volume above recommended level?\n\nListening at high volume for long periods may damage your hearing."
    </string>

    <!-- Message shown in dialog when user goes over a multiple of 100% of the safe weekly dose -->
    <string name="csd_dose_reached_warning" product="default">
        "Warning,\nYou have exceeded the amount of loud sound signals one can safely listen to in a week over headphones.\n\nGoing over this limit will permanently damage your hearing."
    </string>

    <!-- Message shown in dialog when user goes over 500% of the safe weekly dose and volume is
    automatically lowered -->
    <string name="csd_dose_repeat_warning" product="default">
        "Warning,\nYou have exceeded 5 times the amount of loud sound signals one can safely listen to in a week over headphones.\n\nVolume has been lowered to protect your hearing."
    </string>

    <!-- Message shown in dialog when user's dose enters RS2 -->
    <string name="csd_entering_RS2_warning" product="default">
        "The level at which you are listening to media can result in hearing damage when sustained over long periods of time.\n\nContinuing to play at this level for long periods of time could damage your hearing."
    </string>

    <!-- Message shown in dialog when user is momentarily listening to unsafely loud content
    over headphones -->
    <string name="csd_momentary_exposure_warning" product="default">
        "Warning,\nYou are currently listening to loud content played at an unsafe level.\n\nContinuing to listen this loud will permanently damage your hearing."
    </string>

    <!-- Dialog title for dialog shown when the accessibility shortcut is activated, and we want
     to confirm that the user understands what's going to happen-->
    <string name="accessibility_shortcut_warning_dialog_title">Use Accessibility Shortcut?</string>
+5 −0
Original line number Diff line number Diff line
@@ -283,6 +283,7 @@
  <java-symbol type="attr" name="autofillSaveCustomSubtitleMaxHeight"/>
  <java-symbol type="bool" name="action_bar_embed_tabs" />
  <java-symbol type="bool" name="action_bar_expanded_action_views_exclusive" />
  <java-symbol type="bool" name="config_audio_csd_enabled_default" />
  <java-symbol type="integer" name="config_audio_notif_vol_default" />
  <java-symbol type="integer" name="config_audio_notif_vol_steps" />
  <java-symbol type="integer" name="config_audio_ring_vol_default" />
@@ -659,6 +660,10 @@
  <java-symbol type="string" name="contentServiceSync" />
  <java-symbol type="string" name="contentServiceSyncNotificationTitle" />
  <java-symbol type="string" name="contentServiceTooManyDeletesNotificationDesc" />
  <java-symbol type="string" name="csd_dose_reached_warning" />
  <java-symbol type="string" name="csd_dose_repeat_warning" />
  <java-symbol type="string" name="csd_entering_RS2_warning" />
  <java-symbol type="string" name="csd_momentary_exposure_warning" />
  <java-symbol type="string" name="date_and_time" />
  <java-symbol type="string" name="date_picker_decrement_day_button" />
  <java-symbol type="string" name="date_picker_decrement_month_button" />
+43 −0
Original line number Diff line number Diff line
@@ -6236,6 +6236,49 @@ public class AudioManager {
        }
    }

    /**
     * @hide
     * Lower media volume to RS1
     */
    public void lowerVolumeToRs1() {
        try {
            getService().lowerVolumeToRs1(mApplicationContext.getOpPackageName());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * @hide
     * Sound dose warning at every 100% of dose during integration window
     */
    public static final int CSD_WARNING_DOSE_REACHED_1X = 1;
    /**
     * @hide
     * Sound dose warning when 500% of dose is reached during integration window
     */
    public static final int CSD_WARNING_DOSE_REPEATED_5X = 2;
    /**
     * @hide
     * Sound dose warning after a momentary exposure event
     */
    public static final int CSD_WARNING_MOMENTARY_EXPOSURE = 3;
    /**
     * @hide
     * Sound dose warning at every 100% of dose during integration window
     */
    public static final int CSD_WARNING_ACCUMULATION_START = 4;

    /** @hide */
    @IntDef(flag = false, value = {
            CSD_WARNING_DOSE_REACHED_1X,
            CSD_WARNING_DOSE_REPEATED_5X,
            CSD_WARNING_MOMENTARY_EXPOSURE,
            CSD_WARNING_ACCUMULATION_START }
    )
    @Retention(RetentionPolicy.SOURCE)
    public @interface CsdWarning {}

    /**
     * Only useful for volume controllers.
     * @hide
+2 −0
Original line number Diff line number Diff line
@@ -261,6 +261,8 @@ interface IAudioService {

    void disableSafeMediaVolume(String callingPackage);

    void lowerVolumeToRs1(String callingPackage);

    int setHdmiSystemAudioSupported(boolean on);

    boolean isHdmiSystemAudioSupported();
Loading