summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2019-03-13 17:12:41 -0600
committerJeff Sharkey <jsharkey@android.com>2019-03-13 17:12:41 -0600
commitb099a65974b787f66450592780ffe42cb08911e8 (patch)
treee4f590a0115c077c77a9c4d772efcde16a101d77 /src/com/android
parentcdbc38e6936505716b537db9aa434c89b89e7682 (diff)
downloadandroid_packages_providers_DownloadProvider-b099a65974b787f66450592780ffe42cb08911e8.tar.gz
android_packages_providers_DownloadProvider-b099a65974b787f66450592780ffe42cb08911e8.tar.bz2
android_packages_providers_DownloadProvider-b099a65974b787f66450592780ffe42cb08911e8.zip
Don't canonicalize app paths in system.
The provider isn't in the requesting app's sandbox, so it's unlikely that we can canonicalize the path. Bug: 128383017 Test: none Change-Id: I689ebb44e4c5d7f579ec998ff7333ee9b8d46542
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/providers/downloads/DownloadProvider.java12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/com/android/providers/downloads/DownloadProvider.java b/src/com/android/providers/downloads/DownloadProvider.java
index db1f7cf2..acc814c5 100644
--- a/src/com/android/providers/downloads/DownloadProvider.java
+++ b/src/com/android/providers/downloads/DownloadProvider.java
@@ -929,14 +929,10 @@ public final class DownloadProvider extends ContentProvider {
if (fileUri != null) {
path = fileUri.getPath();
}
- try {
- final File app = new File(path).getCanonicalFile();
- final File system = mStorageManager.translateAppToSystem(app, pid, uid);
- // If the input was file uri, we need to return a file uri
- return fileUri == null ? system.getPath() : Uri.fromFile(system).toString();
- } catch (IOException e) {
- throw new IllegalArgumentException(e);
- }
+ final File app = new File(path);
+ final File system = mStorageManager.translateAppToSystem(app, pid, uid);
+ // If the input was file uri, we need to return a file uri
+ return fileUri == null ? system.getPath() : Uri.fromFile(system).toString();
}
private @Nullable String translateSystemToApp(@Nullable String path, int pid, int uid) {