Merge "Random hacks to make QS DND work" into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
28355df745
@@ -57,7 +57,6 @@ import com.android.internal.logging.MetricsLogger;
|
|||||||
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
import com.android.internal.logging.nano.MetricsProto.MetricsEvent;
|
||||||
import com.android.systemui.Prefs;
|
import com.android.systemui.Prefs;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.R.string;
|
|
||||||
import com.android.systemui.statusbar.policy.ZenModeController;
|
import com.android.systemui.statusbar.policy.ZenModeController;
|
||||||
|
|
||||||
import java.io.FileDescriptor;
|
import java.io.FileDescriptor;
|
||||||
@@ -294,11 +293,6 @@ public class ZenModePanel extends FrameLayout {
|
|||||||
private void onAttach() {
|
private void onAttach() {
|
||||||
setExpanded(true);
|
setExpanded(true);
|
||||||
mAttached = 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();
|
mAttachedZen = mController.getZen();
|
||||||
ZenRule manualRule = mController.getManualRule();
|
ZenRule manualRule = mController.getManualRule();
|
||||||
mExitCondition = manualRule != null ? manualRule.condition : null;
|
mExitCondition = manualRule != null ? manualRule.condition : null;
|
||||||
@@ -311,6 +305,7 @@ public class ZenModePanel extends FrameLayout {
|
|||||||
setSessionExitCondition(copy(mExitCondition));
|
setSessionExitCondition(copy(mExitCondition));
|
||||||
updateWidgets();
|
updateWidgets();
|
||||||
setRequestingConditions(!mHidden);
|
setRequestingConditions(!mHidden);
|
||||||
|
ensureSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onDetach() {
|
private void onDetach() {
|
||||||
@@ -366,9 +361,6 @@ public class ZenModePanel extends FrameLayout {
|
|||||||
if (expanded == mExpanded) return;
|
if (expanded == mExpanded) return;
|
||||||
if (DEBUG) Log.d(mTag, "setExpanded " + expanded);
|
if (DEBUG) Log.d(mTag, "setExpanded " + expanded);
|
||||||
mExpanded = expanded;
|
mExpanded = expanded;
|
||||||
if (mExpanded) {
|
|
||||||
ensureSelection();
|
|
||||||
}
|
|
||||||
updateWidgets();
|
updateWidgets();
|
||||||
fireExpanded();
|
fireExpanded();
|
||||||
}
|
}
|
||||||
@@ -464,7 +456,8 @@ public class ZenModePanel extends FrameLayout {
|
|||||||
ActivityManager.getCurrentUser(), false);
|
ActivityManager.getCurrentUser(), false);
|
||||||
return c;
|
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) {
|
private void handleUpdateZen(int zen) {
|
||||||
@@ -491,6 +484,7 @@ public class ZenModePanel extends FrameLayout {
|
|||||||
final ConditionTag tag = getConditionTagAt(i);
|
final ConditionTag tag = getConditionTagAt(i);
|
||||||
if (tag != null && sameConditionId(tag.condition, mExitCondition)) {
|
if (tag != null && sameConditionId(tag.condition, mExitCondition)) {
|
||||||
bind(exitCondition, mZenRadioGroupContent.getChildAt(i), i);
|
bind(exitCondition, mZenRadioGroupContent.getChildAt(i), i);
|
||||||
|
tag.rb.setChecked(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -498,6 +492,7 @@ public class ZenModePanel extends FrameLayout {
|
|||||||
exitCondition.id)) {
|
exitCondition.id)) {
|
||||||
bind(exitCondition, mZenRadioGroupContent.getChildAt(COUNTDOWN_CONDITION_INDEX),
|
bind(exitCondition, mZenRadioGroupContent.getChildAt(COUNTDOWN_CONDITION_INDEX),
|
||||||
COUNTDOWN_CONDITION_INDEX);
|
COUNTDOWN_CONDITION_INDEX);
|
||||||
|
getConditionTagAt(COUNTDOWN_CONDITION_INDEX).rb.setChecked(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user