forked from github/cordova-android
fix!: Make CoreAndroid plugin instantiate on load (#1605)
I don't anticipate breaking changes from this change, however it is a difference in behaviour since CoreAndroid won't be lazily loaded, therefore I've marked this commit has a breaking change.
This commit is contained in:
parent
7efe90faac
commit
a62f699380
@ -115,7 +115,7 @@ public class CordovaWebViewImpl implements CordovaWebView {
|
||||
// This isn't enforced by the compiler, so assert here.
|
||||
assert engine.getView() instanceof CordovaWebViewEngine.EngineView;
|
||||
|
||||
pluginManager.addService(CoreAndroid.PLUGIN_NAME, "org.apache.cordova.CoreAndroid");
|
||||
pluginManager.addService(CoreAndroid.PLUGIN_NAME, "org.apache.cordova.CoreAndroid", true);
|
||||
pluginManager.init();
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,18 @@ public class PluginManager {
|
||||
* @param className The plugin class name
|
||||
*/
|
||||
public void addService(String service, String className) {
|
||||
PluginEntry entry = new PluginEntry(service, className, false);
|
||||
addService(service, className, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a plugin class that implements a service to the service entry table.
|
||||
*
|
||||
* @param service The service name
|
||||
* @param className The plugin class name
|
||||
* @param onload If true, the plugin will be instantiated immediately
|
||||
*/
|
||||
public void addService(String service, String className, boolean onload) {
|
||||
PluginEntry entry = new PluginEntry(service, className, onload);
|
||||
this.addService(entry);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user