Open davirec opened 2 years ago
Hi Davi,
thanks for that issue! I could easily reproduce it but have absolutely no idea, where this comes from.
As you see in the commit history, I am currently not working on the app. This is because I have to much to do for university right now.
As soon as I can get back to working on the project, I will have a closer look on this.
Thanks
This is the crash report that I get when I reproduce on my end if that's of use @JonasBernard ?
FATAL EXCEPTION: main Process: android.jonas.fakestandby, PID: 17267 java.lang.RuntimeException: Unable to start activity ComponentInfo{android.jonas.fakestandby/android.jonas.fakestandby.settings.SettingsActivity}: java.lang.IllegalStateException: Target fragment must implement TargetFragment interface at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3636) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3793) at android.app.ActivityThread.handleRelaunchActivityInner(ActivityThread.java:5739) at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:5631) at android.app.servertransaction.ActivityRelaunchItem.execute(ActivityRelaunchItem.java:71) at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2211) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7894) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1009) Caused by: java.lang.IllegalStateException: Target fragment must implement TargetFragment interface at androidx.preference.a.onCreate(SourceFile:12) at u0.d.onCreate(Unknown Source:0) at androidx.fragment.app.Fragment.performCreate(Unknown Source:16) at androidx.fragment.app.q.U(SourceFile:13) at androidx.fragment.app.q.S(SourceFile:1) at androidx.fragment.app.q.T(Unknown Source:47) at androidx.fragment.app.q.w(Unknown Source:9) at androidx.fragment.app.q.m(Unknown Source:6) at androidx.fragment.app.e.onCreate(SourceFile:7) at h.d.onCreate(Unknown Source:10) at android.jonas.fakestandby.settings.SettingsActivity.onCreate(Unknown Source:0) at android.app.Activity.performCreate(Activity.java:8050) at android.app.Activity.performCreate(Activity.java:8030) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1330) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3609) ... 15 more
I could reproduce this. It is of use, I hope. I will have a closer look at it. Sorry for the late reaction on that one.
I was encountering this until I set up a workaround to:
It's not convenient and it doesn't fix whatever the underlying issue it, but it works.
Step 1 Could be done with any automation app that receives intents such as Automation or Key Mapper or even Termux. Step 2 can be done with apps that can send intents. In Termux:
am start -n android.jonas.fakestandby/.actions.StartOverlay
In GUI based apps such as KeyMapper, these settings can be used:
Hope this helps someone also experiencing the auto-rotate crash
That's actually a very nice solution :) Did not know anyone really uses my action StartOverlay.
Is StartOverlay the only action to start FakeStandby?
Also, I might have spoken too soon because I had a crash this morning that I had to reboot from (the StopOverlay action which I also use in a script was not working). Here's hoping disabling auto rotate and then locking in portrait mode fixes it
There is a StopOverlay Action too...not very surprising, I guess.
Hmm so I had a crash again this morning: My stop_fakestandby script stopped working until a reboot. The device had auto-rotate turned off and was locked in portrait mode. The only things I had changed were:
I don't think 2 was the cause, so hopefully leaving the swipe up escape method will prevent my crash.
Btw here is my stop_FakeStandby script that I run from within Termux:
#!/data/data/com.termux/files/usr/bin/sh
am start -n android.jonas.fakestandby/.actions.StopOverlay
When I perform these sequences of events, the app crashes when rotating the screen:
Before rotation:
The expected behavior is the return to the previous state with the form of the previous image.
However, the app crashes.
After rotation:
https://user-images.githubusercontent.com/3637419/157570593-0f98e5ca-32fa-4b8c-ae6a-595b87154fc3.mp4
Device: