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

startForegroundService sometimes is not being called #1265

Open
daniele-athome opened this issue Aug 19, 2019 · 6 comments
Open

startForegroundService sometimes is not being called #1265

daniele-athome opened this issue Aug 19, 2019 · 6 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@daniele-athome
Copy link
Member

Seems that #1264 was not enough.

android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground()
       at android.app.ActivityThread$H.handleMessage + 2204(ActivityThread.java:2204)
       at android.os.Handler.dispatchMessage + 108(Handler.java:108)
       at android.os.Looper.loop + 166(Looper.java:166)
       at android.app.ActivityThread.main + 7523(ActivityThread.java:7523)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run + 245(Zygote.java:245)
       at com.android.internal.os.ZygoteInit.main + 921(ZygoteInit.java:921)
@daniele-athome daniele-athome added the bug Something isn't working label Aug 19, 2019
@daniele-athome
Copy link
Member Author

Recently got a more detailed stacktrace:

android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{bf48d4e u0 org.kontalk/.service.DownloadService}
       at android.app.ActivityThread$H.handleMessage + 2126(ActivityThread.java:2126)
       at android.os.Handler.dispatchMessage + 112(Handler.java:112)
       at android.os.Looper.loop + 216(Looper.java:216)
       at android.app.ActivityThread.main + 7625(ActivityThread.java:7625)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 524(RuntimeInit.java:524)
       at com.android.internal.os.ZygoteInit.main + 987(ZygoteInit.java:987)

Maybe was the download service from the beginning?

@daniele-athome daniele-athome added this to the Next milestone Sep 3, 2019
@daniele-athome
Copy link
Member Author

Or not:

android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground(): ServiceRecord{898d54a u0 org.kontalk/.service.msgcenter.MessageCenterService}
       at android.app.ActivityThread$H.handleMessage + 1872(ActivityThread.java:1872)
       at android.os.Handler.dispatchMessage + 106(Handler.java:106)
       at android.os.Looper.loop + 214(Looper.java:214)
       at android.app.ActivityThread.main + 7050(ActivityThread.java:7050)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 493(RuntimeInit.java:493)
       at com.android.internal.os.ZygoteInit.main + 965(ZygoteInit.java:965)

@daniele-athome
Copy link
Member Author

Download and upload services were converted to JobIntentServices so this bug doesn't apply to them anymore (see 915d9e8).

@daniele-athome
Copy link
Member Author

Found it! stopForeground was being called because push notifications were enabled. Related to #1278.

@daniele-athome
Copy link
Member Author

Still happening on beta3. Reopening.

@daniele-athome
Copy link
Member Author

Still happening on 4.4.0. Reopening (this is getting out of hand).

@daniele-athome daniele-athome modified the milestones: 4.4.0, Next 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