KeyedAppStatesService
abstract class KeyedAppStatesService : Service
| kotlin.Any | ||||
| ↳ | android.content.Context | |||
| ↳ | android.content.ContextWrapper | |||
| ↳ | android.app.Service | |||
| ↳ | androidx.enterprise.feedback.KeyedAppStatesService |
Base service for receiving app states in Device Owner and Profile Owner apps.
Extend this class and declare it as a service in the manifest. For example, if your service is called 'MyAppStatesService', including the following in the manifest:
<service android:name=".MyAppStatesService"> <intent-filter> <action android:name="androidx.enterprise.feedback.action.APP_STATES" /> </intent-filter> </service>
Override onReceive to receive keyed app states. onReceive is invoked on a background thread.
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
IBinder |
|
abstract Unit |
onReceive(Called when an app sends states. |
Inherited Constants |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
Public functions
onReceive
abstract fun onReceive(
states: (Mutable)Collection<ReceivedKeyedAppState!>,
requestSync: Boolean
): Unit
Called when an app sends states. States are key/value, so new values should replace existing ones for the same key.
| Parameters | |
|---|---|
states: (Mutable)Collection<ReceivedKeyedAppState!> |
The states sent by an app. Every state will have the same packageName and timestamp. |
requestSync: Boolean |
|