mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
Tweak PluginManager.setPluginEntries()
to create startup plugins when called post init()
This commit is contained in:
parent
e1828696f7
commit
f764448ccc
@ -44,6 +44,7 @@ public class PluginManager {
|
||||
|
||||
private final CordovaInterface ctx;
|
||||
private final CordovaWebView app;
|
||||
private boolean isInitialized;
|
||||
|
||||
public PluginManager(CordovaWebView cordovaWebView, CordovaInterface cordova, Collection<PluginEntry> pluginEntries) {
|
||||
this.ctx = cordova;
|
||||
@ -56,13 +57,18 @@ public class PluginManager {
|
||||
}
|
||||
|
||||
public void setPluginEntries(Collection<PluginEntry> pluginEntries) {
|
||||
this.onPause(false);
|
||||
this.onDestroy();
|
||||
pluginMap.clear();
|
||||
entryMap.clear();
|
||||
if (isInitialized) {
|
||||
this.onPause(false);
|
||||
this.onDestroy();
|
||||
pluginMap.clear();
|
||||
entryMap.clear();
|
||||
}
|
||||
for (PluginEntry entry : pluginEntries) {
|
||||
addService(entry);
|
||||
}
|
||||
if (isInitialized) {
|
||||
startupPlugins();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -70,6 +76,7 @@ public class PluginManager {
|
||||
*/
|
||||
public void init() {
|
||||
LOG.d(TAG, "init()");
|
||||
isInitialized = true;
|
||||
this.onPause(false);
|
||||
this.onDestroy();
|
||||
pluginMap.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user