Skip to content

Commit

Permalink
Try another method for getting SD card storage paths (env vars).
Browse files Browse the repository at this point in the history
See #13827
  • Loading branch information
hrydgard committed Jan 8, 2021
1 parent 696e9ed commit 75be1e9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions android/src/org/ppsspp/ppsspp/NativeActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,18 @@ private static ArrayList<String> getSdCardPaths(final Context context) {
}
}

// TODO: On older devices, try System.getenv(“EXTERNAL_SDCARD_STORAGE”)
if (list == null) {
String[] varNames = { "EXTERNAL_SDCARD_STORAGE", "SECONDARY_STORAGE" };
for (String var : varNames) {
Log.i(TAG, "getSdCardPaths: Checking env " + var);
String secStore = System.getenv("SECONDARY_STORAGE");
if (secStore != null && secStore.length() > 0) {
list = new ArrayList<String>();
list.add(secStore);
break;
}
}
}

if (list == null) {
return new ArrayList<String>();
Expand All @@ -275,9 +286,6 @@ private static ArrayList<String> getSdCardPaths(final Context context) {
}
}

/**
* returns a list of all available sd cards paths, or null if not found.
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
private static ArrayList<String> getSdCardPaths19(final Context context)
{
Expand Down

0 comments on commit 75be1e9

Please sign in to comment.