farmerbb/SecondScreen

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

DanielDS-lm opened this issue · 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)

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

It seems rotation is set here


and unset here

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

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:

// Stop NotificationService
Intent serviceIntent = new Intent(this, NotificationService.class);
stopService(serviceIntent);

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

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.

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.