dpa99c / cordova-diagnostic-plugin

Cordova/Phonegap plugin to manage device settings
540 stars 361 forks source link

Error listing external SD cards without prior READ storage permission #427

Closed ath0mas closed 3 years ago

ath0mas commented 3 years ago

Bug report

CHECKLIST

Current behavior:

getExternalSdCardDetails before going on with internal logic first checks READ_EXTERNAL_STORAGE permission and if not set calls requestRuntimePermission for it ; but with following error:

Diagnostic[native]: Exception occurred onRequestPermissionsResult: No context found for request id=1000

Expected behavior: Android code for listing SD cards should run without error whether or not the READ storage permission was set before or not.

Steps to reproduce:

Default setup of cordova-diagnostic-plugin-example and then from js or chrome://inspect call cordova.plugins.diagnostic.getExternalSdCardDetails(console.info, console.error).

Screenshots

Environment information

Runtime issue

Android build issue:

iOS build issue:

Related code:

cordova.plugins.diagnostic.getExternalSdCardDetails(console.info, console.error)

Console output

console output ``` Diagnostic[native]: Exception occurred onRequestPermissionsResult: No context found for request id=1000 ```


**Other information:**
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.