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

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

Camera: Fix gallery open intent

parent 98ed42f8
Loading
Loading
Loading
Loading
+13 −4
Original line number Original line Diff line number Diff line
@@ -5269,7 +5269,7 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
            final String REVIEW_ACTION = "com.android.camera.action.REVIEW";
            final String REVIEW_ACTION = "com.android.camera.action.REVIEW";
            final String KEY_FROM_SNAPCAM = "from-snapcam";
            final String KEY_FROM_SNAPCAM = "from-snapcam";
            boolean done = false;
            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.
                // 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),
                // 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.
                // unless we first pause and resume Open Camera.
@@ -5278,8 +5278,15 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
                if( MyDebug.LOG )
                if( MyDebug.LOG )
                    Log.d(TAG, "try REVIEW_ACTION");
                    Log.d(TAG, "try REVIEW_ACTION");
                try {
                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);
                        intent.putExtra(KEY_FROM_SNAPCAM, allowEdit);
                    } else {
                        intent.setAction(MediaStore.ACTION_REVIEW);
                        intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
                    }
                    this.startActivity(intent);
                    this.startActivity(intent);
                    done = true;
                    done = true;
                }
                }
@@ -5292,7 +5299,9 @@ public class MainActivity extends AppCompatActivity implements PreferenceFragmen
                    Log.d(TAG, "try ACTION_VIEW");
                    Log.d(TAG, "try ACTION_VIEW");
                try {
                try {
                    Intent intent = new Intent(Intent.ACTION_VIEW, uri);
                    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);
                        intent.putExtra(KEY_FROM_SNAPCAM, allowEdit);
                    }
                    this.startActivity(intent);
                    this.startActivity(intent);
                }
                }
                catch(ActivityNotFoundException e) {
                catch(ActivityNotFoundException e) {