summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2013-10-23 13:50:44 -0700
committerMarco Nelissen <marcone@google.com>2013-10-23 13:50:44 -0700
commite2c8247857cd266650a237b26c74a19bda915ea8 (patch)
tree153ec17ba4a3c27c669f8f1c29f75236e61f9ee8 /src
parent221c0fe1c2ca07c62ef37954774a9f1817d2cfa5 (diff)
downloadandroid_packages_providers_MediaProvider-e2c8247857cd266650a237b26c74a19bda915ea8.tar.gz
android_packages_providers_MediaProvider-e2c8247857cd266650a237b26c74a19bda915ea8.tar.bz2
android_packages_providers_MediaProvider-e2c8247857cd266650a237b26c74a19bda915ea8.zip
Append separator to avoid common prefix match
We should match against "/storage/foo/" instead of "/storage/foo", in case there is a path that is a prefix of the other. Change-Id: If6cda18768039a130dfb81dd402ac4ce7b26a2a7
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/android/providers/media/MediaProvider.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/providers/media/MediaProvider.java b/src/com/android/providers/media/MediaProvider.java
index 8af0ac48..974b0dd6 100755
--- a/src/com/android/providers/media/MediaProvider.java
+++ b/src/com/android/providers/media/MediaProvider.java
@@ -131,9 +131,13 @@ public class MediaProvider extends ContentProvider {
static {
try {
- sExternalPath = Environment.getExternalStorageDirectory().getCanonicalPath();
- sCachePath = Environment.getDownloadCacheDirectory().getCanonicalPath();
- sLegacyPath = Environment.getLegacyExternalStorageDirectory().getCanonicalPath();
+ sExternalPath =
+ Environment.getExternalStorageDirectory().getCanonicalPath() + File.separator;
+ sCachePath =
+ Environment.getDownloadCacheDirectory().getCanonicalPath() + File.separator;
+ sLegacyPath =
+ Environment.getLegacyExternalStorageDirectory().getCanonicalPath()
+ + File.separator;
} catch (IOException e) {
throw new RuntimeException("Unable to resolve canonical paths", e);
}