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 |
| Unit |
writeToParcel(dest: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<UsageEventsQuery!> | |
Public methods
describeContents
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
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
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. |
getEventTypes
fun getEventTypes(): IntArray
Retrieves the usage event types for the query.
Note that an empty array indicates querying all usage event types, and it may cause additional system overhead when calling UsageStatsManager.queryEvents(UsageEventsQuery). Apps are encouraged to provide a list of event types via Builder.setEventTypes(int...)
getPackageNames
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
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:
|