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

Cannot start RegistrationService while in background #1305

Open
daniele-athome opened this issue Aug 20, 2020 · 0 comments
Open

Cannot start RegistrationService while in background #1305

daniele-athome opened this issue Aug 20, 2020 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@daniele-athome
Copy link
Member

Apparently the postDelayed trick didn't work :-)

Fatal Exception: java.lang.IllegalStateException: Not allowed to start service Intent { cmp=org.kontalk/.service.registration.RegistrationService }: app is in background uid UidRecord{3356b13 u0a237 CAC  bg:+12m37s722ms idle change:cached procs:1 seq(0,0,0)}
       at android.app.ContextImpl.startServiceCommon(ContextImpl.java:1616)
       at android.app.ContextImpl.startService(ContextImpl.java:1571)
       at android.content.ContextWrapper.startService(ContextWrapper.java:669)
       at org.kontalk.service.registration.RegistrationService.start(RegistrationService.java:1492)
       at org.kontalk.ui.NumberValidation$5.run(NumberValidation.java:421)
       at android.os.Handler.handleCallback(Handler.java:883)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loop(Looper.java:214)
       at android.app.ActivityThread.main(ActivityThread.java:7398)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:919)

Move the start() call to onResume and ensure the RegistrationService won't do first-time stuff after the first onStartCommand.

@daniele-athome daniele-athome added the bug Something isn't working label Aug 20, 2020
@daniele-athome daniele-athome added this to the Next milestone Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant