Methods Summary |
---|
public void | add(android.app.usage.UsageStats right)Add the statistics from the right {@link UsageStats} to the left. The package name for
both {@link UsageStats} objects must be the same.
if (!mPackageName.equals(right.mPackageName)) {
throw new IllegalArgumentException("Can't merge UsageStats for package '" +
mPackageName + "' with UsageStats for package '" + right.mPackageName + "'.");
}
if (right.mEndTimeStamp > mEndTimeStamp) {
mLastEvent = right.mLastEvent;
mEndTimeStamp = right.mEndTimeStamp;
mLastTimeUsed = right.mLastTimeUsed;
}
mBeginTimeStamp = Math.min(mBeginTimeStamp, right.mBeginTimeStamp);
mTotalTimeInForeground += right.mTotalTimeInForeground;
mLaunchCount += right.mLaunchCount;
|
public int | describeContents()
return 0;
|
public long | getFirstTimeStamp()Get the beginning of the time range this {@link android.app.usage.UsageStats} represents,
measured in milliseconds since the epoch.
See {@link System#currentTimeMillis()}.
return mBeginTimeStamp;
|
public long | getLastTimeStamp()Get the end of the time range this {@link android.app.usage.UsageStats} represents,
measured in milliseconds since the epoch.
See {@link System#currentTimeMillis()}.
return mEndTimeStamp;
|
public long | getLastTimeUsed()Get the last time this package was used, measured in milliseconds since the epoch.
See {@link System#currentTimeMillis()}.
return mLastTimeUsed;
|
public java.lang.String | getPackageName()
return mPackageName;
|
public long | getTotalTimeInForeground()Get the total time this package spent in the foreground, measured in milliseconds.
return mTotalTimeInForeground;
|
public void | writeToParcel(android.os.Parcel dest, int flags)
dest.writeString(mPackageName);
dest.writeLong(mBeginTimeStamp);
dest.writeLong(mEndTimeStamp);
dest.writeLong(mLastTimeUsed);
dest.writeLong(mTotalTimeInForeground);
dest.writeInt(mLaunchCount);
dest.writeInt(mLastEvent);
|