diff options
| author | 2014-04-29 16:31:13 -0400 | |
|---|---|---|
| committer | 2014-04-29 16:31:13 -0400 | |
| commit | dbb22bcd3f7ccdeb48f5b9e71d089d1f911db1d7 (patch) | |
| tree | 2353272794e911c6472c7b69bee2dea62817c6b5 | |
| parent | 1de6b101e5a6e5c539cca5d9d044f1a28094fae4 (diff) | |
Subscribe to default zen mode condition.
Otherwise re-opening the current QS panel does not force an unsubscribe
(if a non-default condition was subscribed).
Change-Id: I1ec2519cc051d435c2ebbe8cea4a9b54f256820d
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java index a5e016aca97a..1bc97a075ab7 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/ZenModeViewAdapter.java @@ -92,6 +92,7 @@ public abstract class ZenModeViewAdapter implements ZenModeView.Adapter { mExitIndex = 0; dispatchChanged(); } + setZenModeCondition(); } @Override @@ -143,7 +144,15 @@ public abstract class ZenModeViewAdapter implements ZenModeView.Adapter { } mExitIndex = i; dispatchChanged(); - final Uri conditionUri = (Uri) ec.tag; + setZenModeCondition(); + } + + private void setZenModeCondition() { + if (mExitIndex < 0 || mExitIndex >= mExits.size()) { + Log.w(TAG, "setZenModeCondition to bad index " + mExitIndex + " of " + mExits.size()); + return; + } + final Uri conditionUri = (Uri) mExits.get(mExitIndex).tag; try { mNoMan.setZenModeCondition(conditionUri); } catch (RemoteException e) { |