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

Commit a4539c5c authored by Beverly's avatar Beverly
Browse files

Charging sounds won't play when dnd is on

Test: atest frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java
Bug: 74441602
Change-Id: I74e803e7fda15d6cae9dd9247261c374cb2ece8d
parent 71120e1b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -720,9 +720,12 @@ final class Notifier {
    private void playChargingStartedSound() {
        final boolean enabled = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.CHARGING_SOUNDS_ENABLED, 1) != 0;
        final boolean dndOff = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS)
                == Settings.Global.ZEN_MODE_OFF;
        final String soundPath = Settings.Global.getString(mContext.getContentResolver(),
                Settings.Global.CHARGING_STARTED_SOUND);
        if (enabled && soundPath != null) {
        if (enabled && dndOff && soundPath != null) {
            final Uri soundUri = Uri.parse("file://" + soundPath);
            if (soundUri != null) {
                final Ringtone sfx = RingtoneManager.getRingtone(mContext, soundUri);