Added in API level 35

UsageEventsQuery


class UsageEventsQuery : Parcelable
kotlin.Any
   ↳ android.app.usage.UsageEventsQuery

An Object-Oriented representation for a UsageEvents query. Used by UsageStatsManager.queryEvents(UsageEventsQuery) call.

Summary

Nested classes

Builder for UsageEventsQuery.

Inherited constants
Public methods
Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation.

Long

Returns the inclusive timestamp to indicate the beginning of the range of events.

Long

Returns the exclusive timestamp to indicate the end of the range of events.

IntArray

Retrieves the usage event types for the query.

MutableSet<String!>

Retrieves a Set of package names for the query.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<UsageEventsQuery!>

Public methods

describeContents

Added in API level 35
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

getBeginTimeMillis

Added in API level 35
fun getBeginTimeMillis(): Long

Returns the inclusive timestamp to indicate the beginning of the range of events. Defined in terms of "Unix time", see java.lang.System#currentTimeMillis.
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

Return
Long Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

getEndTimeMillis

Added in API level 35
fun getEndTimeMillis(): Long

Returns the exclusive timestamp to indicate the end of the range of events. Defined in terms of "Unix time", see java.lang.System#currentTimeMillis.
Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

Return
Long Value is a non-negative timestamp measured as the number of milliseconds since 1970-01-01T00:00:00Z.

getPackageNames

Added in API level 35
fun getPackageNames(): MutableSet<String!>

Retrieves a Set of package names for the query.

Note that an empty set indicates querying usage events for all packages, and it may cause additional system overhead when calling UsageStatsManager.queryEvents(UsageEventsQuery). Apps are encouraged to provide a list of package names via Builder.setPackageNames(String...)

Return
MutableSet<String!> a Set contains the package names that was previously set through Builder.setPackageNames(String...) or an empty set if no value has been set.
This value cannot be null.

writeToParcel

Added in API level 35
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 35
static val CREATOR: Parcelable.Creator<UsageEventsQuery!>