Skip to content

Commit

Permalink
Merge 80870a2 into 0506703
Browse files Browse the repository at this point in the history
  • Loading branch information
JiboStore authored Mar 5, 2021
2 parents 0506703 + 80870a2 commit 820bb47
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ public Map<String, Object> getConstants() {
constants.put(KEY_TEMP_DIRECTORY, context.getCacheDir().getAbsolutePath());
constants.put(KEY_CACHE_DIRECTORY, context.getCacheDir().getAbsolutePath());


File externalDirectory = context.getExternalFilesDir(null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
constants.put(KEY_DOCUMENT_DIRECTORY, context.getExternalFilesDir(null).getAbsolutePath());
if ( externalDirectory != null ) {
constants.put(KEY_DOCUMENT_DIRECTORY, externalDirectory.getAbsolutePath());
}
} else {
constants.put(KEY_DOCUMENT_DIRECTORY, context.getFilesDir().getAbsolutePath());
}
Expand All @@ -179,7 +181,6 @@ public Map<String, Object> getConstants() {
constants.put(KEY_EXT_STORAGE_DIRECTORY, externalStorageDirectory.getAbsolutePath());
}

File externalDirectory = context.getExternalFilesDir(null);
if (externalDirectory != null) {
constants.put(KEY_EXTERNAL_DIRECTORY, externalDirectory.getAbsolutePath());
}
Expand Down

0 comments on commit 820bb47

Please sign in to comment.