Home
last modified time | relevance | path

Searched refs:tryAcquire (Results 1 – 25 of 59) sorted by relevance

123

/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/
DThrottlerTest.java73 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isTrue(); in testTryAcquire_skdName()
74 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isFalse(); in testTryAcquire_skdName()
77 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk2")).isTrue(); in testTryAcquire_skdName()
83 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isTrue(); in testTryAcquire_skdName()
84 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk2")).isTrue(); in testTryAcquire_skdName()
95 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, "app1")) in testTryAcquire_appPackageName()
97 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, "app1")) in testTryAcquire_appPackageName()
100 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isTrue(); in testTryAcquire_appPackageName()
103 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, "app2")) in testTryAcquire_appPackageName()
110 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, "app1")) in testTryAcquire_appPackageName()
[all …]
/packages/services/Car/tests/CarServiceTest/src/com/android/car/
DCarHvacManagerTest.java189 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
190 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
191 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
192 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
193 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
204 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
217 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
230 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
243 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testUnregisterCallback()
244 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testUnregisterCallback()
[all …]
DCarProjectionManagerTest.java88 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testShortPressListener()
100 assertTrue(mLongAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testLongPressListener()
113 assertTrue(mLongAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testMixedPressListener()
119 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testMixedPressListener()
DCarCabinManagerTest.java147 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
148 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
159 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
172 assertTrue(mAvailable.tryAcquire(2L, TimeUnit.SECONDS)); in testEvent()
DAppFocusTest.java71 if (!mChangeWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForFocusChangeAndAssert()
/packages/apps/Launcher3/quickstep/tests/multivalentTests/src/com/android/quickstep/
DAllAppsActionManagerTest.kt77 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in destroyManager()
84 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in homeAndOverviewSame_actionRegistered()
91 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in toggleTaskbar_destroyedAfterActionRegistered_actionUnregistered()
104 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in toggleTaskbar_destroyedBeforeActionRegistered_pendingActionUnregistered()
111 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in changeHome_sameAsOverviewBeforeActionUnregistered_actionRegisteredAgain()
115 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in changeHome_sameAsOverviewBeforeActionUnregistered_actionRegisteredAgain()
139 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in taskbarPresent_userSetupCompleted_actionRegistered()
149 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in taskbarPresent_setupUiDismissed_actionRegistered()
/packages/modules/AdServices/adservices/apk/java/com/android/adservices/ui/settings/
DDialogManager.java52 if (!sSemaphore.tryAcquire()) return; in showOptOutDialog()
79 if (!sSemaphore.tryAcquire()) return; in showBlockTopicDialog()
107 if (!sSemaphore.tryAcquire()) return; in showUnblockTopicDialog()
130 if (!sSemaphore.tryAcquire()) return; in showResetTopicDialog()
163 if (!sSemaphore.tryAcquire()) return; in showBlockAppDialog()
193 if (!sSemaphore.tryAcquire()) return; in showUnblockAppDialog()
213 if (!sSemaphore.tryAcquire()) return; in showResetAppDialog()
/packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/statsd/
DFederatedComputeStatsdLogger.java57 if (mRateLimiter.tryAcquire()) { in logApiCallStats()
70 if (mRateLimiter.tryAcquire()) { in logTraceEventStats()
84 if (mRateLimiter.tryAcquire()) { in logTrainingEventReported()
107 if (mRateLimiter.tryAcquire()) { in recordExampleIteratorLatencyMetrics()
/packages/apps/Camera2/src/com/android/camera/one/v2/sharedimagereader/ringbuffer/
DDynamicRingBuffer.java122 return mTicketPool.tryAcquire(); in tryAcquireLowPriorityTicket()
179 public Ticket tryAcquire() { in tryAcquire() method in DynamicRingBuffer
185 return mTicketPool.tryAcquire(); in tryAcquire()
/packages/services/Car/tests/CarServiceTest/src/com/android/car/power/
DCarPowerManagementServiceTest.java501 if (completionSemaphore.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testSleepShutdownFromPreShutdownPrepare()
523 assertThat(eventWaitSemaphore.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testSleepShutdownFromPreShutdownPrepare()
564 if (completionSemaphore.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testShutdownImmediatelyFromPreShutdownPrepare()
586 assertThat(eventWaitSemaphore.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testShutdownImmediatelyFromPreShutdownPrepare()
647 if (!notificationSem.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testShutdownPostponeWhileListenerPendingInState()
782 mDisplayStateWait.tryAcquire(MockedCarTestBase.SHORT_WAIT_TIMEOUT_MS, in waitForDisplayState()
891 if (!mSubscriptionWaitSemaphore.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForSubscription()
899 if (!mSetWaitSemaphore.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForStateSetAndGetAll()
944 if (!mSetWaitSemaphore.tryAcquire(STATE_TRANSITION_MAX_WAIT_MS, in sendStateAndExpectNoResponse()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/
DThrottler.java162 public boolean tryAcquire(ApiKey apiKey, String requester) { in tryAcquire() method in Throttler
173 return rateLimiter.tryAcquire(); in tryAcquire()
288 boolean unused = rateLimiter.tryAcquire(); in create()
DFledgeApiThrottleFilter.java55 boolean isThrottled = !mThrottler.tryAcquire(apiKey, callerPackageName); in assertCallerNotThrottled()
/packages/modules/AdServices/adservices/tests/unittest/service-core/protectedaudience/src/com/android/adservices/service/common/
DFledgeApiThrottleFilterTest.java59 when(mThrottlerMock.tryAcquire(any(), anyString())).thenReturn(true); in testAssertCallerNotThrottled_notThrottled_doesNotThrowOrLogError()
76 when(mThrottlerMock.tryAcquire(any(), anyString())).thenReturn(false); in testAssertCallerNotThrottled_throttled_throwsAndLogsError()
/packages/services/Car/tests/CarServiceTest/src/com/android/car/evs/
DCarEvsManagerTest.java126 mFrameReceivedSignal.tryAcquire(FRAME_TIMEOUT_MS, TimeUnit.MILLISECONDS) in testStartAndStopVideoStream()
196 if (!mStreamEventOccurred.tryAcquire(STREAM_EVENT_TIMEOUT_SEC, in waitForStreamEvent()
/packages/apps/Camera2/src/com/android/camera/one/v2/sharedimagereader/ticketpool/
DTicketProvider.java30 public Ticket tryAcquire(); in tryAcquire() method
DTicketPool.java68 public Ticket tryAcquire(); in tryAcquire() method
DFiniteTicketPool.java170 public Ticket tryAcquire() { in tryAcquire() method in FiniteTicketPool
/packages/apps/Settings/src/com/android/settings/network/ims/
DBooleanConsumer.java43 tryAcquire(timeout, TimeUnit.MILLISECONDS); in get()
DIntegerConsumer.java43 tryAcquire(timeout, TimeUnit.MILLISECONDS); in get()
/packages/apps/Camera2/src/com/android/camera/one/v2/sharedimagereader/
DTicketRequiredFilter.java44 Ticket ticket = mTicketProvider.tryAcquire(); in update()
/packages/apps/Camera2/src/com/android/camera/util/
DConcurrentSharedRingBuffer.java245 if (mCapacitySemaphore.tryAcquire()) { in swapLeast()
359 if (mPinSemaphore.tryAcquire()) { in tryPin()
/packages/services/Car/libs/car-test-lib/src/android/car/test/mocks/
DJavaMockitoHelper.java65 if (!semaphore.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in await()
/packages/modules/AdServices/adservices/tests/unittest/service-core/appsetid/src/com/android/adservices/service/appsetid/
DAppSetIdServiceImplTest.java118 when(mMockThrottler.tryAcquire( in setup()
148 when(mMockThrottler.tryAcquire( in checkThrottler_rateLimitReached_forAppPackageName()
/packages/modules/AdServices/adservices/tests/unittest/service-core/adid/src/com/android/adservices/service/adid/
DAdIdServiceImplTest.java134 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME), anyString())) in setup()
162 when(mMockThrottler.tryAcquire(eq(Throttler.ApiKey.ADID_API_APP_PACKAGE_NAME), anyString())) in checkThrottler_rateLimitReached_forAppPackageName()
/packages/services/Car/tests/CarServiceTest/src/com/android/car/input/
DCarInputManagerTest.java155 mStateChangeWait.tryAcquire(EVENT_WAIT_TIME, TimeUnit.MILLISECONDS)).isTrue(); in waitForStateChange()
160 mKeyEventWait.tryAcquire(EVENT_WAIT_TIME, TimeUnit.MILLISECONDS)).isTrue(); in waitForKeyEvent()
165 mRotaryEventWait.tryAcquire(EVENT_WAIT_TIME, TimeUnit.MILLISECONDS)).isTrue(); in waitForRotaryEvent()
170 mCustomInputEventWait.tryAcquire( in waitForCustomInputEvent()

123