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

Commit 6691517d authored by Beverly's avatar Beverly Committed by android-build-merger
Browse files

Charging sounds won't play when dnd is on

am: a4539c5c

Change-Id: Idc892e33a9a905bd0da7a551ef39334d92910382
parents 0ed5d652 a4539c5c
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);