(String SDCardUUID, CallbackContext callback)
| 313 | } |
| 314 | |
| 315 | public void getStorageAccess(String SDCardUUID, CallbackContext callback) { |
| 316 | Intent intent = null; |
| 317 | |
| 318 | if (SDK_INT >= 24) { |
| 319 | StorageVolume sdCard = null; |
| 320 | |
| 321 | for (StorageVolume volume : this.storageManager.getStorageVolumes()) { |
| 322 | String uuid = volume.getUuid(); |
| 323 | if (uuid != null && uuid.equals(SDCardUUID)) { |
| 324 | sdCard = volume; |
| 325 | } |
| 326 | } |
| 327 | |
| 328 | if (sdCard != null) { |
| 329 | if (SDK_INT < 29) { |
| 330 | intent = sdCard.createAccessIntent(null); |
| 331 | } else if (SDK_INT >= 29) { |
| 332 | intent = sdCard.createOpenDocumentTreeIntent(); |
| 333 | } |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | if (intent == null) { |
| 338 | REQUEST_CODE = DOCUMENT_TREE; |
| 339 | intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); |
| 340 | } |
| 341 | |
| 342 | activityResultCallback = callback; |
| 343 | cordova.startActivityForResult(this, intent, REQUEST_CODE); |
| 344 | } |
| 345 | |
| 346 | public void onActivityResult(int requestCode, int resultCode, Intent data) { |
| 347 | super.onActivityResult(requestCode, resultCode, data); |
no test coverage detected