aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/android
diff options
context:
space:
mode:
authorEugene Sandulenko2019-09-25 20:56:27 +0200
committerEugene Sandulenko2019-09-27 00:22:20 +0200
commit4e5f26b44e9ef369641dd0825f17287b8cce8b08 (patch)
treedd55ce4e7c8fe09a9f45f48a816ff94dc73722c5 /backends/platform/android
parentbc1c4b3ec1893a25cb5f9e52185a19c9b330366e (diff)
downloadscummvm-rg350-4e5f26b44e9ef369641dd0825f17287b8cce8b08.tar.gz
scummvm-rg350-4e5f26b44e9ef369641dd0825f17287b8cce8b08.tar.bz2
scummvm-rg350-4e5f26b44e9ef369641dd0825f17287b8cce8b08.zip
ANDROID: Turn map into spliced list for easier marshalling
Diffstat (limited to 'backends/platform/android')
-rw-r--r--backends/platform/android/org/scummvm/scummvm/ExternalStorage.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java b/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
index 42ec185928..234fba9bff 100644
--- a/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
+++ b/backends/platform/android/org/scummvm/scummvm/ExternalStorage.java
@@ -3,9 +3,7 @@ package org.scummvm.scummvm;
import android.os.Environment;
import java.io.File;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.Scanner;
/**
@@ -44,10 +42,10 @@ public class ExternalStorage {
}
/**
- * @return A map of all storage locations available
+ * @return list of locations available. Odd elements are names, even are paths
*/
- public static Map<String, String> getAllStorageLocations() {
- Map<String, String> map = new HashMap<String, String>(10);
+ public static List<String> getAllStorageLocations() {
+ List<String> map = new ArrayList<String>(20);
List<String> mMounts = new ArrayList<String>(10);
List<String> mVold = new ArrayList<String>(10);
@@ -118,24 +116,27 @@ public class ExternalStorage {
}
hash += "]";
if (!mountHash.contains(hash)){
- String key = SD_CARD + "_" + map.size();
+ String key = SD_CARD + "_" + (map.size() / 2);
if (map.size() == 0) {
key = SD_CARD;
- } else if (map.size() == 1) {
+ } else if (map.size() == 2) {
key = EXTERNAL_SD_CARD;
}
mountHash.add(hash);
- map.put(key, root.getAbsolutePath());
+ map.add(key);
+ map.add(root.getAbsolutePath());
}
}
}
mMounts.clear();
- map.put(SD_CARD, Environment.getDataDirectory().getAbsolutePath());
+ map.add(DATA_DIRECTORY);
+ map.add(Environment.getDataDirectory().getAbsolutePath());
if (map.isEmpty()) {
- map.put(DATA_DIRECTORY, Environment.getExternalStorageDirectory().getAbsolutePath());
+ map.add(SD_CARD);
+ map.add(Environment.getExternalStorageDirectory().getAbsolutePath());
}
return map;
}