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

Commit eef0ca49 authored by John Hoford's avatar John Hoford Committed by Android Git Automerger
Browse files

am e56abc70: prevent editing of GIF

* commit 'e56abc70':
  prevent editing of GIF
parents 7599aaad e56abc70
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -237,9 +237,9 @@ public class LocalImage extends LocalMediaItem {
    @Override
    public int getSupportedOperations() {
        int operation = SUPPORT_DELETE | SUPPORT_SHARE | SUPPORT_CROP
                | SUPPORT_SETAS | SUPPORT_EDIT | SUPPORT_INFO;
                | SUPPORT_SETAS | SUPPORT_PRINT | SUPPORT_INFO;
        if (BitmapUtils.isSupportedByRegionDecoder(mimeType)) {
            operation |= SUPPORT_FULL_IMAGE;
            operation |= SUPPORT_FULL_IMAGE | SUPPORT_EDIT;
        }

        if (BitmapUtils.isRotationSupported(mimeType)) {
+1 −0
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@ public abstract class MediaObject {
    public static final int SUPPORT_ACTION = 1 << 14;
    public static final int SUPPORT_CAMERA_SHORTCUT = 1 << 15;
    public static final int SUPPORT_MUTE = 1 << 16;
    public static final int SUPPORT_PRINT = 1 << 17;
    public static final int SUPPORT_ALL = 0xffffffff;

    // These are the bits returned from getMediaType():
+2 −2
Original line number Diff line number Diff line
@@ -211,10 +211,10 @@ public class UriImage extends MediaItem {

    @Override
    public int getSupportedOperations() {
        int supported = SUPPORT_EDIT | SUPPORT_SETAS;
        int supported = SUPPORT_PRINT | SUPPORT_SETAS;
        if (isSharable()) supported |= SUPPORT_SHARE;
        if (BitmapUtils.isSupportedByRegionDecoder(mContentType)) {
            supported |= SUPPORT_FULL_IMAGE;
            supported |= SUPPORT_EDIT | SUPPORT_FULL_IMAGE;
        }
        return supported;
    }
+2 −1
Original line number Diff line number Diff line
@@ -177,6 +177,7 @@ public class MenuExecutor {
        boolean supportCache = (supported & MediaObject.SUPPORT_CACHE) != 0;
        boolean supportEdit = (supported & MediaObject.SUPPORT_EDIT) != 0;
        boolean supportInfo = (supported & MediaObject.SUPPORT_INFO) != 0;
        boolean supportPrint = (supported & MediaObject.SUPPORT_PRINT) != 0;

        setMenuItemVisible(menu, R.id.action_delete, supportDelete);
        setMenuItemVisible(menu, R.id.action_rotate_ccw, supportRotate);
@@ -192,7 +193,7 @@ public class MenuExecutor {
        setMenuItemVisible(menu, R.id.action_edit, supportEdit);
        // setMenuItemVisible(menu, R.id.action_simple_edit, supportEdit);
        setMenuItemVisible(menu, R.id.action_details, supportInfo);
        setMenuItemVisible(menu, R.id.print, supportEdit);
        setMenuItemVisible(menu, R.id.print, supportPrint);
    }

    public static void updateMenuForPanorama(Menu menu, boolean shareAsPanorama360,