This is an automated email from the ASF dual-hosted git repository.

normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new a62f6993 fix!: Make CoreAndroid plugin instantiate on load (#1605)
a62f6993 is described below

commit a62f699380c19dee1f831f7ebee190ea6df766ed
Author: Norman Breau <nor...@nbsolutions.ca>
AuthorDate: Fri Apr 21 16:00:11 2023 -0300

    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.
---
 framework/src/org/apache/cordova/CordovaWebViewImpl.java |  2 +-
 framework/src/org/apache/cordova/PluginManager.java      | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

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);
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to