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: direct getExternalSdCardDetails without permission request #501

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

ath0mas
Copy link

@ath0mas ath0mas commented Aug 24, 2023

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Documentation changes
  • Other... Please describe:

PR Checklist

For bug fixes / features, please check if your PR fulfills the following requirements:

  • Testing has been carried out for the changes have been added
  • Regression testing has been carried out for existing functionality
  • Docs have been added / updated

What is the purpose of this PR?

Listing the external SD cards is currently asking for permissions.
But the SDK 33 permission change made me look more into this, as asking for MEDIA related permissions seems strange.
This permission request has been removed as tests confirm that all SD cards are correctly fetched without them in various Android versions.

Does this PR introduce a breaking change?

  • Yes
  • No

What testing has been done on the changes in the PR?

What testing has been done on existing functionality?

Built a testApp with targetSDK 33, installed on emulators API 28, 29, 30, 32, and 33,
Then I checked the SD cards listing is returning correct values, no error, and without asking for any permission.

Other information

Tests done in the context of apache/cordova-plugin-file#597.

@penguin86
Copy link

This should really be merged. The current release (7.1.4) fails with this error:

Exception occurred: Permission READ_EXTERNAL_STORAGE not supported for build SDK version 33

in _getPermissionsAuthorizationStatus() due to the READ_EXTERNAL_STORAGE permission being removed from Android 13 (API 33).
Using this version, instead, works flawlessly.

@dpa99c dpa99c merged commit a6ff7ea into dpa99c:master Nov 10, 2023
@ath0mas ath0mas deleted the external-sdcards-no-permission branch November 10, 2023 15:58
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.

3 participants