Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a2953de authored by Abhishek Aggarwal's avatar Abhishek Aggarwal
Browse files

Merge branch '7057-s-faulty_share_intent' into 'v1-s'

Revert "base: ChooserActivity: Don't show image edit button on multiple targets"

See merge request e/os/android_frameworks_base!156
parents 5f006d52 920abc0a
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -1179,6 +1179,19 @@ public class ChooserActivity extends ResolverActivity implements
        final Intent resolveIntent = new Intent(originalIntent);
        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) {
@@ -1397,16 +1410,13 @@ public class ChooserActivity extends ResolverActivity implements

        final ViewGroup actionRow =
                (ViewGroup) contentPreviewLayout.findViewById(R.id.chooser_action_row);
        String action = targetIntent.getAction();

        //TODO: addActionButton(actionRow, createCopyButton());
        addActionButton(actionRow, createNearbyButton(targetIntent));
        if (!Intent.ACTION_SEND_MULTIPLE.equals(action)) {
        addActionButton(actionRow, createEditButton(targetIntent));
        }

        mPreviewCoord = new ContentPreviewCoordinator(contentPreviewLayout, false);

        String action = targetIntent.getAction();
        if (Intent.ACTION_SEND.equals(action)) {
            Uri uri = targetIntent.getParcelableExtra(Intent.EXTRA_STREAM);
            if (!validForContentPreview(uri)) {