use of android.text.format.Time in project android_frameworks_base by ResurrectionRemix.
the class TimeTest method testSet1.
@SmallTest
public void testSet1() throws Exception {
Time t = new Time(Time.TIMEZONE_UTC);
t.set(1, 2, 3, 4, 5, 6);
// System.out.println("t=" + t);
}
use of android.text.format.Time in project android_frameworks_base by ResurrectionRemix.
the class TimeTest method testNormalize0.
@SmallTest
public void testNormalize0() throws Exception {
Time t = new Time(Time.TIMEZONE_UTC);
t.parse("20060432T010203");
t.normalize(false);
// System.out.println("got: " + t.year + '-'
// + t.month + '-' + t.monthDay
// + ' ' + t.hour + ':' + t.minute
// + ':' + t.second
// + "( " + t.isDst + ',' + t.gmtoff
// + ',' + t.weekDay
// + ',' + t.yearDay + ')');
}
use of android.text.format.Time in project android_frameworks_base by ResurrectionRemix.
the class NetworkPolicyEditor method buildDefaultPolicy.
@Deprecated
private static NetworkPolicy buildDefaultPolicy(NetworkTemplate template) {
// TODO: move this into framework to share with NetworkPolicyManagerService
final int cycleDay;
final String cycleTimezone;
final boolean metered;
if (template.getMatchRule() == MATCH_WIFI) {
cycleDay = CYCLE_NONE;
cycleTimezone = Time.TIMEZONE_UTC;
metered = false;
} else {
final Time time = new Time();
time.setToNow();
cycleDay = time.monthDay;
cycleTimezone = time.timezone;
metered = true;
}
return new NetworkPolicy(template, cycleDay, cycleTimezone, WARNING_DISABLED, LIMIT_DISABLED, SNOOZE_NEVER, SNOOZE_NEVER, metered, true);
}
use of android.text.format.Time in project android_frameworks_base by ResurrectionRemix.
the class NetworkPolicyManagerServiceTest method formatTime.
private static String formatTime(long millis) {
final Time time = new Time(Time.TIMEZONE_UTC);
time.set(millis);
return time.format3339(false);
}
use of android.text.format.Time in project android_frameworks_base by ResurrectionRemix.
the class NetworkPolicyManagerServiceTest method parseTime.
private static long parseTime(String time) {
final Time result = new Time();
result.parse3339(time);
return result.toMillis(true);
}
Aggregations