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

Commit a9983149 authored by Aayush Gupta's avatar Aayush Gupta
Browse files

Gallery2: Set content URI as data in share intents



Edit action expects content URI in data otherwise leads to crash due to NPE.

This is similar to what I7a1254e579cea38fd70fc13da81e1dae98f5f968 is doing with
screenshot activity in fw/base.

Signed-off-by: default avatarAayush Gupta <aayushgupta219@gmail.com>
Change-Id: Ifdded8862e4e08dfcb05391c1cb40cf1f4f7dbd8
parent 2065dd6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ public abstract class PhotoPage extends ActivityState implements
                 if (mModel != null && mModel.getMediaItem(0) != null) {
                 Uri uri = mActivity.getDataManager().getContentUri(mModel.getMediaItem(0).getPath());
                 mActivity.isTopMenuShow = true;
                 mShareIntent.setType(MenuExecutor.getMimeType(mModel
                 mShareIntent.setDataAndType(uri, MenuExecutor.getMimeType(mModel
                    .getMediaItem(0).getMediaType()));
                 mShareIntent.putExtra(Intent.EXTRA_STREAM, uri);
                 String shareTitle = mActivity.getResources().
+2 −2
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi
                intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
            } else {
                intent.setAction(Intent.ACTION_SEND);
                intent.setType(GalleryUtils.MIME_TYPE_PANORAMA360);
                intent.setDataAndType(uris.get(0), GalleryUtils.MIME_TYPE_PANORAMA360);
                intent.putExtra(Intent.EXTRA_STREAM, uris.get(0));
            }
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
@@ -425,7 +425,7 @@ public class ActionModeHandler implements Callback, PopupList.OnPopupItemClickLi
                intent.setAction(Intent.ACTION_SEND_MULTIPLE).setType(mimeType);
                intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, uris);
            } else {
                intent.setAction(Intent.ACTION_SEND).setType(mimeType);
                intent.setAction(Intent.ACTION_SEND).setDataAndType(uris.get(0), mimeType);
                intent.putExtra(Intent.EXTRA_STREAM, uris.get(0));
            }
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);