Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit fb72b990 authored by Hui Yu's avatar Hui Yu
Browse files

Add API Service.getForegroundServiceType()

To return current foregroundServiceType if the service has become a
foreground service.

If service become foreground service by calling Service.startForeground(int,
Notification, int type), the returned type is the type specified.

If the no-type version Service.startForeground(int, Notification) is called.
the returned type is foregroundServiceType specified in manifest.

If no foregroundServiceType specified in manifest, the returned type is
zero.

If the service is not a foreground service, the returned type is zero.

Bug: 124517685
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerProcessStateTest.java#testFgsLocation

Change-Id: Ibcc4431429a90aab92a5533e296fb104b4add9e6
parent c7e26f7f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment