From 29c93ce05ddc999d85ca95a4e274666a0f99df5c Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Wed, 20 Apr 2016 11:41:36 -0400 Subject: [PATCH] QS tile lifecycle management Ensure we send out the current QSService and Tile to the TileService before we write to mWrapper allowing other commands to come through. Change-Id: Ia3f470083d97d85fa726b1add3706db6278c7d1e Fixes: 27871492 --- .../systemui/qs/external/TileLifecycleManager.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 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 5a26a4abd395f..590321889c36c 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java +++ b/packages/SystemUI/src/com/android/systemui/qs/external/TileLifecycleManager.java @@ -148,13 +148,20 @@ public class TileLifecycleManager extends BroadcastReceiver implements if (DEBUG) Log.d(TAG, "onServiceConnected " + name); // Got a connection, set the binding count to 0. mBindTryCount = 0; - mWrapper = new QSTileServiceWrapper(Stub.asInterface(service)); + final QSTileServiceWrapper wrapper = new QSTileServiceWrapper(Stub.asInterface(service)); try { service.linkToDeath(this, 0); } catch (RemoteException e) { } - setQSService(mService); - setQSTile(mTile); + if (!wrapper.setQSService(mService)) { + handleDeath(); + return; + } + if (!wrapper.setQSTile(mTile)) { + handleDeath(); + return; + } + mWrapper = wrapper; handlePendingMessages(); }