okta / okta-oidc-android

OIDC SDK for Android
https://github.com/okta/okta-oidc-android
Other
60 stars 45 forks source link

Silent failure when bind service failed #247

Closed mchemin closed 2 years ago

mchemin commented 3 years ago

On a Huawei device with chrome installed the okta oidc 1.0.19 failed to bind to the chrome tabs service.

The return of bind service here is not used and in the case were the service is not launch nothing happened and the user hang there forever and we have no logs nor information about it.

NikitaAvraimov-okta commented 3 years ago

@mchemin do you have this issue every time when using Huawei device? Is it reproducable on a sample app?

mchemin commented 3 years ago

The issue happens in some conditions on a Huawei Mate 8. This device does not have Google Chrome installed by default. Then we asked our user to install it, even if he wants to continue using his own default browser. We discovered this exact scenario which always trigger the failure.

Actual:

The browser is never launched.

Expected:

Analysis:

The bindServiceAndStart method pointed in the 1st comment can return false if it will surely fail to connect. In this case, the connection callback given to the bindService is never used and we are soft lock waiting for something that will never arrive. On this Huawei device, Chrome is killed by the system and the system prevent the launch of Chrome services by another app (or automatically) due to battery saving optimisations. If the user launch Chrome before the test, and keep it in the background, it works properly. Please note that there's a "Battery menu" in this Huawei device which allows to manage "automatically" this battery optimisation. If the user manually accept that we don't want to optimise the Chrome app, everything seems to work as expected.

JayNewstrom commented 2 years ago

We don't plan to change the bind behavior in this SDK. The new SDK doesn't use bind service, and should solve these problems.