Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.0
-
None
-
* Arch Linux
* Qt 5.9.0 armV7
* Android SDK 26.0.2, build with android-25
* Android NDK r15-1
Description
When a android Qt service tries to stop itself, there are problems (that depend on the way it was stopped). Here are 4 Scenarios, to describe the problems:
- Stopping the service from the outside (via context.stopService): Works as expected
- Stopping the service by calling qApp->quit(); Does stop the Qt application, but not the service (i.e. The onDestroy will never be reached)
- Stopping the service by calling Service.stopSelf(); (java method), It works only the first time the service is stopped. It it is started again, this method becomes useless
- Combining qApp->quit(); and Service.stopSelf(); Again works the first time, but behaves just like qApp->quit(); for subsequent runs.
I created a test project, See line 30 of main.cpp to switch between the different stop methods.
The service shows an ongoing notification and a toast when started/created, and a normal notification when the Qt application dies, as well as a toast when the service is destoyed.
Furthermore, it seems the ongoing notification is only shown the first time the service is started. I'm not shure if this could be related with the fact that stopSelf only works once, too.
Is propably related with QTBUG-58471.