Home
last modified time | relevance | path

Searched refs:timeoutMs (Results 1 – 25 of 226) sorted by relevance

12345678910

/aosp12/frameworks/libs/net/common/testutils/devicetests/com/android/testutils/
H A DHandlerUtils.kt30 fun HandlerThread.waitForIdle(timeoutMs: Int) = threadHandler.waitForIdle(timeoutMs.toLong())
31 fun HandlerThread.waitForIdle(timeoutMs: Long) = threadHandler.waitForIdle(timeoutMs)
32 fun Handler.waitForIdle(timeoutMs: Int) = waitForIdle(timeoutMs.toLong())
33 fun Handler.waitForIdle(timeoutMs: Long) {
36 if (!cv.block(timeoutMs)) {
44 fun waitForIdleSerialExecutor(executor: Executor, timeoutMs: Long) {
47 if (!cv.block(timeoutMs)) {
H A DTestableNetworkCallback.kt176 constructor(timeoutMs: Long = DEFAULT_TIMEOUT): this(null, timeoutMs)
197 fun assertNoCallback(timeoutMs: Long) {
198 val cb = history.poll(timeoutMs)
206 timeoutMs: Long = defaultTimeoutMs
219 timeoutMs: Long = defaultTimeoutMs,
228 timeoutMs: Long = defaultTimeoutMs,
236 timeoutMs: Long = defaultTimeoutMs,
373 timeoutMs: Long = defaultTimeoutMs
386 timeoutMs: Long = defaultTimeoutMs
394 timeoutMs: Long
[all …]
H A DTapPacketReader.java83 public byte[] popPacket(long timeoutMs) { in popPacket() argument
84 return poll(timeoutMs); in popPacket()
93 public byte[] popPacket(long timeoutMs, @NonNull Predicate<byte[]> filter) { in popPacket() argument
94 return poll(timeoutMs, filter); in popPacket()
101 public byte[] poll(long timeoutMs) { in poll() argument
102 return mReadHead.getValue().poll(timeoutMs, packet -> true); in poll()
109 public byte[] poll(long timeoutMs, @NonNull Predicate<byte[]> filter) { in poll() argument
110 return mReadHead.getValue().poll(timeoutMs, filter::test); in poll()
/aosp12/packages/services/Car/car-test-lib/src/android/car/test/mocks/
H A DJavaMockitoHelper.java44 public static void await(@NonNull CountDownLatch latch, long timeoutMs) in await() argument
46 if (!latch.await(timeoutMs, TimeUnit.MILLISECONDS)) { in await()
47 throw new IllegalStateException(latch + " not called in " + timeoutMs + " ms"); in await()
58 public static void await(@NonNull Semaphore semaphore, long timeoutMs) in await() argument
60 if (!semaphore.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in await()
61 throw new IllegalStateException(semaphore + " not released in " + timeoutMs + " ms"); in await()
72 public static boolean silentAwait(@NonNull CountDownLatch latch, long timeoutMs) { in silentAwait() argument
75 called = latch.await(timeoutMs, TimeUnit.MILLISECONDS); in silentAwait()
77 Log.w(TAG, latch + " not called in " + timeoutMs + " ms"); in silentAwait()
100 public static <T> T getResult(@NonNull Future<T> future, long timeoutMs) { in getResult() argument
[all …]
H A DBlockingAnswer.java61 private BlockingAnswer(long timeoutMs, @NonNull Visitor<InvocationOnMock> invocator, in BlockingAnswer() argument
63 mTimeoutMs = timeoutMs; in BlockingAnswer()
83 public static BlockingAnswer<Void> forVoidReturn(long timeoutMs, in forVoidReturn() argument
85 return new BlockingAnswer<Void>(timeoutMs, invocator, /* value= */ null); in forVoidReturn()
96 public static <T> BlockingAnswer<T> forReturn(long timeoutMs, in forReturn() argument
98 return new BlockingAnswer<T>(timeoutMs, invocator, value); in forReturn()
/aosp12/frameworks/base/services/net/java/android/net/util/
H A DNetdService.java82 long timeoutMs = 0; in get() local
93 timeoutMs = Math.min(timeoutMs + BASE_TIMEOUT_MS, MAX_TIMEOUT_MS); in get()
94 timeoutMs = Math.min(timeoutMs, remaining); in get()
96 Thread.sleep(timeoutMs); in get()
/aosp12/frameworks/base/services/backup/java/com/android/server/backup/remote/
H A DRemoteCall.java57 public static RemoteResult execute(RemoteCallable<IBackupCallback> callable, long timeoutMs) in execute() argument
59 return new RemoteCall(callable, timeoutMs).call(); in execute()
75 public RemoteCall(RemoteCallable<IBackupCallback> callable, long timeoutMs) { in RemoteCall() argument
76 this(false, callable, timeoutMs); in RemoteCall()
86 public RemoteCall(boolean cancelled, RemoteCallable<IBackupCallback> callable, long timeoutMs) { in RemoteCall() argument
88 mTimeoutMs = timeoutMs; in RemoteCall()
/aosp12/frameworks/libs/net/common/testutils/hostdevice/com/android/net/module/util/
H A DTrackRecord.kt46 fun poll(timeoutMs: Long, pos: Int, predicate: (E) -> Boolean = { true }): E?
103 override fun poll(timeoutMs: Long, pos: Int, predicate: (E) -> Boolean) = lock.withLock {
104 elements.getOrNull(pollForIndexReadLocked(timeoutMs, pos, predicate))
115 private fun pollForIndexReadLocked(timeoutMs: Long, pos: Int, predicate: (E) -> Boolean): Int {
116 val deadline = System.currentTimeMillis() + timeoutMs
261 fun poll(timeoutMs: Long, predicate: (E) -> Boolean = { true }): E? {
266 val index = pollForIndexReadLocked(timeoutMs, readHead, predicate)
287 private fun Condition.await(timeoutMs: Long) = this.await(timeoutMs, TimeUnit.MILLISECONDS)
/aosp12/frameworks/ex/camera2/public/src/com/android/ex/camera2/blocking/
H A DBlockingSessionCallback.java139 public CameraCaptureSession waitAndGetSession(long timeoutMs) { in waitAndGetSession() argument
141 return mSessionFuture.get(timeoutMs, TimeUnit.MILLISECONDS); in waitAndGetSession()
144 String.format("Failed to get session after %s milliseconds", timeoutMs), e); in waitAndGetSession()
233 CameraCaptureSession session, Surface surface, long timeoutMs) { in waitForSurfacePrepared() argument
240 long waitTimeRemaining = timeoutMs; in waitForSurfacePrepared()
243 mPreparedSurfaces.wait(timeoutMs); in waitForSurfacePrepared()
253 "Unable to get Surface prepared in " + timeoutMs + "ms"); in waitForSurfacePrepared()
292 long timeoutMs = unit.convert(timeout, TimeUnit.MILLISECONDS); in get() local
293 if (!mCondVar.block(timeoutMs)) { in get()
H A DBlockingExtensionSessionCallback.java122 public CameraExtensionSession waitAndGetSession(long timeoutMs) { in waitAndGetSession() argument
124 return mSessionFuture.get(timeoutMs, TimeUnit.MILLISECONDS); in waitAndGetSession()
127 String.format("Failed to get session after %s milliseconds", timeoutMs), e); in waitAndGetSession()
192 long timeoutMs = unit.convert(timeout, TimeUnit.MILLISECONDS); in get() local
193 if (!mCondVar.block(timeoutMs)) { in get()
/aosp12/packages/modules/NetworkStack/common/netlinkclient/src/android/net/netlink/
H A DNetlinkSocket.java116 private static void checkTimeout(long timeoutMs) { in checkTimeout() argument
117 if (timeoutMs < 0) { in checkTimeout()
128 public static ByteBuffer recvMessage(FileDescriptor fd, int bufsize, long timeoutMs) in recvMessage() argument
130 checkTimeout(timeoutMs); in recvMessage()
132 Os.setsockoptTimeval(fd, SOL_SOCKET, SO_RCVTIMEO, StructTimeval.fromMillis(timeoutMs)); in recvMessage()
152 FileDescriptor fd, byte[] bytes, int offset, int count, long timeoutMs) in sendMessage() argument
154 checkTimeout(timeoutMs); in sendMessage()
155 Os.setsockoptTimeval(fd, SOL_SOCKET, SO_SNDTIMEO, StructTimeval.fromMillis(timeoutMs)); in sendMessage()
/aosp12/packages/services/Car/tests/android_car_api_test/src/android/car/apitest/
H A DCarApiTestBase.java130 public void waitForConnection(long timeoutMs) throws InterruptedException { in waitForConnection() argument
131 mConnectionWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS); in waitForConnection()
179 protected static void waitForLogcatMessage(String cmd, String match, int timeoutMs) { in waitForLogcatMessage() argument
195 if ((SystemClock.elapsedRealtime() - startTime) > timeoutMs) { in waitForLogcatMessage()
196 fail("match was not found, Timeout: " + timeoutMs + " ms"); in waitForLogcatMessage()
204 protected static boolean waitUntil(String msg, long timeoutMs, in waitUntil() argument
206 long deadline = SystemClock.elapsedRealtime() + timeoutMs; in waitUntil()
219 fail(msg + " after: " + timeoutMs + "ms"); in waitUntil()
/aosp12/packages/services/Car/tests/carservice_test/src/com/android/car/
H A DAppFocusTest.java67 private boolean waitForFocusChangeAndAssert(long timeoutMs, int expectedAppType, in waitForFocusChangeAndAssert() argument
69 if (!mChangeWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForFocusChangeAndAssert()
98 public boolean waitForOwnershipLossAndAssert(long timeoutMs, int expectedLossAppType) in waitForOwnershipLossAndAssert() argument
100 if (!mLossEventWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForOwnershipLossAndAssert()
107 public boolean waitForOwnershipGrantAndAssert(long timeoutMs, int expectedGrantAppType) in waitForOwnershipGrantAndAssert() argument
109 if (!mGrantEventWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForOwnershipGrantAndAssert()
/aosp12/frameworks/base/core/tests/coretests/src/android/app/activity/
H A DActivityTestsBase.java143 public int waitForResultOrThrow(int timeoutMs) { in waitForResultOrThrow() argument
144 return waitForResultOrThrow(timeoutMs, null); in waitForResultOrThrow()
147 public int waitForResultOrThrow(int timeoutMs, String expected) { in waitForResultOrThrow() argument
148 int res = waitForResult(timeoutMs, expected); in waitForResultOrThrow()
163 public int waitForResult(int timeoutMs, String expected) { in waitForResult() argument
166 long endTime = System.currentTimeMillis() + timeoutMs; in waitForResult()
/aosp12/frameworks/base/cmds/incidentd/src/
H A DSection.h44 const int64_t timeoutMs; // each section must have a timeout variable
47 Section(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS);
59 int64_t timeoutMs = 5000 /* 5 seconds */);
89 WorkerThreadSection(int id, int64_t timeoutMs = REMOTE_CALL_TIMEOUT_MS);
102 CommandSection(int id, int64_t timeoutMs, const char* command, ...);
187 TombstoneSection(int id, const char* type, int64_t timeoutMs = 120000 /* 2 minutes */);
H A DSection.cpp79 Section::Section(int i, int64_t timeoutMs) in Section() argument
81 timeoutMs(timeoutMs) { in Section()
89 FileSection::FileSection(int id, const char* filename, const int64_t timeoutMs) in FileSection() argument
90 : Section(id, timeoutMs), mFilename(filename) { in FileSection()
252 WorkerThreadSection::WorkerThreadSection(int id, const int64_t timeoutMs) in WorkerThreadSection() argument
253 : Section(id, timeoutMs) {} in WorkerThreadSection()
291 err = buffer.read(data->pipe.readFd().get(), this->timeoutMs); in Execute()
332 : Section(id, timeoutMs) { in CommandSection()
503 status_t readStatus = buffer.read(dumpPipe.readFd(), this->timeoutMs); in Execute()
586 return wait_child(pid, this->timeoutMs); in BlockingCall()
[all …]
/aosp12/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/animation/
H A DPhysicsAnimatorTestUtils.kt53 var timeoutMs: Long = 2000
73 timeoutMs = 2000
98 fun setBlockTimeout(timeoutMs: Long) {
99 PhysicsAnimatorTestUtils.timeoutMs = timeoutMs
147 latch.await(timeoutMs, TimeUnit.MILLISECONDS)
198 latch.await(timeoutMs, TimeUnit.MILLISECONDS)
462 unblockLatch.await(timeoutMs, TimeUnit.MILLISECONDS)
482 unblockLatch.await(timeoutMs, TimeUnit.MILLISECONDS)
/aosp12/frameworks/base/packages/SystemUI/src/com/android/keyguard/
H A DKeyguardAbsKeyInputViewController.java169 void onPasswordChecked(int userId, boolean matched, int timeoutMs, boolean isValidPassword) { in onPasswordChecked() argument
180 getKeyguardSecurityCallback().reportUnlockAttempt(userId, false, timeoutMs); in onPasswordChecked()
181 if (timeoutMs > 0) { in onPasswordChecked()
183 userId, timeoutMs); in onPasswordChecked()
187 if (timeoutMs == 0) { in onPasswordChecked()
233 public void onChecked(boolean matched, int timeoutMs) { in verifyPasswordAndUnlock()
238 onPasswordChecked(userId, false /* matched */, timeoutMs, in verifyPasswordAndUnlock()
/aosp12/frameworks/ex/camera2/public/src/com/android/ex/camera2/utils/
H A DStateWaiter.java97 public void waitForState(int state, long timeoutMs) { in waitForState() argument
100 waitForAnyOfStates(Arrays.asList(stateArray), timeoutMs); in waitForState() local
120 public int waitForAnyOfStates(Collection<Integer> states, final long timeoutMs) { in waitForAnyOfStates() argument
136 long timeoutLeft = timeoutMs; in waitForAnyOfStates()
160 s.append(timeoutMs); in waitForAnyOfStates()
/aosp12/frameworks/base/core/java/android/os/
H A DConditionVariable.java117 public boolean block(long timeoutMs) in block() argument
122 if (timeoutMs != 0) { in block()
125 long end = now + timeoutMs; in block()
/aosp12/frameworks/ex/camera2/portability/src/com/android/ex/camera2/portability/
H A DDispatchThread.java73 public void runJobSync(final Runnable job, Object waitLock, long timeoutMs, String jobMsg) { in runJobSync() argument
74 String timeoutMsg = "Timeout waiting " + timeoutMs + "ms for " + jobMsg; in runJobSync()
76 long timeoutBound = SystemClock.uptimeMillis() + timeoutMs; in runJobSync()
79 waitLock.wait(timeoutMs); in runJobSync()
/aosp12/packages/apps/Bluetooth/tests/unit/src/com/android/bluetooth/hfp/
H A DHeadsetTestUtils.java117 HeadsetCallState headsetCallState, int timeoutMs) { in verifyPhoneStateChangeSetters() argument
118 verify(headsetPhoneState, timeout(timeoutMs).times(1)).setNumActiveCall( in verifyPhoneStateChangeSetters()
120 verify(headsetPhoneState, timeout(timeoutMs).times(1)).setNumHeldCall( in verifyPhoneStateChangeSetters()
122 verify(headsetPhoneState, timeout(timeoutMs).times(1)).setCallState( in verifyPhoneStateChangeSetters()
/aosp12/frameworks/av/media/utils/
H A DTimeCheck.cpp67 TimeCheck::TimeCheck(const char *tag, uint32_t timeoutMs) in TimeCheck() argument
68 : mEndTimeNs(getTimeCheckThread()->startMonitoring(tag, timeoutMs)) in TimeCheck()
84 nsecs_t TimeCheck::TimeCheckThread::startMonitoring(const char *tag, uint32_t timeoutMs) { in startMonitoring() argument
86 nsecs_t endTimeNs = systemTime() + milliseconds(timeoutMs); in startMonitoring()
/aosp12/frameworks/av/media/utils/fuzzers/
H A DTimeCheckFuzz.cpp37 uint32_t timeoutMs = in LLVMFuzzerTestOneInput() local
51 android::TimeCheck timeCheck(name.c_str(), timeoutMs); in LLVMFuzzerTestOneInput()
53 uint8_t sleep_amount_ms = data_provider.ConsumeIntegralInRange<uint8_t>(0, timeoutMs / 2); in LLVMFuzzerTestOneInput()
/aosp12/frameworks/base/tests/SurfaceViewBufferTests/cpp/
H A DSurfaceProxy.cpp50 JNIEnv*, jclass, jlong jFrameNumber, jint timeoutMs) { in Java_com_android_test_SurfaceProxy_waitUntilBufferDisplayed() argument
71 timeoutMs) { in Java_com_android_test_SurfaceProxy_waitUntilBufferDisplayed()
124 jint timeoutMs) { in Java_com_android_test_SurfaceProxy_SurfaceDequeueBuffer() argument
133 if (timeoutMs == 0) { in Java_com_android_test_SurfaceProxy_SurfaceDequeueBuffer()
137 int waitResult = fence->wait(timeoutMs); in Java_com_android_test_SurfaceProxy_SurfaceDequeueBuffer()
212 JNIEnv* /* env */, jclass /* clazz */, jlong timeoutMs) { in Java_com_android_test_SurfaceProxy_SurfaceSetDequeueTimeout() argument
215 return surface->setDequeueTimeout(timeoutMs); in Java_com_android_test_SurfaceProxy_SurfaceSetDequeueTimeout()

12345678910