summaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
author Matt Casey <mrcasey@google.com> 2022-10-04 20:01:46 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2022-10-04 20:01:46 +0000
commitf5e7d4b83f9628cbe59f07ce03153ae5c671f89a (patch)
treeddc47e68114c85b021f31206fee9bd3a1c0863a2 /java
parent5af3afad2e3dd133658dcacc48ce5835a1648858 (diff)
parent64eea1da84ee8f7883d3b307e50fcd24f1bc30d9 (diff)
Merge "Multi-image editor fix" into tm-qpr-dev
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/intentresolver/ChooserActivity.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/java/src/com/android/intentresolver/ChooserActivity.java b/java/src/com/android/intentresolver/ChooserActivity.java
index 14d77427..d4855382 100644
--- a/java/src/com/android/intentresolver/ChooserActivity.java
+++ b/java/src/com/android/intentresolver/ChooserActivity.java
@@ -1108,6 +1108,19 @@ public class ChooserActivity extends ResolverActivity implements
resolveIntent.setFlags(originalIntent.getFlags() & URI_PERMISSION_INTENT_FLAGS);
resolveIntent.setComponent(cn);
resolveIntent.setAction(Intent.ACTION_EDIT);
+ String originalAction = originalIntent.getAction();
+ if (Intent.ACTION_SEND.equals(originalAction)) {
+ if (resolveIntent.getData() == null) {
+ Uri uri = resolveIntent.getParcelableExtra(Intent.EXTRA_STREAM);
+ if (uri != null) {
+ String mimeType = getContentResolver().getType(uri);
+ resolveIntent.setDataAndType(uri, mimeType);
+ }
+ }
+ } else {
+ Log.e(TAG, originalAction + " is not supported.");
+ return null;
+ }
final ResolveInfo ri = getPackageManager().resolveActivity(
resolveIntent, PackageManager.GET_META_DATA);
if (ri == null || ri.activityInfo == null) {