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
This commit is contained in:
Jason Monk
2016-06-17 13:48:44 -04:00
parent 0c0df7943c
commit 968d2695ff
2 changed files with 1 additions and 2 deletions

View File

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

View File

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