@@ -355,7 +355,11 @@ static Map<String, Object> getSystemfolders(ReactApplicationContext ctx) {
355
355
} else {
356
356
res .put ("SDCardApplicationDir" , "" );
357
357
}
358
+ } else {
359
+ res .put ("SDCardDir" , "" );
360
+ res .put ("SDCardApplicationDir" , "" );
358
361
}
362
+
359
363
res .put ("MainBundleDir" , ctx .getApplicationInfo ().dataDir );
360
364
361
365
// TODO Change me with the correct path
@@ -376,7 +380,20 @@ static Map<String, Object> getSystemfolders(ReactApplicationContext ctx) {
376
380
static Map <String , Object > getLegacySystemfolders (ReactApplicationContext ctx ) {
377
381
Map <String , Object > res = new HashMap <>();
378
382
379
- if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) return ReactNativeBlobUtilFS .getSystemfolders (ctx );
383
+ if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
384
+ res = ReactNativeBlobUtilFS .getSystemfolders (ctx );
385
+
386
+ // Include legacy folders anyway, since on the new arch compatibility between the spec and the turbomodule is enforced
387
+ res .put ("LegacyDCIMDir" , "" );
388
+ res .put ("LegacyPictureDir" , "" );
389
+ res .put ("LegacyMusicDir" , "" );
390
+ res .put ("LegacyDownloadDir" , "" );
391
+ res .put ("LegacyMovieDir" , "" );
392
+ res .put ("LegacyRingtoneDir" , "" );
393
+ res .put ("LegacySDCardDir" , "" );
394
+
395
+ return res ;
396
+ }
380
397
381
398
res .put ("LegacyDCIMDir" , Environment .getExternalStoragePublicDirectory (Environment .DIRECTORY_DCIM ).getAbsolutePath ());
382
399
res .put ("LegacyPictureDir" , Environment .getExternalStoragePublicDirectory (Environment .DIRECTORY_PICTURES ).getAbsolutePath ());
@@ -388,6 +405,8 @@ static Map<String, Object> getLegacySystemfolders(ReactApplicationContext ctx) {
388
405
String state = Environment .getExternalStorageState ();
389
406
if (state .equals (Environment .MEDIA_MOUNTED )) {
390
407
res .put ("LegacySDCardDir" , Environment .getExternalStorageDirectory ().getAbsolutePath ());
408
+ } else {
409
+ res .put ("LegacySDCardDir" , "" );
391
410
}
392
411
393
412
return res ;
0 commit comments