diff options
author | Winson Chung <winsonc@google.com> | 2014-09-18 22:45:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-18 22:45:26 +0000 |
commit | 3133616d92ec07313129f2a9e2712e9a7f1d72fb (patch) | |
tree | e2cfcd4faa55d5eb650d31a21571397c4decaa5c /packages/SystemUI/src/com/android/systemui/recents | |
parent | 28c5d8e862fba637d120203c3d4564486ef3f812 (diff) | |
parent | 905950abd017b5a135e26179b5ba29378732cf5a (diff) | |
download | frameworks_base-3133616d92ec07313129f2a9e2712e9a7f1d72fb.zip frameworks_base-3133616d92ec07313129f2a9e2712e9a7f1d72fb.tar.gz frameworks_base-3133616d92ec07313129f2a9e2712e9a7f1d72fb.tar.bz2 |
Merge "Listening for widget changes while Recents is in the background. (Bug 17153663)" into lmp-dev
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/recents')
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java index 8f92027..15c5e1b 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsActivity.java @@ -405,6 +405,22 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView mConfig.updateOnConfigurationChange(); onConfigurationChange(); } + + // Start listening for widget package changes if there is one bound, post it since we don't + // want it stalling the startup + if (mConfig.searchBarAppWidgetId >= 0) { + final WeakReference<RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks> callback = + new WeakReference<RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks>(this); + mRecentsView.post(new Runnable() { + @Override + public void run() { + RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks cb = callback.get(); + if (cb != null) { + mAppWidgetHost.startListening(cb); + } + } + }); + } } /** Inflates the debug overlay if debug mode is enabled. */ @@ -464,22 +480,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView protected void onResume() { super.onResume(); - // Start listening for widget package changes if there is one bound, post it since we don't - // want it stalling the startup - if (mConfig.searchBarAppWidgetId >= 0) { - final WeakReference<RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks> callback = - new WeakReference<RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks>(this); - mRecentsView.postDelayed(new Runnable() { - @Override - public void run() { - RecentsAppWidgetHost.RecentsAppWidgetHostCallbacks cb = callback.get(); - if (cb != null) { - mAppWidgetHost.startListening(cb); - } - } - }, 1); - } - // Mark Recents as visible mVisible = true; } @@ -496,11 +496,6 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView // Unregister any broadcast receivers for the task loader RecentsTaskLoader.getInstance().unregisterReceivers(); - - // Stop listening for widget package changes if there was one bound - if (mAppWidgetHost.isListening()) { - mAppWidgetHost.stopListening(); - } } @Override @@ -509,6 +504,11 @@ public class RecentsActivity extends Activity implements RecentsView.RecentsView // Unregister the system broadcast receivers unregisterReceiver(mSystemBroadcastReceiver); + + // Stop listening for widget package changes if there was one bound + if (mAppWidgetHost.isListening()) { + mAppWidgetHost.stopListening(); + } } @Override |