summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean McCreary <mccreary@mcwest.org>2017-04-06 19:29:07 (GMT)
committerSean McCreary <mccreary@mcwest.org>2017-04-06 19:31:45 (GMT)
commita4098b20bc5af495c367eb108c327466fd1726f6 (patch)
treeac10d8545be01de866ea5d78623b1f1c13ce41ea
parent78cb8b00ee024cfdf383912695e30d9c2cb64f7d (diff)
downloadandroid_packages_apps_Messaging-a4098b20bc5af495c367eb108c327466fd1726f6.zip
android_packages_apps_Messaging-a4098b20bc5af495c367eb108c327466fd1726f6.tar.gz
android_packages_apps_Messaging-a4098b20bc5af495c367eb108c327466fd1726f6.tar.bz2
Revert "resolve merge conflicts of eafd58a to nyc-dev"
This reverts commit 04b3ef8ed45bf90c7da89935209f0f4375137197. Change-Id: Id31930319d05e795a8cc35f37ad5b20fa3ce8c81
-rw-r--r--src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java13
-rw-r--r--src/com/android/messaging/util/FileUtil.java18
2 files changed, 0 insertions, 31 deletions
diff --git a/src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java b/src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java
index bb267da..2c36752 100644
--- a/src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java
+++ b/src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java
@@ -24,8 +24,6 @@ import android.os.Bundle;
import com.android.messaging.Factory;
import com.android.messaging.datamodel.data.PendingAttachmentData;
import com.android.messaging.ui.UIIntents;
-import com.android.messaging.util.LogUtil;
-import com.android.messaging.util.FileUtil;
import com.android.messaging.util.ImageUtils;
import com.android.messaging.util.SafeAsyncTask;
@@ -113,23 +111,12 @@ public class DocumentImagePicker {
new SafeAsyncTask<Void, Void, String>() {
@Override
protected String doInBackgroundTimed(final Void... params) {
- if (FileUtil.isInPrivateDir(documentUri)) {
- // hacker sending private app data. Bail out
- if (LogUtil.isLoggable(LogUtil.BUGLE_TAG, LogUtil.ERROR)) {
- LogUtil.e(LogUtil.BUGLE_TAG, "Aborting attach of private app data ("
- + documentUri + ")");
- }
- return null;
- }
return ImageUtils.getContentType(
Factory.get().getApplicationContext().getContentResolver(), documentUri);
}
@Override
protected void onPostExecute(final String contentType) {
- if (contentType == null) {
- return; // bad uri on input
- }
// Ask the listener to create a temporary placeholder item to show the progress.
final PendingAttachmentData pendingItem =
PendingAttachmentData.createPendingAttachmentData(contentType,
diff --git a/src/com/android/messaging/util/FileUtil.java b/src/com/android/messaging/util/FileUtil.java
index f76e4fd..7c47ae9 100644
--- a/src/com/android/messaging/util/FileUtil.java
+++ b/src/com/android/messaging/util/FileUtil.java
@@ -16,11 +16,7 @@
package com.android.messaging.util;
-import android.content.ContentResolver;
import android.content.Context;
-import android.net.Uri;
-import android.os.Environment;
-import android.text.TextUtils;
import android.webkit.MimeTypeMap;
import com.android.messaging.Factory;
@@ -120,20 +116,6 @@ public class FileUtil {
}
}
- private static boolean isFileUri(final Uri uri) {
- return TextUtils.equals(uri.getScheme(), ContentResolver.SCHEME_FILE);
- }
- // Checks if the file is in /data, and don't allow any app to send personal information.
- // We're told it's possible to create world readable hardlinks to other apps private data
- // so we ban all /data file uris.
- public static boolean isInPrivateDir(Uri uri) {
- if (!isFileUri(uri)) {
- return false;
- }
- final File file = new File(uri.getPath());
- return isSameOrSubDirectory(Environment.getDataDirectory(), file);
- }
-
/**
* Checks, whether the child directory is the same as, or a sub-directory of the base
* directory.