public final class UsageStats
extends Object implements Parcelable
| java.lang.Object | |
| android.app.usage.UsageStats | |
包含特定时间范围内应用程序包的使用情况统计信息。
Inherited constants |
|---|
android.os.Parcelable
|
Fields |
|
|---|---|
public static final Creator<UsageStats> |
CREATOR |
Public constructors |
|
|---|---|
UsageStats(UsageStats stats) |
|
公共方法(Public methods) |
|
|---|---|
void |
add(UsageStats right) 将右侧的统计数据 |
int |
describeContents() 描述此Parcelable实例的封送表示中包含的特殊对象的种类。 |
long |
getFirstTimeStamp() 获取这个 |
long |
getLastTimeStamp() 获取这个 |
long |
getLastTimeUsed() 获取这个包的最后一次使用,从时代开始以毫秒为单位测量。 |
String |
getPackageName() |
long |
getTotalTimeInForeground() 获取此软件包在前台花费的总时间,以毫秒为单位。 |
void |
writeToParcel(Parcel dest, int flags) 将此对象平铺到一个包裹中。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
android.os.Parcelable
|
|
void add (UsageStats right)
将右侧的统计数据UsageStats添加到左侧。 两个UsageStats对象的包名称必须相同。
| 参数(Parameters) | |
|---|---|
right |
UsageStats: The UsageStats object to merge into this one. |
| 抛出异常(Throws) | |
|---|---|
IllegalArgumentException |
if the package names of the two UsageStats objects are different. |
int describeContents ()
描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象将在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。
| 返回(Returns) | |
|---|---|
int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. |
long getFirstTimeStamp ()
获取这个 UsageStats表示的时间范围的开始,以时间自毫秒开始测量。
currentTimeMillis().
| 返回(Returns) | |
|---|---|
long |
|
long getLastTimeStamp ()
获得这个 UsageStats表示的时间范围的结束,以时间为单位测量,以毫秒为单位。
currentTimeMillis().
| 返回(Returns) | |
|---|---|
long |
|
long getLastTimeUsed ()
获取这个包的最后一次使用,从时代开始以毫秒为单位测量。
SeecurrentTimeMillis().
| 返回(Returns) | |
|---|---|
long |
|
long getTotalTimeInForeground ()
获取此软件包在前台花费的总时间,以毫秒为单位。
| 返回(Returns) | |
|---|---|
long |
|
void writeToParcel (Parcel dest, int flags)
将此对象平铺到一个包裹中。
| 参数(Parameters) | |
|---|---|
dest |
Parcel: The Parcel in which the object should be written. |
flags |
int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE. |