whatawurst / android_device_sony_yoshino-common

This is the Android device configuration for the yoshino platform
10 stars 48 forks source link

NetworkSwitcher: Handle unlocked phone before switching networks #52

Closed Flamefire closed 3 years ago

Flamefire commented 3 years ago

When the phone is unlocked before we register the unlock-receiver the network is never switched back. To avoid this register a receiver on start to receive the unlock event and check for that.

@shank03 Please check this.

Fixes #51

shank03 commented 3 years ago

I think this needs to be more specific of what scenario you are trying to address ?

I see that this is needed when, let's say, user has no lock screen ?

Because no user can unlock device in less than 1.4 sec (after reboot) except for the scenario mentioned above (or when user have very small password).

shank03 commented 3 years ago

I suspect there gonna be a need of line to line code discussion.. let me know if you are comfortable for a meet (google meet).

Flamefire commented 3 years ago

If the user has no lock screen, won't isFileEncryptedNativeOrEmulated return False anyway?

Because no user can unlock device in less than 1.4 sec

I'd say unlocking is certainly possible in lass than a second, but that is not the issue: We register observers at various times:

So there can (and in my case was) a considerable delay. I noticed e.g. that the lock screen came up (way) before the SIM PIN screen came up. So I think that was the issue here.

No issues with Google meet or whatever as long as it works in a browser. If maybe the above already clears things up enough than you could also use the comment tools of github on the changed lines.

shank03 commented 3 years ago

Okay I see here, I missed the SIM PIN scenario.

Thank you for pointing it out :)

Well then, @derfelot ready to merge this.

Flamefire commented 3 years ago

Ok, great! Thanks for checking. :) Not too familiar with that stuff so could have easily missed something.

derfelot commented 3 years ago

Thanks, merging. Could someone add this to the https://github.com/whatawurst/OpenCustomizationSelector repo as well? IIRC you have merge rights there @shank03