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

Commit 78ef02eb authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Refresh the whole rule in zen listing screen

Because the whole rule is pushed to NMS when it's
enabled/disabled.

Test: manual
Fixes: 135170330
Change-Id: I4bbc30f82dab07cff9184f9ab8a6f729499c6126
parent 0de0d5be
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public class ZenModeAutomaticRulesPreferenceController extends
            for (int i = 0; i < sortedRules.length; i++) {
                ZenRulePreference pref = (ZenRulePreference) mPreferenceCategory.getPreference(i);
                // we are either:
                // 1. updating the enabled state or name of the rule
                // 1. updating everything about the rule
                // 2. rule was added or deleted, so reload the entire list
                if (Objects.equals(pref.mId, sortedRules[i].getKey())) {
                    AutomaticZenRule rule = sortedRules[i].getValue();
+3 −3
Original line number Diff line number Diff line
@@ -49,7 +49,7 @@ public class ZenRulePreference extends TwoTargetPreference {
    final ZenServiceListing mServiceListing;
    final PackageManager mPm;
    final MetricsFeatureProvider mMetricsFeatureProvider;
    final AutomaticZenRule mRule;
    AutomaticZenRule mRule;
    CharSequence mName;

    private Intent mIntent;
@@ -122,14 +122,14 @@ public class ZenRulePreference extends TwoTargetPreference {
        if (!mRule.getName().equals(rule.getName())) {
            mName = rule.getName();
            setTitle(mName);
            mRule.setName(mName.toString());
        }

        if (mRule.isEnabled() != rule.isEnabled()) {
            mRule.setEnabled(rule.isEnabled());
            setChecked(mRule.isEnabled());
            setSummary(computeRuleSummary(mRule));
        }

        mRule = rule;
    }

    @Override