Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: Make CoreAndroid plugin instantiate on load #1605

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion framework/src/org/apache/cordova/CordovaWebViewImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public void init(CordovaInterface cordova, List<PluginEntry> pluginEntries, Cord
// 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();
}

Expand Down
13 changes: 12 additions & 1 deletion framework/src/org/apache/cordova/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,18 @@ public CordovaPlugin getPlugin(String service) {
* @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);
}

Expand Down