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
This commit is contained in:
Jason Monk
2016-04-22 11:40:36 -04:00
parent 66e7752ad1
commit b5ece9a9d6
3 changed files with 13 additions and 4 deletions

View File

@@ -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;

View File

@@ -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();
}
}
}

View File

@@ -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