Enforce setCurrentState calls are on main thread
These calls need to be done in main thread. Now that it's enforced by LifecycleRegistry, it should also be enforced here. Fixes: 162923566 Test: manual Change-Id: I569123ca240bec24f805ab87dfab25daf3545844
This commit is contained in:
@@ -451,15 +451,17 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
|
||||
if (listening) {
|
||||
if (mListeners.add(listener) && mListeners.size() == 1) {
|
||||
if (DEBUG) Log.d(TAG, "handleSetListening true");
|
||||
mLifecycle.setCurrentState(RESUMED);
|
||||
handleSetListening(listening);
|
||||
refreshState(); // Ensure we get at least one refresh after listening.
|
||||
mUiHandler.post(() -> {
|
||||
mLifecycle.setCurrentState(RESUMED);
|
||||
refreshState(); // Ensure we get at least one refresh after listening.
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (mListeners.remove(listener) && mListeners.size() == 0) {
|
||||
if (DEBUG) Log.d(TAG, "handleSetListening false");
|
||||
mLifecycle.setCurrentState(STARTED);
|
||||
handleSetListening(listening);
|
||||
mUiHandler.post(() -> mLifecycle.setCurrentState(STARTED));
|
||||
}
|
||||
}
|
||||
updateIsFullQs();
|
||||
|
||||
Reference in New Issue
Block a user