Home
last modified time | relevance | path

Searched refs:unit (Results 1 – 25 of 184) sorted by relevance

12345678

/packages/apps/DocumentsUI/tests/common/com/android/documentsui/testing/
DTestScheduledExecutorService.java71 public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { in awaitTermination() argument
98 TimeUnit unit) throws InterruptedException { in invokeAll() argument
109 public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) in invokeAny() argument
120 public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { in schedule() argument
121 TestFuture future = new TestFuture(command, delay, unit); in schedule()
127 public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { in schedule() argument
133 TimeUnit unit) { in scheduleAtFixedRate() argument
139 long delay, TimeUnit unit) { in scheduleWithFixedDelay() argument
186 final TimeUnit unit; field in TestScheduledExecutorService.TestFuture
188 public TestFuture(Runnable runnable, long delay, TimeUnit unit) { in TestFuture() argument
[all …]
DLatchedConsumer.java32 public void assertNotCalled(long timeout, TimeUnit unit) in assertNotCalled() argument
34 assertFalse(latch.await(timeout, unit)); in assertNotCalled()
37 public void assertCalled(long timeout, TimeUnit unit) in assertCalled() argument
39 assertTrue(latch.await(timeout, unit)); in assertCalled()
/packages/apps/Contacts/src/com/android/contacts/util/concurrent/
DContactsExecutors.java111 public ScheduledFuture<?> schedule(final Runnable command, long delay, TimeUnit unit) { in schedule() argument
113 .fromRunnable(mHandler, delay, unit, command); in schedule()
114 mHandler.postDelayed(future, unit.toMillis(delay)); in schedule()
120 public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { in schedule() argument
121 final HandlerFuture<V> future = new HandlerFuture<>(mHandler, delay, unit, callable); in schedule()
122 mHandler.postDelayed(future, unit.toMillis(delay)); in schedule()
129 long period, TimeUnit unit) { in scheduleAtFixedRate() argument
136 long delay, TimeUnit unit) { in scheduleWithFixedDelay() argument
160 public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException { in awaitTermination() argument
192 public long getDelay(TimeUnit unit) { in getDelay() argument
[all …]
DFuturesUtil.java27 TimeUnit unit, Handler handler) { in withTimeout() argument
28 return withTimeout(future, time, unit, ContactsExecutors.newHandlerExecutor(handler)); in withTimeout()
40 TimeUnit unit, ScheduledExecutorService executor) { in withTimeout() argument
48 }, time, unit); in withTimeout()
/packages/services/Telephony/tests/src/com/android/
DTestExecutorService.java76 public T get(long timeout, TimeUnit unit) in get() argument
79 return mFuture.get(timeout, unit); in get()
83 public long getDelay(TimeUnit unit) { in getDelay() argument
84 if (unit == TimeUnit.MILLISECONDS) { in getDelay()
154 public boolean awaitTermination(long timeout, TimeUnit unit) { in awaitTermination() argument
188 TimeUnit unit) { in invokeAll() argument
198 public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) { in invokeAny() argument
203 public ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit) { in schedule() argument
204 long millisDelay = TimeUnit.MILLISECONDS.convert(delay, unit); in schedule()
214 public <V> ScheduledFuture<V> schedule(Callable<V> callable, long delay, TimeUnit unit) { in schedule() argument
[all …]
/packages/apps/Car/Settings/src/com/android/car/settings/units/
DUnitsFuelConsumptionPreferenceController.java48 protected String generateSummaryFromUnit(Unit unit) { in generateSummaryFromUnit() argument
49 return getAbbreviationByVolumeUnit(unit); in generateSummaryFromUnit()
53 protected String generateEntryStringFromUnit(Unit unit) { in generateEntryStringFromUnit() argument
54 return getContext().getString(R.string.units_list_entry, getAbbreviationByVolumeUnit(unit), in generateEntryStringFromUnit()
55 getPronouncedNameByVolumeUnit(unit)); in generateEntryStringFromUnit()
58 private String getAbbreviationByVolumeUnit(Unit unit) { in getAbbreviationByVolumeUnit() argument
60 switch (unit.getId()) { in getAbbreviationByVolumeUnit()
81 private String getPronouncedNameByVolumeUnit(Unit unit) { in getPronouncedNameByVolumeUnit() argument
83 switch (unit.getId()) { in getPronouncedNameByVolumeUnit()
DUnitsEnergyConsumptionPreferenceController.java51 protected String generateSummaryFromUnit(Unit unit) { in generateSummaryFromUnit() argument
52 return getAbbreviationByUnit(unit); in generateSummaryFromUnit()
56 protected String generateEntryStringFromUnit(Unit unit) { in generateEntryStringFromUnit() argument
58 switch (unit.getId()) { in generateEntryStringFromUnit()
66 return getContext().getString(R.string.units_list_entry, getAbbreviationByUnit(unit), in generateEntryStringFromUnit()
71 private String getAbbreviationByUnit(Unit unit) { in getAbbreviationByUnit() argument
74 getContext().getString(unit.getAbbreviationResId())); in getAbbreviationByUnit()
DUnitsBasePreferenceController.java145 Unit unit = mSupportedUnits[i]; in getEntriesOfSupportedUnits() local
146 names[i] = generateEntryStringFromUnit(unit); in getEntriesOfSupportedUnits()
151 protected String generateSummaryFromUnit(Unit unit) { in generateSummaryFromUnit() argument
152 return getContext().getString(unit.getAbbreviationResId()); in generateSummaryFromUnit()
155 protected String generateEntryStringFromUnit(Unit unit) { in generateEntryStringFromUnit() argument
158 getContext().getString(unit.getAbbreviationResId()), in generateEntryStringFromUnit()
159 getContext().getString(unit.getNameResId())), in generateEntryStringFromUnit()
DCarUnitsManager.java108 Unit unit = UnitsMap.MAP.get(unitId); in getUnitsSupportedByProperty() local
109 units.add(unit); in getUnitsSupportedByProperty()
115 Unit unit = UnitsMap.MAP.get(unitId); in getUnitsSupportedByProperty() local
116 result[i] = unit; in getUnitsSupportedByProperty()
/packages/apps/UniversalMediaPlayer/java/com/android/pump/concurrent/
DUniqueExecutor.java37 @NonNull TimeUnit unit, @NonNull BlockingQueue<Runnable> workQueue) { in UniqueExecutor() argument
38 super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue); in UniqueExecutor()
42 @NonNull TimeUnit unit, @NonNull BlockingQueue<Runnable> workQueue, in UniqueExecutor() argument
44 super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory); in UniqueExecutor()
48 @NonNull TimeUnit unit, @NonNull BlockingQueue<Runnable> workQueue, in UniqueExecutor() argument
50 super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, handler); in UniqueExecutor()
54 @NonNull TimeUnit unit, @NonNull BlockingQueue<Runnable> workQueue, in UniqueExecutor() argument
56 super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue, threadFactory, in UniqueExecutor()
/packages/apps/Dialer/java/com/android/incallui/autoresizetext/
DAutoResizeTextView.java94 public final void setTextSize(int unit, float size) { in setTextSize() argument
95 float maxTextSize = TypedValue.applyDimension(unit, size, displayMetrics); in setTextSize()
115 public final void setMinTextSize(int unit, float size) { in setMinTextSize() argument
116 float minTextSize = TypedValue.applyDimension(unit, size, displayMetrics); in setMinTextSize()
134 public final void setResizeStepUnit(int unit) { in setResizeStepUnit() argument
135 if (resizeStepUnit != unit) { in setResizeStepUnit()
136 resizeStepUnit = unit; in setResizeStepUnit()
/packages/apps/TV/tests/common/src/com/android/tv/testing/fakes/
DFakeClock.java72 public void increment(TimeUnit unit) { in increment() argument
73 increment(unit, 1); in increment()
82 public void increment(TimeUnit unit, long amount) { in increment() argument
83 mCurrentTimeMillis += unit.toMillis(amount); in increment()
/packages/services/Car/tests/DiagnosticTools/src/com/google/android/car/diagnostictools/
DLiveDataAdapter.java81 public SensorDataWrapper(String name, String unit, float number) { in SensorDataWrapper() argument
83 this.mUnit = unit; in SensorDataWrapper()
87 public SensorDataWrapper(String name, String unit, String number) { in SensorDataWrapper() argument
89 this.mUnit = unit; in SensorDataWrapper()
/packages/apps/TvSettings/SettingsAPI/java/com/android/tv/settings/library/util/
DStringUtil.java133 final RelativeDateTimeFormatter.RelativeUnit unit; in formatRelativeTime() local
138 unit = RelativeDateTimeFormatter.RelativeUnit.MINUTES; in formatRelativeTime()
142 unit = RelativeDateTimeFormatter.RelativeUnit.HOURS; in formatRelativeTime()
146 unit = RelativeDateTimeFormatter.RelativeUnit.DAYS; in formatRelativeTime()
158 return formatter.format(value, RelativeDateTimeFormatter.Direction.LAST, unit); in formatRelativeTime()
/packages/modules/Virtualization/tests/benchmark/
Dfs_benchmark.cpp179 const char* unit = "bytes"; in main() local
182 unit = "KB"; in main()
186 unit = "MB"; in main()
190 unit = "GB"; in main()
192 std::printf("(%.3g %s/s)\n", speed, unit); in main()
/packages/modules/Virtualization/microdroid_manager/src/
Dinstance.rs251 fn round_to_multiple(n: u64, unit: u64) -> Result<u64> { in round_to_multiple()
252 assert!((unit & (unit - 1)) == 0, "{} is not power of two", unit); in round_to_multiple()
253 let ret = (n + unit - 1) & !(unit - 1); in round_to_multiple()
/packages/apps/StorageManager/tests/unit/
DREADME8 $ adb shell am instrument -w com.android.storagemanager.tests.unit/androidx.test.runner.AndroidJUni…
11 …class com.android.storagemanager.<class> com.android.storagemanager.tests.unit/androidx.test.runne…
14 …om.android.storagemanager.<class>#<test> com.android.storagemanager.tests.unit/androidx.test.runne…
/packages/apps/Car/Cluster/ClusterOsDouble/src/com/android/car/cluster/view/
DNavStateController.java366 String unit = ""; in formatDistance() local
370 unit = "m"; in formatDistance()
373 unit = "km"; in formatDistance()
376 unit = "mi"; in formatDistance()
379 unit = "yd"; in formatDistance()
382 unit = "ft"; in formatDistance()
385 return String.format("In %s %s", distance.getDisplayValue(), unit); in formatDistance()
/packages/apps/Car/Cluster/DirectRenderingCluster/src/android/car/cluster/
DNavStateController.java368 String unit = ""; in formatDistance() local
372 unit = "m"; in formatDistance()
375 unit = "km"; in formatDistance()
378 unit = "mi"; in formatDistance()
381 unit = "yd"; in formatDistance()
384 unit = "ft"; in formatDistance()
387 return String.format("In %s %s", distance.getDisplayValue(), unit); in formatDistance()
/packages/modules/Connectivity/nearby/service/java/com/android/server/nearby/common/bluetooth/util/
DBluetoothOperationExecutor.java474 public T get(long timeoutMillis, TimeUnit unit) in get() argument
476 return getInternal(Math.max(0, timeoutMillis), unit); in get()
481 private T getInternal(long timeoutMillis, TimeUnit unit) in getInternal() argument
497 - (mTimeProvider.getTimeMillis() - startTime), unit)) { in getInternal()
500 mBluetoothOperation, timeoutMillis, unit)); in getInternal()
511 timeoutMillis - (mTimeProvider.getTimeMillis() - startTime), unit); in getInternal()
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/role/utils/
DUiUtils.java49 public static float dpToPx(@Dimension(unit = Dimension.DP) float dp, @NonNull Context context) { in dpToPx()
64 public static int dpToPxOffset(@Dimension(unit = Dimension.DP) float dp, in dpToPxOffset()
79 public static int dpToPxSize(@Dimension(unit = Dimension.DP) float dp, in dpToPxSize()
/packages/modules/Bluetooth/system/gd/docs/architecture/
Dstyle_guide.md44 * One build target for all unit tests (i.e. one cc_test)
84 * Header, source code, and unit test should live in the same directory with
104 * alarm_test.cc: unit test for alarm.h
114 * hci_hal_android_hidl_test.cc: unit tests for the Android HIDL
120 * hci_hal_host_test.cc: unit tests for the socket based HAL (root-canal)
143 * data_pipeline_manager_mock.h: Mock of this class, used in unit tests
146 * dynamic_channel_allocator_test.cc: GTest unit test of this class
/packages/apps/Settings/tests/unit/
DREADME20 $ adb shell am instrument -w com.android.settings.tests.unit/androidx.test.runner.AndroidJUnitRunner
23 $ adb shell am instrument -w -e class com.android.settings.<class> com.android.settings.tests.unit/…
26 …w -e class com.android.settings.<class>#<test> com.android.settings.tests.unit/androidx.test.runne…
/packages/apps/DocumentsUI/tests/
DAndroid.bp32 "unit/**/*.java",
40 "unit/**/*.java",
75 "unit/**/*.java",
/packages/modules/DnsResolver/
DREADME-DoT.md42 annotations) to minimize the likelihood of a latent threading bug. The unit tests are
114 For unit testing, we would like to be able to mock out `DnsTlsSocket`. This is
115 particularly required for unit testing of `DnsTlsDispatcher` and `DnsTlsTransport`.
116 To make these unit tests possible, this code uses a dependency injection pattern:
121 which in production is a `DnsTlsSocketFactory`. However, in unit tests, we can
122 substitute a test factory that returns a fake socket, so that the unit tests can

12345678