Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commission timeout due to AppCommissioningService.onStartCommand not being called #213

Open
franmontiel opened this issue May 8, 2024 · 4 comments

Comments

@franmontiel
Copy link

franmontiel commented May 8, 2024

I am experiencing this problem with a Samsung A33 5G (Android 14) but I am not able to reproduce it with other devices.

The problem is that after the System Fabric is successfully commissioned onCommissioningRequested is not called so the Google Home Matter lib timeout kicks-in (sometimes it is called prior that but it can also take a lot of time and it is not the usual behavior).

When I go back to the app from the Google Home Matter UI then suddenly onCommissioningRequested is called, but the UI already is gone so the user experience a failure even though the commissioning can still work.

Could this be some kind of problem with binding the Service? Could it be that Service somehow being treated as if the app is in background and that's why the method is called once I'm back from the Google Home Matter lib UI?

Any suggestion on what to do? Possible workaround for this?

Here the error when the timeout kicks-in prior onCommissioningRequested is called

m.gyh: Timed out waiting for commissioner to respond (ComponentInfo{com.google.homesampleapp.default/com.google.homesampleapp.commissioning.AppCommissioningService}).
	at m.hfl.invoke(:com.google.android.gms.optional_home@241616042@24.16.16 (100400-0):176)
	at m.hfv.a(:com.google.android.gms.optional_home@241616042@24.16.16 (100400-0):3)
	at m.bug.b(:com.google.android.gms.optional_home@241616042@24.16.16 (100400-0):29)
	at m.bug.f(:com.google.android.gms.optional_home@241616042@24.16.16 (100400-0):42)
	at m.bul.k(:com.google.android.gms.optional_home@241616042@24.16.16 (100400-0):15)
	at m.buc.run(:com.google.android.gms.optional_home@241616042@24.16.16 (100400-0):19)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:230)
	at android.os.Looper.loop(Looper.java:319)
	at android.app.ActivityThread.main(ActivityThread.java:8893)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:608)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
@franmontiel
Copy link
Author

franmontiel commented May 9, 2024

There is a workaround for this issue that consist on launching the service as a ForegroundService. This way the issue is gone for good and the commissioning process can continue.

My guess is that this is an issue that affects that particular device (and maybe others from the same brand) due how the Services restrictions are implemented.

@MrLiuYunPing
Copy link

Same issue, my code can be suspended at any time in the progress of the commission step.

@stefano055415
Copy link

Hi, I'm also having the same problem.
Samsung A33 5G, same phone and of course same OS (Android 14)

@stefano055415
Copy link

@franmontiel
I would also add that if I try the subscription with the app in "production mode", therefore signed and compressed.
The commissioning is successful, but I don't understand why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants