GrapheneOS / Camera

Modern camera app focused on privacy and security with QR & barcode scanning.
https://grapheneos.org/
MIT License
842 stars 85 forks source link

Switching to night mode freezes the preview #449

Closed matchboxbananasynergy closed 1 month ago

matchboxbananasynergy commented 1 month ago

After updating to v69, switching to Night mode (on a Pixel 6, but likely not specific to just this model), the preview frame freezes. Switching to another mode unfreezes it.

If you press the button to take a photo regardless, nothing happens, but when you try to switch to another mode after that, you get an error, with the following log:

osVersion: google/oriole/oriole:14/AP2A.240705.004/2024071600:user/release-keys package: app.grapheneos.camera:69

osVersion: google/oriole/oriole:14/AP2A.240705.004/2024071600:user/release-keys
package: app.grapheneos.camera:69

x.S: Camera is closed.
    at y.r.a(Unknown Source:9)
    at x.Q.v(Unknown Source:12)
    at q.A.o(Unknown Source:55)
    at E.h.s(Unknown Source:16)
    at androidx.camera.lifecycle.LifecycleCamera.onStop(Unknown Source:9)
    at androidx.camera.lifecycle.LifecycleCamera.k(Unknown Source:13)
    at androidx.camera.lifecycle.b.h(Unknown Source:48)
    at androidx.camera.lifecycle.b.g(Unknown Source:8)
    at androidx.camera.lifecycle.d.d(Unknown Source:63)
    at d1.q.t(Unknown Source:171)
    at d1.q.u(Unknown Source:257)
    at app.grapheneos.camera.ui.activities.MainActivity.F(Unknown Source:43)
    at d1.f.onTouch(Unknown Source:206)
    at android.view.View.performOnTouchCallback(View.java:16256)
    at android.view.View.dispatchTouchEvent(View.java:16223)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3119)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2792)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:3125)
    at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2806)
    at com.android.internal.policy.DecorView.superDispatchTouchEvent(DecorView.java:496)
    at com.android.internal.policy.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1952)
    at android.app.Activity.dispatchTouchEvent(Activity.java:4518)
    at e.t.dispatchTouchEvent(Unknown Source:2)
    at com.android.internal.policy.DecorView.dispatchTouchEvent(DecorView.java:454)
    at android.view.View.dispatchPointerEvent(View.java:16548)
    at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:7559)
    at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:7326)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6723)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6780)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6746)
    at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:6912)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6754)
    at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:6969)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6727)
    at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:6780)
    at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:6746)
    at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:6754)
    at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:6727)
    at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:9827)
    at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:9778)
    at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:9747)
    at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:9969)
    at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:295)
    at android.os.MessageQueue.nativePollOnce(Native Method)
    at android.os.MessageQueue.next(MessageQueue.java:349)
    at android.os.Looper.loopOnce(Looper.java:189)
    at android.os.Looper.loop(Looper.java:317)
    at android.app.ActivityThread.main(ActivityThread.java:8623)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
    at com.android.internal.os.ExecInit.main(ExecInit.java:50)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:369)
MHShetty commented 1 month ago

Hi @matchboxbananasynergy,

A fix seems to have been made for this issue and merged - https://android-review.googlesource.com/c/platform/frameworks/support/+/3195790 (Source: https://issuetracker.google.com/issues/354824993#comment7)

The fix should get included in one of the upcoming release of CameraX after which we should ideally be able to upgrade to a higher Gradle version without this issue persisting.

Thanks a lot for testing and reporting this issue!