SecondScreen icon indicating copy to clipboard operation
SecondScreen copied to clipboard

first launch, back to Autorotate fail, but OK after reboot

Open DanielDS-lm opened this issue 4 years ago • 5 comments

Hi, First, thank you for this useful app. At the first launch, I create a desktop profile, connect the screen, everything is ok, but when I disconnect the screen, the device stay locked in landscape. But this issue disappear after one reboot. (rebooting the device after SecondScreen installation doesn't fix, it need a first use, get the issue then reboot the device)

DanielDS-lm avatar Nov 20 '19 15:11 DanielDS-lm

Same problem here. It appears the app doesn't reset rotation leaving the phone locked in landscape.

pepijndevos avatar Mar 27 '22 08:03 pepijndevos

It seems rotation is set here https://github.com/farmerbb/SecondScreen/blob/3dd38b95c429d131e7008ed9b736cc2e2383188e/app/src/main/java/com/farmerbb/secondscreen/service/ProfileLoadService.java#L413 and unset here https://github.com/farmerbb/SecondScreen/blob/3dd38b95c429d131e7008ed9b736cc2e2383188e/app/src/main/java/com/farmerbb/secondscreen/service/TurnOffService.java#L238

So it looks like some effort is made to restore the rotation, but it's not completely correct.

pepijndevos avatar Mar 27 '22 09:03 pepijndevos

Actually that seems not to be the problem. If you do not grant the app permission to force other apps to be in landscape, it actually reverts nicely, this suggests it's a problem with RotationLockService rather than with settings.

As far as I can tell, this service is used via the notificaiton service, which is turned off here: https://github.com/farmerbb/SecondScreen/blob/74c05c9fe4cb82425d67ba5cabe3d238b4795c28/app/src/main/java/com/farmerbb/secondscreen/service/TurnOffService.java#L461-L463

Uh... I'm not sure how much further I'm going to get without launching the app in a debugger.

pepijndevos avatar Mar 27 '22 09:03 pepijndevos

Maybe the problem is that the overlay is removed after setting all the settings back to the default? So it'd set the orientation back, but the overlay is still there forcing it in landscape, and then the overlay is removed, leaving it in landscape.

No, actually I just tested, and after disabling the profile, a notification is still active that says the apps is drawing an overlay. Tapping the notification to remove the overlay reverts screen orientation to normal.

So yea, basically the overlay is not removed correctly.

pepijndevos avatar Mar 27 '22 09:03 pepijndevos

I also have this issue. But the rotation lock gets actually stuck you can change it but the system settings are overwritten. Also for me it's fixed after reboot. I'm using a Fairphone 4 with up to date software. If you remove the overlay or stop the program the problem stays, that the system settings are not accepted. I even tried to remove the rights of the app. However, no success only reboot fixed it for me.

Cthulien avatar Jul 01 '22 18:07 Cthulien