summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jason Monk <jmonk@google.com> 2016-06-17 13:48:44 -0400
committer Jason Monk <jmonk@google.com> 2016-06-17 13:48:44 -0400
commit968d2695ff4a10fb2229eb3a5c21840c9efd0940 (patch)
treefc9724e483ff231d7d1487cf09036a6ffb5e5793
parent0c0df7943ce2cf463917fa5a72d08ebf6a5336b4 (diff)
QS: Fix missing tiles
It was possible for the state to be updated in the background but before the callback was actually registered and never propagate to the UI. Call the callback directly after it is added (from the QS thread) to ensure that the current state gets sent out on tiles being added. Change-Id: Idd76dce5cbc9dc9c99f9b3dc13998751fd170582 Fixes: 29419435
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java1
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSTile.java2
2 files changed, 1 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index effefb0d9d2b..636a9a5079a5 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -360,7 +360,6 @@ public class QSPanel extends LinearLayout implements Tunable, Callback {
}
};
r.tileView.init(click, longClick);
- callback.onStateChanged(r.tile.getState());
r.tile.refreshState();
mRecords.add(r);
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
index 974de0804f64..8a7a7fb7273e 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSTile.java
@@ -225,7 +225,7 @@ public abstract class QSTile<TState extends State> {
private void handleAddCallback(Callback callback) {
mCallbacks.add(callback);
- handleRefreshState(null);
+ callback.onStateChanged(mState);
}
private void handleRemoveCallback(Callback callback) {