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

Commit 19bbcfff authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Only play in-call notification if ringer is normal"

parents aefe326d 28c3d164
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -6028,6 +6028,15 @@ public final class Settings {
        private static final Validator MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR =
                NON_NEGATIVE_INTEGER_VALIDATOR;
        /**
         * Whether the in call notification is enabled to play sound during calls.  The value is
         * boolean (1 or 0).
         * @hide
         */
        public static final String IN_CALL_NOTIFICATION_ENABLED = "in_call_notification_enabled";
        private static final Validator IN_CALL_NOTIFICATION_ENABLED_VALIDATOR = BOOLEAN_VALIDATOR;
        /**
         * Uri of the slice that's presented on the keyguard.
         * Defaults to a slice with the date and next alarm.
@@ -8048,6 +8057,7 @@ public final class Settings {
            VOLUME_HUSH_GESTURE,
            MANUAL_RINGER_TOGGLE_COUNT,
            HUSH_GESTURE_USED,
            IN_CALL_NOTIFICATION_ENABLED,
        };
        /**
@@ -8193,6 +8203,7 @@ public final class Settings {
                    ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES_VALIDATOR); //legacy restore setting
            VALIDATORS.put(HUSH_GESTURE_USED, HUSH_GESTURE_USED_VALIDATOR);
            VALIDATORS.put(MANUAL_RINGER_TOGGLE_COUNT, MANUAL_RINGER_TOGGLE_COUNT_VALIDATOR);
            VALIDATORS.put(IN_CALL_NOTIFICATION_ENABLED, IN_CALL_NOTIFICATION_ENABLED_VALIDATOR);
        }
        /**
+22 −18
Original line number Diff line number Diff line
@@ -4979,6 +4979,9 @@ public class NotificationManagerService extends SystemService {
    }

    protected void playInCallNotification() {
        if (mAudioManager.getRingerModeInternal() == AudioManager.RINGER_MODE_NORMAL
                && Settings.Secure.getInt(getContext().getContentResolver(),
                Settings.Secure.IN_CALL_NOTIFICATION_ENABLED, 1) != 0) {
            new Thread() {
                @Override
                public void run() {
@@ -5001,6 +5004,7 @@ public class NotificationManagerService extends SystemService {
                }
            }.start();
        }
    }

    @GuardedBy("mToastQueue")
    void showNextToastLocked() {