summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJessica Wagantall <jwagantall@cyngn.com>2016-04-04 16:09:05 -0700
committerJessica Wagantall <jwagantall@cyngn.com>2016-04-04 16:09:05 -0700
commit9387398458bd1c97b1c727d705293f8a4be2ee77 (patch)
treeaa582aed0c7f430737f7186597f5d3fdbc14a342
parentc1c8bb46f367dc559e5bb2d6e36cf75ff8863230 (diff)
parent5110b8a656b42f008aa225acd3b359a8b8b5dcec (diff)
downloadandroid_packages_providers_DownloadProvider-9387398458bd1c97b1c727d705293f8a4be2ee77.zip
android_packages_providers_DownloadProvider-9387398458bd1c97b1c727d705293f8a4be2ee77.tar.gz
android_packages_providers_DownloadProvider-9387398458bd1c97b1c727d705293f8a4be2ee77.tar.bz2
Merge tag 'android-5.1.1_r37' into HEAD
Ticket: CYNGNOS-2213 Android 5.1.1 release 37
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java10
-rw-r--r--src/com/android/providers/downloads/Helpers.java1
2 files changed, 8 insertions, 3 deletions
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index 4b23024..2d914c4 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -1230,9 +1230,15 @@ public final class DownloadProvider extends ContentProvider {
throw new FileNotFoundException("No filename found.");
}
- final File file = new File(path);
+ final File file;
+ try {
+ file = new File(path).getCanonicalFile();
+ } catch (IOException e) {
+ throw new FileNotFoundException(e.getMessage());
+ }
+
if (!Helpers.isFilenameValid(getContext(), file)) {
- throw new FileNotFoundException("Invalid file: " + file);
+ throw new FileNotFoundException("Invalid file path: " + file);
}
final int pfdMode = ParcelFileDescriptor.parseMode(mode);
diff --git a/src/com/android/providers/downloads/Helpers.java b/src/com/android/providers/downloads/Helpers.java
index 0aa49c0..1b4c911 100644
--- a/src/com/android/providers/downloads/Helpers.java
+++ b/src/com/android/providers/downloads/Helpers.java
@@ -341,7 +341,6 @@ public class Helpers {
static boolean isFilenameValid(Context context, File file) {
final File[] whitelist;
try {
- file = file.getCanonicalFile();
whitelist = new File[] {
context.getFilesDir().getCanonicalFile(),
context.getCacheDir().getCanonicalFile(),