Merge "Disconnect plugins on the main thread." into rvc-dev
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginInstanceManager.java b/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginInstanceManager.java
index b8997c2..ed9c98b 100644
--- a/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginInstanceManager.java
+++ b/packages/SystemUI/shared/src/com/android/systemui/shared/plugins/PluginInstanceManager.java
@@ -257,12 +257,8 @@
if (DEBUG) Log.d(TAG, "queryAll " + mAction);
for (int i = mPlugins.size() - 1; i >= 0; i--) {
PluginInfo<T> plugin = mPlugins.get(i);
- mListener.onPluginDisconnected(plugin.mPlugin);
- if (!(plugin.mPlugin instanceof PluginFragment)) {
- // Only call onDestroy for plugins that aren't fragments, as fragments
- // will get the onDestroy as part of the fragment lifecycle.
- plugin.mPlugin.onDestroy();
- }
+ mMainHandler.obtainMessage(
+ mMainHandler.PLUGIN_DISCONNECTED, plugin).sendToTarget();
}
mPlugins.clear();
handleQueryPlugins(null);