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

Commit db380fa9 authored by Geoffrey Pitsch's avatar Geoffrey Pitsch
Browse files

DO NOT MERGE Fix Notification Settings when unblockable app is blocked.

When an app was blocked in the past, don't hide the controls
so the user is able to unblock the app.  After unblocking, the
controls will be hidden the next time settings is visited.

Bug:32557897
Change-Id: I7ab17f647b197162932b131c41bb18cf5c18917d
parent 94dee56f
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -176,10 +176,11 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
            });
        } else {
            setVisible(mImportance, false);
            if (notBlockable) {
            // Hide controls that are not settable, unless they are already switched on.
            final boolean blocked = (importance == Ranking.IMPORTANCE_NONE || banned);
            if (notBlockable && !blocked) {
                setVisible(mBlock, false);
            } else {
                boolean blocked = importance == Ranking.IMPORTANCE_NONE || banned;
                mBlock.setChecked(blocked);
                mBlock.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
                    @Override
@@ -193,10 +194,11 @@ abstract public class NotificationSettingsBase extends SettingsPreferenceFragmen
                    }
                });
            }
            if (notSilenceable) {
            final boolean silenced = (importance == Ranking.IMPORTANCE_LOW);
            if (notSilenceable && !silenced) {
                setVisible(mSilent, false);
            } else {
                mSilent.setChecked(importance == Ranking.IMPORTANCE_LOW);
                mSilent.setChecked(silenced);
                mSilent.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
                    @Override
                    public boolean onPreferenceChange(Preference preference, Object newValue) {