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

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

Merge "Random hacks to make QS DND work" into oc-dev

parents 7b64dbd5 2d77c0f0
Loading
Loading
Loading
Loading
+5 −10
Original line number Diff line number Diff line
@@ -57,7 +57,6 @@ import com.android.internal.logging.MetricsLogger;
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
import com.android.systemui.Prefs;
import com.android.systemui.R;
import com.android.systemui.R.string;
import com.android.systemui.statusbar.policy.ZenModeController;

import java.io.FileDescriptor;
@@ -294,11 +293,6 @@ public class ZenModePanel extends FrameLayout {
    private void onAttach() {
        setExpanded(true);
        mAttached = true;
        for (int i = 0; i < mZenRadioGroupContent.getChildCount(); i++) {
            ConditionTag tag = getConditionTagAt(i);
            if (tag != null) tag.rb.setChecked(false);
            mZenRadioGroupContent.getChildAt(i).setTag(null);
        }
        mAttachedZen = mController.getZen();
        ZenRule manualRule = mController.getManualRule();
        mExitCondition = manualRule != null ? manualRule.condition : null;
@@ -311,6 +305,7 @@ public class ZenModePanel extends FrameLayout {
        setSessionExitCondition(copy(mExitCondition));
        updateWidgets();
        setRequestingConditions(!mHidden);
        ensureSelection();
    }

    private void onDetach() {
@@ -366,9 +361,6 @@ public class ZenModePanel extends FrameLayout {
        if (expanded == mExpanded) return;
        if (DEBUG) Log.d(mTag, "setExpanded " + expanded);
        mExpanded = expanded;
        if (mExpanded) {
            ensureSelection();
        }
        updateWidgets();
        fireExpanded();
    }
@@ -464,7 +456,8 @@ public class ZenModePanel extends FrameLayout {
                    ActivityManager.getCurrentUser(), false);
            return c;
        }
        return null;
        // If there is a manual rule, but it has no condition listed then it is forever.
        return forever();
    }

    private void handleUpdateZen(int zen) {
@@ -491,6 +484,7 @@ public class ZenModePanel extends FrameLayout {
            final ConditionTag tag = getConditionTagAt(i);
            if (tag != null && sameConditionId(tag.condition, mExitCondition)) {
                bind(exitCondition, mZenRadioGroupContent.getChildAt(i), i);
                tag.rb.setChecked(true);
                return;
            }
        }
@@ -498,6 +492,7 @@ public class ZenModePanel extends FrameLayout {
                exitCondition.id)) {
            bind(exitCondition, mZenRadioGroupContent.getChildAt(COUNTDOWN_CONDITION_INDEX),
                    COUNTDOWN_CONDITION_INDEX);
            getConditionTagAt(COUNTDOWN_CONDITION_INDEX).rb.setChecked(true);
        }
    }