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

Commit a7f1303e authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch '2688-main-gallery_view' into 'main'

Camera: Fix gallery open intent

See merge request !82
parents 0ef5eb9c 9b9b3989
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@ android {

    defaultConfig {
        applicationId "foundation.e.camera"
        minSdkVersion 26
        minSdkVersion 29
        targetSdkVersion 34
        //compileSdkVersion 31 // needed to support appcompat:1.4.0 (which we need for emoji policy support, and not yet ready to target SDK 30)

+17 −5
Original line number Diff line number Diff line
@@ -1504,7 +1504,10 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
        for(Map.Entry<Integer, Bitmap> entry : preloaded_bitmap_resources.entrySet()) {
            if( MyDebug.LOG )
                Log.d(TAG, "recycle: " + entry.getKey());
            entry.getValue().recycle();
            Bitmap recycleValue = entry.getValue();
            if (recycleValue != null) {
                recycleValue.recycle();
            }
        }
        preloaded_bitmap_resources.clear();
        if( textToSpeech != null ) {
@@ -5043,7 +5046,7 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
            final String REVIEW_ACTION = "com.android.camera.action.REVIEW";
            final String KEY_FROM_SNAPCAM = "from-snapcam";
            boolean done = false;
            if( !is_raw ) {
            if( !is_raw || (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) ) {
                // REVIEW_ACTION means we can view video files without autoplaying.
                // However, Google Photos at least has problems with going to a RAW photo (in RAW only mode),
                // unless we first pause and resume Open Camera.
@@ -5052,8 +5055,15 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
                if( MyDebug.LOG )
                    Log.d(TAG, "try REVIEW_ACTION");
                try {
                    Intent intent = new Intent(REVIEW_ACTION, uri);
                    Intent intent = new Intent();
                    intent.setData(uri);
                    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
                        intent.setAction(REVIEW_ACTION);
                        intent.putExtra(KEY_FROM_SNAPCAM, allowEdit);
                    } else {
                        intent.setAction(MediaStore.ACTION_REVIEW);
                        intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
                    }
                    this.startActivity(intent);
                    done = true;
                }
@@ -5066,7 +5076,9 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
                    Log.d(TAG, "try ACTION_VIEW");
                try {
                    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.UPSIDE_DOWN_CAKE) {
                        intent.putExtra(KEY_FROM_SNAPCAM, allowEdit);
                    }
                    this.startActivity(intent);
                }
                catch(ActivityNotFoundException e) {