Methods Summary |
---|
public void | addDays(int val)
mTime += val * DAY_IN_MILLIS;
|
public void | addMonths(int val)
mTime += val * MONTH_IN_MILLIS;
|
public void | addWeeks(int val)
mTime += val * WEEK_IN_MILLIS;
|
public void | addYears(int val)
mTime += val * YEAR_IN_MILLIS;
|
public long | getTimeInMillis()
return mTime;
|
public void | setTimeInMillis(long time)
mTime = time;
|
public static void | truncateTo(com.android.server.usage.UnixCalendar calendar, int intervalType)
switch (intervalType) {
case UsageStatsManager.INTERVAL_YEARLY:
calendar.truncateToYear();
break;
case UsageStatsManager.INTERVAL_MONTHLY:
calendar.truncateToMonth();
break;
case UsageStatsManager.INTERVAL_WEEKLY:
calendar.truncateToWeek();
break;
case UsageStatsManager.INTERVAL_DAILY:
calendar.truncateToDay();
break;
default:
throw new UnsupportedOperationException("Can't truncate date to interval " +
intervalType);
}
|
public void | truncateToDay()
mTime -= mTime % DAY_IN_MILLIS;
|
public void | truncateToMonth()
mTime -= mTime % MONTH_IN_MILLIS;
|
public void | truncateToWeek()
mTime -= mTime % WEEK_IN_MILLIS;
|
public void | truncateToYear()
mTime -= mTime % YEAR_IN_MILLIS;
|