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

feat: overload PluginEntry constructor to set onload property #1166

Merged
merged 2 commits into from
Apr 18, 2021

Conversation

jblejder
Copy link
Contributor

@jblejder jblejder commented Feb 18, 2021

Platforms affected

Android

Motivation and Context

resolves #1164
This will allow to specify already instantiated PluginEntries with onload = false.
Which will stop Cordova from initialising them multiple time and fix issue on AGP 4.1.2 that enables all asserts in debug

Is setting onLoad false valid option here?

Testing

have a look at test exposing issue:
jblejder#1

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change
  • Commit is prefixed with (platform) if this change only applies to one platform (e.g. (android))
  • If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct keyword to close issues using keywords)
  • I've updated the documentation if necessary

@jblejder jblejder changed the title (android) Add PluginEntry constructor that allows to specify onload Add PluginEntry constructor that allows to specify onload Feb 18, 2021
@erisu erisu changed the title Add PluginEntry constructor that allows to specify onload feat: overload PluginEntry constructor to set onload property Mar 28, 2021
@@ -52,6 +52,10 @@ public PluginEntry(String service, CordovaPlugin plugin) {
this(service, plugin.getClass().getName(), true, plugin);
}

public PluginEntry(String service, CordovaPlugin plugin, boolean onload) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a JavaDoc comment for this overload? Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jblejder would you be able to add in the JavaDoc comment?

You can use the below public PluginEntry overloaded method's comment block as an example for your overloaded method.

After this PR is updated, I can merge it in for next release.

@erisu erisu added this to the 10.0.0 milestone Apr 13, 2021
@erisu erisu requested a review from timbru31 April 18, 2021 22:43
@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2021

Codecov Report

❗ No coverage uploaded for pull request base (master@3081e5e). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1166   +/-   ##
=========================================
  Coverage          ?   71.97%           
=========================================
  Files             ?       21           
  Lines             ?     1695           
  Branches          ?        0           
=========================================
  Hits              ?     1220           
  Misses            ?      475           
  Partials          ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3081e5e...0a2a590. Read the comment docs.

@erisu erisu merged commit b2d9d63 into apache:master Apr 18, 2021
wedgberto pushed a commit to wedgberto/cordova-android that referenced this pull request May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide PluginEntry with plugin instances causes assertion to crash app
4 participants