summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jason Monk <jmonk@google.com> 2016-08-30 16:33:48 -0400
committer Jason Monk <jmonk@google.com> 2016-08-30 20:37:04 +0000
commit34f6cbc288bfcd627cd6af4199123f7edc3e02c1 (patch)
treeadd5d35d32abf5712929cc17f7be51f9919a3621
parentaa8263d85dc672ba2867c47ac12e43aee68580e5 (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java1
2 files changed, 7 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java b/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
index 28da69c34e28..17ce0cb80eef 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java
@@ -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) {
diff --git a/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java b/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
index 8493cc671d3a..91a0eb095ff9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileServiceManager.java
@@ -95,6 +95,7 @@ public class TileServiceManager {
if (!TileLifecycleManager.isTileAdded(context, component)) {
TileLifecycleManager.setTileAdded(context, component, true);
mStateManager.onTileAdded();
+ mStateManager.flushMessagesAndUnbind();
}
}