Skip to content

Commit 32b689e

Browse files
committed
Document foregroundServiceType parameter for Android foreground services
1 parent 6f3ae31 commit 32b689e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/source/services.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,15 @@ The ``PATH_TO_SERVICE_PY`` is the relative path to the service entry point (like
6464
You can optionally specify the following parameters:
6565
- :code:`:foreground` for launching a service as an Android foreground service
6666
- :code:`:sticky` for launching a service that gets restarted by the Android OS on exit/error
67+
- :code:`:foregroundServiceType=TYPE` to specify the type of foreground service,
68+
where TYPE is one of the valid Android foreground service types
69+
(see `Android documentation <https://developer.android.com/reference/android/app/Service.html#START_FOREGROUND_SERVICE>`__
70+
for more details). You can specify multiple types separated by a pipe
71+
character "|", e.g. :code:`:foregroundServiceType=location|mediaPlayback`. Mandatory
72+
if :code:`:foreground` is used on Android 14+.
6773
6874
Full command with all the optional parameters included would be:
69-
:code:`--service=myservice:services/myservice.py:foreground:sticky`
75+
:code:`--service=myservice:services/myservice.py:foreground:sticky:foregroundServiceType=location`
7076

7177
You can add multiple
7278
:code:`--service` arguments to include multiple services, or separate

0 commit comments

Comments
 (0)