diff --git a/framework/src/org/apache/cordova/CordovaWebViewImpl.java b/framework/src/org/apache/cordova/CordovaWebViewImpl.java index 2b8a8f89..1a48f8b1 100644 --- a/framework/src/org/apache/cordova/CordovaWebViewImpl.java +++ b/framework/src/org/apache/cordova/CordovaWebViewImpl.java @@ -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(); } diff --git a/framework/src/org/apache/cordova/PluginManager.java b/framework/src/org/apache/cordova/PluginManager.java index 9531e8fa..7d9df723 100755 --- a/framework/src/org/apache/cordova/PluginManager.java +++ b/framework/src/org/apache/cordova/PluginManager.java @@ -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); }