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

Commit 56897c6b authored by Julia Reynolds's avatar Julia Reynolds Committed by android-build-merger
Browse files

Refresh the whole rule in zen listing screen

am: 78ef02eb

Change-Id: I60352b05ca01838882b31f0106108c5392bc3c50
parents a05cb731 78ef02eb
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