From b5ece9a9d6add01b7a0c392372ff8ba061fcb7e7 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Fri, 22 Apr 2016 11:40:36 -0400 Subject: [PATCH] Start listening on notifications/QS panels on expansion started Now that there are QS tiles in the header, they need to be in the listening state as soon as the expansion starts so they can be up to date by the time the user sees them. Change-Id: I80550d2885bd86afce3ea1595d441e65298d4d7c Fixes: 30041004 --- .../src/com/android/systemui/qs/QSContainer.java | 4 ++++ .../SystemUI/src/com/android/systemui/qs/QSPanel.java | 10 ++++++---- .../statusbar/phone/NotificationPanelView.java | 3 +++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSContainer.java b/packages/SystemUI/src/com/android/systemui/qs/QSContainer.java index d5fb8f2496982..9576fa51eb9a8 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSContainer.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSContainer.java @@ -235,6 +235,10 @@ public class QSContainer extends FrameLayout { mQSPanel.setListening(mListening && mQsExpanded); } + public void setHeaderListening(boolean listening) { + mHeader.setListening(listening); + } + public void setQsExpansion(float expansion, float headerTranslation) { if (DEBUG) Log.d(TAG, "setQSExpansion " + expansion + " " + headerTranslation); mQsExpansion = expansion; diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java index ad5c9c038f2f4..5fa0f53700902 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java @@ -245,10 +245,12 @@ public class QSPanel extends LinearLayout implements Tunable, Callback { if (mListening) { refreshAllTiles(); } - if (listening) { - mBrightnessController.registerCallbacks(); - } else { - mBrightnessController.unregisterCallbacks(); + if (mBrightnessView.getVisibility() == View.VISIBLE) { + if (listening) { + mBrightnessController.registerCallbacks(); + } else { + mBrightnessController.unregisterCallbacks(); + } } } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 64f205d2d8f8f..3b67c593a396d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1612,6 +1612,9 @@ public class NotificationPanelView extends PanelView implements if (mQsExpanded) { onQsExpansionStarted(); } + // Since there are QS tiles in the header now, we need to make sure we start listening + // immediately so they can be up to date. + mQsContainer.setHeaderListening(true); } @Override