Fix QS CTS failure caused by tile backup
The CTS tests weren't receiving the onTileAdded callbacks since the shade was not in the listening state when tiles were added. This is not possible for users (since tiles are added while the UI is listening), but add a flushMessagesAndUnbind call to make sure the tiles always receive onTileAdded. Since now flushMessagesAndUnbind can be called before a real call to setBindService(true), add a clause that will clear out its immediate unbind state. Change-Id: Idd13c432a4af5741813da9a9b1b292a47fd9443b Fixes: 31147742
This commit is contained in:
@@ -129,6 +129,12 @@ public class TileLifecycleManager extends BroadcastReceiver implements
|
||||
}
|
||||
|
||||
public void setBindService(boolean bind) {
|
||||
if (mBound && mUnbindImmediate) {
|
||||
// If we are already bound and expecting to unbind, this means we should stay bound
|
||||
// because something else wants to hold the connection open.
|
||||
mUnbindImmediate = false;
|
||||
return;
|
||||
}
|
||||
mBound = bind;
|
||||
if (bind) {
|
||||
if (mBindTryCount == MAX_BIND_RETRIES) {
|
||||
|
||||
@@ -95,6 +95,7 @@ public class TileServiceManager {
|
||||
if (!TileLifecycleManager.isTileAdded(context, component)) {
|
||||
TileLifecycleManager.setTileAdded(context, component, true);
|
||||
mStateManager.onTileAdded();
|
||||
mStateManager.flushMessagesAndUnbind();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user