Merge "Disconnect plugins on the main thread." into rvc-dev am: bb4a7486de am: 5b07edb0f3

Change-Id: I020dd86b6b8f89d686b6346908892a7cbbd0f03e
This commit is contained in:
TreeHugger Robot
2020-04-27 22:24:01 +00:00
committed by Automerger Merge Worker

View File

@@ -257,12 +257,8 @@ public class PluginInstanceManager<T extends Plugin> {
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);