diff options
author | Tom Taylor <tomtaylor@google.com> | 2016-12-06 16:26:14 -0800 |
---|---|---|
committer | Tom Taylor <tomtaylor@google.com> | 2016-12-06 16:26:14 -0800 |
commit | a43c5c5f18d966355a63db194c931e02267a2695 (patch) | |
tree | 0e7785ebd53aa0836e75cde7ef475c1965ec0b84 /src | |
parent | 313284eee7adb278160aa94d0842079993408ddb (diff) | |
parent | eafd58a1127f1c7717871a72685c2fde12906f22 (diff) | |
download | packages_apps_Messaging-a43c5c5f18d966355a63db194c931e02267a2695.tar.gz packages_apps_Messaging-a43c5c5f18d966355a63db194c931e02267a2695.tar.bz2 packages_apps_Messaging-a43c5c5f18d966355a63db194c931e02267a2695.zip |
resolve merge conflicts of eafd58a to nyc-dev
Change-Id: I58151ca0c248dd4b84c78c8e7ca73d5a80bbd962
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java b/src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java index 2c36752..bb267da 100644 --- a/src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java +++ b/src/com/android/messaging/ui/mediapicker/DocumentImagePicker.java @@ -24,6 +24,8 @@ 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; @@ -111,12 +113,23 @@ 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, |