Home
last modified time | relevance | path

Searched refs:DateUtils (Results 1 – 25 of 122) sorted by relevance

12345

/frameworks/base/core/tests/coretests/src/android/text/format/
DDateUtilsTest.java65 assertEquals("0 seconds", DateUtils.formatDuration(0)); in test_formatDuration_seconds()
66 assertEquals("0 seconds", DateUtils.formatDuration(1)); in test_formatDuration_seconds()
67 assertEquals("0 seconds", DateUtils.formatDuration(499)); in test_formatDuration_seconds()
68 assertEquals("1 second", DateUtils.formatDuration(500)); in test_formatDuration_seconds()
69 assertEquals("1 second", DateUtils.formatDuration(1000)); in test_formatDuration_seconds()
70 assertEquals("2 seconds", DateUtils.formatDuration(1500)); in test_formatDuration_seconds()
72 assertEquals("0 seconds", DateUtils.formatDuration(0, DateUtils.LENGTH_LONG)); in test_formatDuration_seconds()
73 assertEquals("1 second", DateUtils.formatDuration(1000, DateUtils.LENGTH_LONG)); in test_formatDuration_seconds()
74 assertEquals("2 seconds", DateUtils.formatDuration(1500, DateUtils.LENGTH_LONG)); in test_formatDuration_seconds()
76 assertEquals("0 sec", DateUtils.formatDuration(0, DateUtils.LENGTH_SHORT)); in test_formatDuration_seconds()
[all …]
DDateIntervalFormatTest.java22 import static android.text.format.DateUtils.FORMAT_12HOUR;
23 import static android.text.format.DateUtils.FORMAT_24HOUR;
24 import static android.text.format.DateUtils.FORMAT_ABBREV_ALL;
25 import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
26 import static android.text.format.DateUtils.FORMAT_ABBREV_TIME;
27 import static android.text.format.DateUtils.FORMAT_ABBREV_WEEKDAY;
28 import static android.text.format.DateUtils.FORMAT_NO_MONTH_DAY;
29 import static android.text.format.DateUtils.FORMAT_NO_YEAR;
30 import static android.text.format.DateUtils.FORMAT_NUMERIC_DATE;
31 import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
[all …]
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/utils/
DStringUtilTest.java26 import android.text.format.DateUtils;
46 final double testMillis = 5 * DateUtils.MINUTE_IN_MILLIS + 30 * DateUtils.SECOND_IN_MILLIS; in testFormatElapsedTime_WithSeconds_ShowSeconds()
55 final double testMillis = 5 * DateUtils.MINUTE_IN_MILLIS + 30 * DateUtils.SECOND_IN_MILLIS; in testFormatElapsedTime_NoSeconds_DoNotShowSeconds()
64 final double testMillis = 2 * DateUtils.DAY_IN_MILLIS in testFormatElapsedTime_TimeMoreThanOneDay_ShowCorrectly()
65 + 4 * DateUtils.HOUR_IN_MILLIS + 15 * DateUtils.MINUTE_IN_MILLIS; in testFormatElapsedTime_TimeMoreThanOneDay_ShowCorrectly()
74 final double testMillis = 2 * DateUtils.DAY_IN_MILLIS + 15 * DateUtils.MINUTE_IN_MILLIS; in testFormatElapsedTime_ZeroFieldsInTheMiddleDontShow()
101 final double testMillis = 15 * DateUtils.MINUTE_IN_MILLIS; in testFormatElapsedTime_onlyContainsMinute_hasTtsSpan()
117 final double testMillis = 40 * DateUtils.SECOND_IN_MILLIS; in testFormatRelativeTime_WithSeconds_ShowSeconds()
126 final double testMillis = 40 * DateUtils.SECOND_IN_MILLIS; in testFormatRelativeTime_NoSeconds_DoNotShowSeconds()
135 final double testMillis = 119 * DateUtils.SECOND_IN_MILLIS; in testFormatRelativeTime_LessThanTwoMinutes_withSeconds()
[all …]
/frameworks/base/core/java/android/text/format/
DDateUtilsBridge.java19 import static android.text.format.DateUtils.FORMAT_12HOUR;
20 import static android.text.format.DateUtils.FORMAT_24HOUR;
21 import static android.text.format.DateUtils.FORMAT_ABBREV_ALL;
22 import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
23 import static android.text.format.DateUtils.FORMAT_ABBREV_TIME;
24 import static android.text.format.DateUtils.FORMAT_ABBREV_WEEKDAY;
25 import static android.text.format.DateUtils.FORMAT_NO_MONTH_DAY;
26 import static android.text.format.DateUtils.FORMAT_NO_YEAR;
27 import static android.text.format.DateUtils.FORMAT_NUMERIC_DATE;
28 import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
[all …]
DRelativeDateTimeFormatter.java19 import static android.text.format.DateUtils.FORMAT_ABBREV_ALL;
20 import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
21 import static android.text.format.DateUtils.FORMAT_ABBREV_RELATIVE;
22 import static android.text.format.DateUtils.FORMAT_NO_YEAR;
23 import static android.text.format.DateUtils.FORMAT_NUMERIC_DATE;
24 import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
25 import static android.text.format.DateUtils.FORMAT_SHOW_TIME;
26 import static android.text.format.DateUtils.FORMAT_SHOW_YEAR;
/frameworks/opt/timezonepicker/src/com/android/timezonepicker/
DTimeZoneInfo.java22 import android.text.format.DateUtils;
130 final long nowMinute = System.currentTimeMillis() / DateUtils.MINUTE_IN_MILLIS; in getGmtDisplayName()
131 final long now = nowMinute * DateUtils.MINUTE_IN_MILLIS; in getGmtDisplayName()
137 cacheKey = (int) (gmtOffset + 36 * DateUtils.HOUR_IN_MILLIS); in getGmtDisplayName()
139 cacheKey = (int) (gmtOffset - 36 * DateUtils.HOUR_IN_MILLIS); in getGmtDisplayName()
152 int flags = DateUtils.FORMAT_ABBREV_ALL; in getGmtDisplayName()
153 flags |= DateUtils.FORMAT_SHOW_TIME; in getGmtDisplayName()
155 flags |= DateUtils.FORMAT_24HOUR; in getGmtDisplayName()
159 DateUtils.formatDateRange(context, mFormatter, now, now, flags, mTzId); in getGmtDisplayName()
DTimeZonePickerUtils.java24 import android.text.format.DateUtils;
131 sb.append(p / DateUtils.HOUR_IN_MILLIS); // Hour in appendGmtOffset()
133 final int min = (p / (int) DateUtils.MINUTE_IN_MILLIS) % 60; in appendGmtOffset()
/frameworks/base/packages/SystemUI/src/com/android/systemui/doze/
DAlwaysOnDisplayPolicy.java27 import android.text.format.DateUtils;
40 private static final long DEFAULT_PROX_SCREEN_OFF_DELAY_MS = 10 * DateUtils.SECOND_IN_MILLIS;
41 private static final long DEFAULT_PROX_COOLDOWN_TRIGGER_MS = 2 * DateUtils.SECOND_IN_MILLIS;
42 private static final long DEFAULT_PROX_COOLDOWN_PERIOD_MS = 5 * DateUtils.SECOND_IN_MILLIS;
43 private static final long DEFAULT_WALLPAPER_VISIBILITY_MS = 60 * DateUtils.SECOND_IN_MILLIS;
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/doze/
DAlwaysOnDisplayPolicyTest.java22 import android.text.format.DateUtils;
65 assertThat(policy.proxScreenOffDelayMs).isEqualTo(10 * DateUtils.SECOND_IN_MILLIS); in testPolicy_valueNull_containsDefaultValue()
66 assertThat(policy.proxCooldownTriggerMs).isEqualTo(2 * DateUtils.SECOND_IN_MILLIS); in testPolicy_valueNull_containsDefaultValue()
67 assertThat(policy.proxCooldownPeriodMs).isEqualTo(5 * DateUtils.SECOND_IN_MILLIS); in testPolicy_valueNull_containsDefaultValue()
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/
DNetworkCycleDataLoaderTest.java37 import android.text.format.DateUtils;
145 final long fourWeeksAgo = now - (DateUtils.WEEK_IN_MILLIS * 4); in loadFourWeeksData_shouldRecordUsageForLast4Weeks()
146 final long twoDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 2); in loadFourWeeksData_shouldRecordUsageForLast4Weeks()
159 final long tenDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 10); in loadDataForSpecificCycles_shouldRecordUsageForSpecifiedTime()
160 final long twentyDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 20); in loadDataForSpecificCycles_shouldRecordUsageForSpecifiedTime()
161 final long thirtyDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 30); in loadDataForSpecificCycles_shouldRecordUsageForSpecifiedTime()
DNetworkCycleDataForUidLoaderTest.java34 import android.text.format.DateUtils;
71 final long start = end - (DateUtils.WEEK_IN_MILLIS * 4); in recordUsage_shouldQueryNetworkDetailsForUidAndForegroundState()
89 final long start = end - (DateUtils.WEEK_IN_MILLIS * 4); in recordUsage_retrieveDetailIsFalse_shouldNotQueryNetworkForegroundState()
103 final long start = end - (DateUtils.WEEK_IN_MILLIS * 4); in recordUsage_multipleUids_shouldQueryNetworkDetailsForEachUid()
DNetworkCycleChartDataLoaderTest.java28 import android.text.format.DateUtils;
64 final long start = end - (DateUtils.WEEK_IN_MILLIS * 4); in recordUsage_shouldQueryNetworkSummaryForDevice()
/frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/
DMetricsCollector.java19 import static android.text.format.DateUtils.HOUR_IN_MILLIS;
20 import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
21 import static android.text.format.DateUtils.SECOND_IN_MILLIS;
DModemPowerMetrics.java22 import android.text.format.DateUtils;
51 / ((double) DateUtils.HOUR_IN_MILLIS); in buildProto()
74 / ((double) DateUtils.HOUR_IN_MILLIS); in buildProto()
/frameworks/base/services/core/java/com/android/server/notification/
DCountdownConditionProvider.java30 import android.text.format.DateUtils;
126 DateUtils.getRelativeTimeSpanString(mTime, now, DateUtils.MINUTE_IN_MILLIS); in onSubscribe()
171 DateUtils.getRelativeTimeSpanString(time, now, DateUtils.MINUTE_IN_MILLIS); in tryParseDescription()
/frameworks/base/core/tests/coretests/src/com/android/internal/util/
DTokenBucketTest.java20 import android.text.format.DateUtils;
58 drain(new TokenBucket((int) DateUtils.MINUTE_IN_MILLIS, 50), 50); in testInitialCapacity()
59 drain(new TokenBucket((int) DateUtils.HOUR_IN_MILLIS, 10), 10); in testInitialCapacity()
60 drain(new TokenBucket((int) DateUtils.DAY_IN_MILLIS, 200), 200); in testInitialCapacity()
/frameworks/base/tests/LocationTracker/src/com/android/locationtracker/data/
DDateUtils.java25 public class DateUtils { class
27 private DateUtils() { in DateUtils() method in DateUtils
/frameworks/opt/net/wifi/service/java/com/android/server/wifi/
DWifiPowerMetrics.java22 import android.text.format.DateUtils;
68 / ((double) DateUtils.HOUR_IN_MILLIS); in buildProto()
80 / ((double) DateUtils.HOUR_IN_MILLIS); in buildProto()
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/net/
DDataUsageController.java24 import static android.text.format.DateUtils.FORMAT_ABBREV_MONTH;
25 import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
40 import android.text.format.DateUtils;
135 start = now - DateUtils.WEEK_IN_MILLIS * 4; in getDataUsageInfo()
275 return DateUtils.formatDateRange(mContext, PERIOD_FORMATTER, start, end, flags, null) in formatDateRange()
/frameworks/base/packages/Shell/src/com/android/shell/
DRemoteBugreportReceiver.java33 import android.text.format.DateUtils;
49 private static final long MIN_KEEP_AGE = DateUtils.DAY_IN_MILLIS;
DBugreportReceiver.java32 import android.text.format.DateUtils;
50 private static final long MIN_KEEP_AGE = DateUtils.WEEK_IN_MILLIS;
/frameworks/base/location/java/com/android/internal/location/gnssmetrics/
DGnssMetrics.java24 import android.text.format.DateUtils;
387 + stats.getLoggingDurationMs() / ((double) DateUtils.MINUTE_IN_MILLIS)).append("\n"); in dumpGnssMetricsAsText()
392 " dB-Hz (min): ").append(t[1] / ((double) DateUtils.MINUTE_IN_MILLIS)).append("\n"); in dumpGnssMetricsAsText()
395 " dB-Hz (min): ").append(t[0] / ((double) DateUtils.MINUTE_IN_MILLIS)).append("\n"); in dumpGnssMetricsAsText()
398 stats.getEnergyConsumedMaMs() / ((double) DateUtils.HOUR_IN_MILLIS)).append("\n"); in dumpGnssMetricsAsText()
534 p.energyConsumedMah = stats.getEnergyConsumedMaMs() / ((double) DateUtils.HOUR_IN_MILLIS); in buildProto()
/frameworks/base/core/tests/utiltests/src/com/android/internal/util/
DFileRotatorTest.java19 import static android.text.format.DateUtils.DAY_IN_MILLIS;
20 import static android.text.format.DateUtils.HOUR_IN_MILLIS;
21 import static android.text.format.DateUtils.MINUTE_IN_MILLIS;
22 import static android.text.format.DateUtils.SECOND_IN_MILLIS;
23 import static android.text.format.DateUtils.WEEK_IN_MILLIS;
24 import static android.text.format.DateUtils.YEAR_IN_MILLIS;
/frameworks/base/core/java/android/widget/
DAnalogClock.java28 import android.text.format.DateUtils;
275 final int flags = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_24HOUR; in updateContentDescription()
276 String contentDescription = DateUtils.formatDateTime(mContext, timeMillis, flags); in updateContentDescription()
/frameworks/base/services/contentsuggestions/java/com/android/server/contentsuggestions/
DRemoteContentSuggestionsService.java32 import android.text.format.DateUtils;
44 private static final long TIMEOUT_REMOTE_REQUEST_MILLIS = 2 * DateUtils.SECOND_IN_MILLIS;

12345