public static final class UsageEvents.Event extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CONFIGURATION_CHANGE
An event type denoting that the device configuration has changed.
|
static int |
CONTINUE_PREVIOUS_DAY
An event type denoting that a component was in the foreground the previous day.
|
static int |
END_OF_DAY
An event type denoting that a component was in the foreground when the stats
rolled-over.
|
String |
mClass |
Configuration |
mConfiguration
Only present for
CONFIGURATION_CHANGE event types. |
int |
mEventType |
static int |
MOVE_TO_BACKGROUND
An event type denoting that a component moved to the background.
|
static int |
MOVE_TO_FOREGROUND
An event type denoting that a component moved to the foreground.
|
String |
mPackage |
String |
mShortcutId
ID of the shortcut.
|
long |
mTimeStamp |
static int |
NONE
No event type.
|
static int |
SHORTCUT_INVOCATION
An event type denoting that an action equivalent to a ShortcutInfo is taken by the user.
|
static int |
SYSTEM_INTERACTION
An event type denoting that a package was interacted with in some way by the system.
|
static int |
USER_INTERACTION
An event type denoting that a package was interacted with in some way by the user.
|
Constructor and Description |
---|
Event() |
Modifier and Type | Method and Description |
---|---|
String |
getClassName()
The class name of the source of this event.
|
Configuration |
getConfiguration()
Returns a
Configuration for this event if the event is of type
CONFIGURATION_CHANGE , otherwise it returns null. |
int |
getEventType()
The event type.
|
String |
getPackageName()
The package name of the source of this event.
|
String |
getShortcutId()
Returns the ID of a
ShortcutInfo for this event
if the event is of type SHORTCUT_INVOCATION , otherwise it returns null. |
long |
getTimeStamp()
The time at which this event occurred, measured in milliseconds since the epoch.
|
public static final int NONE
public static final int MOVE_TO_FOREGROUND
public static final int MOVE_TO_BACKGROUND
public static final int END_OF_DAY
MOVE_TO_BACKGROUND
.
public static final int CONTINUE_PREVIOUS_DAY
MOVE_TO_FOREGROUND
.
public static final int CONFIGURATION_CHANGE
public static final int SYSTEM_INTERACTION
public static final int USER_INTERACTION
public static final int SHORTCUT_INVOCATION
public String mPackage
public String mClass
public long mTimeStamp
public int mEventType
public Configuration mConfiguration
CONFIGURATION_CHANGE
event types.
public String mShortcutId
SHORTCUT_INVOCATION
event types.
public String getPackageName()
public String getClassName()
public long getTimeStamp()
System.currentTimeMillis()
.public int getEventType()
MOVE_TO_BACKGROUND
See MOVE_TO_FOREGROUND
public Configuration getConfiguration()
Configuration
for this event if the event is of type
CONFIGURATION_CHANGE
, otherwise it returns null.public String getShortcutId()
ShortcutInfo
for this event
if the event is of type SHORTCUT_INVOCATION
, otherwise it returns null.