File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
android/src/main/java/com/rnfs Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -866,11 +866,16 @@ public void pathForGroup(String bundleNamed, Promise promise) {
866
866
public void getFSInfo (Promise promise ) {
867
867
File path = Environment .getDataDirectory ();
868
868
StatFs stat = new StatFs (path .getPath ());
869
+ StatFs statEx = new StatFs (Environment .getExternalStorageDirectory ().getPath ());
869
870
long totalSpace ;
870
871
long freeSpace ;
872
+ long totalSpaceEx = 0 ;
873
+ long freeSpaceEx = 0 ;
871
874
if (android .os .Build .VERSION .SDK_INT >= 18 ) {
872
875
totalSpace = stat .getTotalBytes ();
873
876
freeSpace = stat .getFreeBytes ();
877
+ totalSpaceEx = statEx .getTotalBytes ();
878
+ freeSpaceEx = statEx .getFreeBytes ();
874
879
} else {
875
880
long blockSize = stat .getBlockSize ();
876
881
totalSpace = blockSize * stat .getBlockCount ();
@@ -879,6 +884,8 @@ public void getFSInfo(Promise promise) {
879
884
WritableMap info = Arguments .createMap ();
880
885
info .putDouble ("totalSpace" , (double ) totalSpace ); // Int32 too small, must use Double
881
886
info .putDouble ("freeSpace" , (double ) freeSpace );
887
+ info .putDouble ("totalSpaceEx" , (double ) totalSpaceEx );
888
+ info .putDouble ("freeSpaceEx" , (double ) freeSpaceEx );
882
889
promise .resolve (info );
883
890
}
884
891
You can’t perform that action at this time.
0 commit comments