From 968d2695ff4a10fb2229eb3a5c21840c9efd0940 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Fri, 17 Jun 2016 13:48:44 -0400 Subject: [PATCH] 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 --- packages/SystemUI/src/com/android/systemui/qs/QSPanel.java | 1 - packages/SystemUI/src/com/android/systemui/qs/QSTile.java | 2 +- 2 files changed, 1 insertion(+), 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 effefb0d9d2b9..636a9a5079a54 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 974de0804f644..8a7a7fb7273eb 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 { private void handleAddCallback(Callback callback) { mCallbacks.add(callback); - handleRefreshState(null); + callback.onStateChanged(mState); } private void handleRemoveCallback(Callback callback) {