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

Commit 21ecb98a authored by Mark Harman's avatar Mark Harman
Browse files

Make use of setRecentsScreenshotEnabled() on Android 13.

parent 7728db2e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ FIXED Problem where clicking on gallery icon would sometimes go to a "base" im
        image, when saving HDR photos with base images (for Android 10+).
FIXED   Collapse notification panel when launching from a quick settings tile.
UPDATED Drop support for notifications for background saving, due to Android 13 permissions faff.
UPDATED No longer allow a screenshot of the camera preview to show in "recent apps" view (for
        Android 13+).

Version 1.51.1 (2023/01/02)

+12 −0
Original line number Diff line number Diff line
@@ -3493,6 +3493,12 @@ public class MainActivity extends AppCompatActivity {
    	}*/
        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);

        if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU ) {
            // we set this to prevent what's on the preview being used to show under the "recent apps" view - potentially useful
            // for privacy reasons
            setRecentsScreenshotEnabled(false);
        }

        if( lock_to_landscape ) {
            // force to landscape mode
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
@@ -3586,6 +3592,12 @@ public class MainActivity extends AppCompatActivity {
    public void setWindowFlagsForSettings(boolean set_lock_protect) {
        if( MyDebug.LOG )
            Log.d(TAG, "setWindowFlagsForSettings: " + set_lock_protect);

        if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU ) {
            // in settings mode, okay to revert to default behaviour for using a screenshot for "recent apps" view
            setRecentsScreenshotEnabled(true);
        }

        // allow screen rotation
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);

+2 −0
Original line number Diff line number Diff line
@@ -354,6 +354,8 @@ public abstract class CameraController {
     *  Otherwise there is a risk when opening the camera that the textureview still shows an image from when
     *  the camera was previously opened (e.g., from pausing and resuming the application). This returns false (for CameraController2)
     *  when the camera has received its first frame.
     *  Update: on more recent Android versions this didn't work very well, possibly due to a screenshot being used for "recent apps"
     *  view; on Android 13+, the activity can make use of shouldCoverPreview(false) for this.
     */
    public boolean shouldCoverPreview() {
        return false;