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

Commit aa652f1d authored by Mark Harman's avatar Mark Harman Committed by Mohammed Althaf T
Browse files

onCreate() should call setWindowFlagsForSettings() instead of...

onCreate() should call setWindowFlagsForSettings() instead of setWindowFlagsForCamera() if in settings.
parent 97431298
Loading
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@
<pre>
Version 1.53 (Work in progress)

FIXED   If force destroyed when in settings, the camera would be incorrectly opened when application
        was recreated (camera should only be reopened when leaving settings).
ADDED   Camera vendor extensions show percentage progress on supported Android 14 devices.
ADDED   Long press on switch camera icons now bring up a menu to jump to any camera.
UPDATED Improvements for popup menu and exposure UI when using large font sizes.
+14 −2
Original line number Diff line number Diff line
@@ -375,8 +375,15 @@ public class MainActivity extends AppCompatActivity {
            setDeviceDefaults();
        }

        boolean settings_is_open = settingsIsOpen();
        if( MyDebug.LOG )
            Log.d(TAG, "settings_is_open?: " + settings_is_open);
        // settings_is_open==true can happen if application is recreated when settings is open
        // to reproduce: go to settings, then turn screen off and on (and unlock)
        if( !settings_is_open ) {
            // set up window flags for normal operation
            setWindowFlagsForCamera();
        }
        if( MyDebug.LOG )
            Log.d(TAG, "onCreate: time after setting window flags: " + (System.currentTimeMillis() - debug_time));

@@ -443,6 +450,11 @@ public class MainActivity extends AppCompatActivity {
        if( MyDebug.LOG )
            Log.d(TAG, "onCreate: time after creating preview: " + (System.currentTimeMillis() - debug_time));

        if( settings_is_open ) {
            // must be done after creating preview
            setWindowFlagsForSettings();
        }

        if( Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 ) {
            // don't show orientation animations
            // must be done after creating Preview (so we know if Camera2 API or not)
+2 −0
Original line number Diff line number Diff line
@@ -1615,6 +1615,8 @@ public class Preview implements SurfaceHolder.Callback, TextureView.SurfaceTextu
                Log.d(TAG, "don't open camera as preview in background");
            // note, even if the application never tries to reopen the camera in the background, we still need this check to avoid the camera
            // opening from mySurfaceCreated()
            // for example, this is needed when the application is recreated when settings are open (a new Preview and surface is created, but
            // we don't want the camera to be opened) - to test this, go to settings then turn screen off and on (and unlock)
            return;
        }
        else if( camera_open_state == CameraOpenState.CAMERAOPENSTATE_OPENING ) {