Språk

UsageEventType Enum

Definition

Enumerates values returned by several types.

public enum UsageEventType
type UsageEventType = 
Inheritance
UsageEventType

Fields

Name Value Description
None 0

No event type.

Android reference for android.app.usage.UsageEvents.Event.NONE.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ActivityResumed 1

An event type denoting that an Activity moved to the foreground. This event has a package name and class name associated with it and can be retrieved using getPackageName() and getClassName(). If a package has multiple activities, this event is reported for each activity that moves to foreground. This event is corresponding to Activity.onResume() of the activity's lifecycle.

Android reference for android.app.usage.UsageEvents.Event.ACTIVITY_RESUMED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

MoveToForeground 1

This constant was deprecated in API level 29. by ACTIVITY_RESUMED

Android reference for android.app.usage.UsageEvents.Event.MOVE_TO_FOREGROUND.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ActivityPaused 2

An event type denoting that an Activity moved to the background. This event has a package name and class name associated with it and can be retrieved using getPackageName() and getClassName(). If a package has multiple activities, this event is reported for each activity that moves to background. This event is corresponding to Activity.onPause() of the activity's lifecycle.

Android reference for android.app.usage.UsageEvents.Event.ACTIVITY_PAUSED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

MoveToBackground 2

This constant was deprecated in API level 29. by ACTIVITY_PAUSED

Android reference for android.app.usage.UsageEvents.Event.MOVE_TO_BACKGROUND.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ConfigurationChange 5

An event type denoting that the device configuration has changed.

Android reference for android.app.usage.UsageEvents.Event.CONFIGURATION_CHANGE.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

UserInteraction 7

An event type denoting that a package was interacted with in some way by the user.

Android reference for android.app.usage.UsageEvents.Event.USER_INTERACTION.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ShortcutInvocation 8

An event type denoting that an action equivalent to a ShortcutInfo is taken by the user.

Android reference for android.app.usage.UsageEvents.Event.SHORTCUT_INVOCATION.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

StandbyBucketChanged 11

An event type denoting a change in App Standby Bucket. The new bucket can be retrieved by calling getAppStandbyBucket().

Android reference for android.app.usage.UsageEvents.Event.STANDBY_BUCKET_CHANGED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ScreenInteractive 15

An event type denoting that the screen has gone in to an interactive state (turned on for full user interaction, not ambient display or other non-interactive state).

Android reference for android.app.usage.UsageEvents.Event.SCREEN_INTERACTIVE.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ScreenNonInteractive 16

An event type denoting that the screen has gone in to a non-interactive state (completely turned off or turned on only in a non-interactive state like ambient display).

Android reference for android.app.usage.UsageEvents.Event.SCREEN_NON_INTERACTIVE.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

KeyguardShown 17

An event type denoting that the screen's keyguard has been shown, whether or not the screen is off.

Android reference for android.app.usage.UsageEvents.Event.KEYGUARD_SHOWN.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

KeyguardHidden 18

An event type denoting that the screen's keyguard has been hidden. This typically happens when the user unlocks their phone after turning it on.

Android reference for android.app.usage.UsageEvents.Event.KEYGUARD_HIDDEN.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ForegroundServiceStart 19

An event type denoting start of a foreground service. This event has a package name and class name associated with it and can be retrieved using getPackageName() and getClassName(). If a package has multiple foreground services, this event is reported for each service that is started.

Android reference for android.app.usage.UsageEvents.Event.FOREGROUND_SERVICE_START.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ForegroundServiceStop 20

An event type denoting stop of a foreground service. This event has a package name and class name associated with it and can be retrieved using getPackageName() and getClassName(). If a package has multiple foreground services, this event is reported for each service that is stopped.

Android reference for android.app.usage.UsageEvents.Event.FOREGROUND_SERVICE_STOP.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

ActivityStopped 23

An activity becomes invisible on the UI, corresponding to Activity.onStop() of the activity's lifecycle.

Android reference for android.app.usage.UsageEvents.Event.ACTIVITY_STOPPED.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

DeviceShutdown 26

An event type denoting that the Android runtime underwent a shutdown process. A DEVICE_SHUTDOWN event should be treated as if all started activities and foreground services are now stopped and no explicit ACTIVITY_STOPPED and FOREGROUND_SERVICE_STOP events will be generated for them.

The DEVICE_SHUTDOWN timestamp is actually the last time UsageStats database is persisted before the actual shutdown. Events (if there are any) between this timestamp and the actual shutdown is not persisted in the database. So any open events without matching close events between DEVICE_SHUTDOWN and DEVICE_STARTUP should be ignored because the closing time is unknown.

Android reference for android.app.usage.UsageEvents.Event.DEVICE_SHUTDOWN.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

DeviceStartup 27

An event type denoting that the Android runtime started up. This could be after a shutdown or a runtime restart. Any open events without matching close events between DEVICE_SHUTDOWN and DEVICE_STARTUP should be ignored because the closing time is unknown.

Android reference for android.app.usage.UsageEvents.Event.DEVICE_STARTUP.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to