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

Commit 18d823cb authored by kaiyiz's avatar kaiyiz Committed by Steve Kondik
Browse files

SystemUI: Set zen mode to no interruptions if silent mode is set

When setting ringer mode to silent and current zen mode is off, zen
mode will become priority interruptions mode. As a result, ringer mode
is set to normal mode in updateZenMode.

Set zen mode to no interruptions when ringer mode is set to silent.

CRs-Fixed: 744813

Change-Id: Id104e5473d0e8d624b06dfc9e5dbd8d9f7627b6e
parent b30569b0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2087,6 +2087,9 @@
        <item>Trying to turn on mobile data</item>
    </string-array>

    <!-- Configuartion to set zen mode when silent mode is on -->
    <bool name="config_setZenModeWhenSilentModeOn">false</bool>

    <!-- Configuartion to support ESN Tracker -->
    <bool name="config_telephony_ESN_Tracker_enabled">false</bool>

+1 −0
Original line number Diff line number Diff line
@@ -1622,6 +1622,7 @@
  <java-symbol type="bool" name="config_wifi_background_scan_support" />
  <java-symbol type="bool" name="config_wifi_dual_band_support" />
  <java-symbol type="bool" name="config_wimaxEnabled" />
  <java-symbol type="bool" name="config_setZenModeWhenSilentModeOn" />
  <java-symbol type="bool" name="show_ongoing_ime_switcher" />
  <java-symbol type="color" name="config_defaultNotificationColor" />
  <java-symbol type="color" name="input_method_navigation_guard" />
+4 −1
Original line number Diff line number Diff line
@@ -309,8 +309,11 @@ public class ZenModeHelper {
            final int ringerMode = mAudioManager.getRingerMode();
            int newZen = -1;
            if (ringerMode == AudioManager.RINGER_MODE_SILENT) {
                if (mZenMode == Global.ZEN_MODE_OFF) {
                if (mZenMode == Global.ZEN_MODE_OFF && !mContext.getResources().getBoolean(
                        com.android.internal.R.bool.config_setZenModeWhenSilentModeOn)) {
                    newZen = Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS;
                } else if (mZenMode != Global.ZEN_MODE_NO_INTERRUPTIONS) {
                    newZen = Global.ZEN_MODE_NO_INTERRUPTIONS;
                }
            } else if ((ringerMode == AudioManager.RINGER_MODE_NORMAL
                    || ringerMode == AudioManager.RINGER_MODE_VIBRATE)