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

(android) fix: use provider prefix to avoid conflict with cordova-open plugin #510

Merged

Conversation

LoicEvenium
Copy link
Contributor

Platforms affected

cordova-android

Motivation and Context

Application crash when open the camera if cordova-plugin-open installed.
Providers of cordova-plugin-open and cordova-plugin-camera are in conflicts using the same android:authorities value. See the AndroidManifest:

    <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="org.apache.cordova.camera.FileProvider">
      <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/camera_provider_paths"/>
    </provider>
    <provider android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
      <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/>
    </provider>

Fix: #416

Description

Add "camera" in the android:authorities to void namespace conflict

Testing

Open camera, take a picture

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

@pseudooriginal
Copy link

Can this PR be merged please? It brakes the plugin on all Android devices.

Copy link
Contributor

@breautek breautek left a comment

Choose a reason for hiding this comment

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

Overall this looks good, just a few minor things I would change to avoid using general keywords that other libraries/plugins may also end up using.

plugin.xml Outdated Show resolved Hide resolved
src/android/CameraLauncher.java Outdated Show resolved Hide resolved
src/android/CameraLauncher.java Outdated Show resolved Hide resolved
@pseudooriginal
Copy link

Thank you for your speed 😊

Copy link
Contributor

@breautek breautek left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution, it looks good to me. I'd like to have at least one other positive vote by another PMC member before I merge.

@breautek breautek requested review from erisu and timbru31 June 17, 2020 18:06
plugin.xml Show resolved Hide resolved
@netzzeit
Copy link

netzzeit commented Jul 1, 2020

Is there any chance this change is being merged soon? :)

@timbru31
Copy link
Member

timbru31 commented Jul 1, 2020

There is still an open discussion. I'm not merging something that I'm not 100% sure of that it does not cause a breaking change - unless it's explicitly stated so.

Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

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

looks good to me

@jcesarmobile jcesarmobile merged commit eb7fc33 into apache:master Jul 16, 2020
DavidWiesner pushed a commit to DavidWiesner/cordova-plugin-camera that referenced this pull request Dec 7, 2021
…viders (apache#510)

Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>

(cherry picked from commit eb7fc33)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot take pictures on Android
6 participants