kontalk / androidclient

Kontalk official Android client
https://www.kontalk.org
GNU General Public License v3.0
571 stars 194 forks source link

Service not allowed to start even after onStart #1272

Closed daniele-athome closed 4 years ago

daniele-athome commented 5 years ago

Seems like an Android bug: https://stackoverflow.com/questions/52013545/android-9-0-not-allowed-to-start-service-app-is-in-background-after-onresume https://issuetracker.google.com/issues/110237673

java.lang.IllegalStateException: Not allowed to start service Intent { cmp=org.kontalk/.service.registration.RegistrationService }: app is in background uid UidRecord{106fdf9 u0a189 TPSL bg:+7m48s632ms idle procs:1 seq(88,88,88)}
       at android.app.ContextImpl.startServiceCommon + 1595(ContextImpl.java:1595)
       at android.app.ContextImpl.startService + 1550(ContextImpl.java:1550)
       at android.content.ContextWrapper.startService + 664(ContextWrapper.java:664)
       at org.kontalk.service.registration.RegistrationService.start + 1473(RegistrationService.java:1473)
       at org.kontalk.ui.NumberValidation.onStart + 402(NumberValidation.java:402)
       at android.app.Instrumentation.callActivityOnStart + 1470(Instrumentation.java:1470)
       at android.app.Activity.performStart + 7170(Activity.java:7170)
       at android.app.ActivityThread.handleStartActivity + 3071(ActivityThread.java:3071)
       at android.app.servertransaction.TransactionExecutor.performLifecycleSequence + 180(TransactionExecutor.java:180)
       at android.app.servertransaction.TransactionExecutor.cycleToPath + 165(TransactionExecutor.java:165)
       at android.app.servertransaction.TransactionExecutor.executeLifecycleState + 142(TransactionExecutor.java:142)
       at android.app.servertransaction.TransactionExecutor.execute + 70(TransactionExecutor.java:70)
       at android.app.ActivityThread$H.handleMessage + 1916(ActivityThread.java:1916)
       at android.os.Handler.dispatchMessage + 106(Handler.java:106)
       at android.os.Looper.loop + 193(Looper.java:193)
       at android.app.ActivityThread.main + 6898(ActivityThread.java:6898)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 537(RuntimeInit.java:537)
       at com.android.internal.os.ZygoteInit.main + 858(ZygoteInit.java:858)