Home
last modified time | relevance | path

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

123

/packages/modules/AdServices/adservices/tests/unittest/service-core/src/com/android/adservices/service/common/
DThrottlerTest.java51 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isTrue(); in testTryAcquire_skdName()
52 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isFalse(); in testTryAcquire_skdName()
55 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk2")).isTrue(); in testTryAcquire_skdName()
61 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isTrue(); in testTryAcquire_skdName()
62 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk2")).isTrue(); in testTryAcquire_skdName()
73 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, "app1")) in testTryAcquire_appPackageName()
75 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, "app1")) in testTryAcquire_appPackageName()
78 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_SDK_NAME, "sdk1")).isTrue(); in testTryAcquire_appPackageName()
81 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, "app2")) in testTryAcquire_appPackageName()
88 assertThat(throttler.tryAcquire(Throttler.ApiKey.TOPICS_API_APP_PACKAGE_NAME, "app1")) in testTryAcquire_appPackageName()
[all …]
DFledgeApiThrottleFilterTest.java58 when(mThrottlerMock.tryAcquire(any(), anyString())).thenReturn(true); in testAssertCallerNotThrottled_notThrottled_doesNotThrowOrLogError()
70 when(mThrottlerMock.tryAcquire(any(), anyString())).thenReturn(false); in testAssertCallerNotThrottled_throttled_throwsAndLogsError()
/packages/services/Car/tests/carservice_test/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()
DCarEvsManagerTest.java124 mFrameReceivedSignal.tryAcquire(FRAME_TIMEOUT_MS, TimeUnit.MILLISECONDS) in testStartAndStopVideoStream()
194 if (!mStreamEventOccurred.tryAcquire(STREAM_EVENT_TIMEOUT_SEC, in waitForStreamEvent()
DAppFocusTest.java71 if (!mChangeWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForFocusChangeAndAssert()
/packages/apps/Launcher3/quickstep/tests/multivalentTests/src/com/android/quickstep/
DAllAppsActionManagerTest.kt50 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in taskbarPresent_actionRegistered()
57 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in homeAndOverviewSame_actionRegistered()
64 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in toggleTaskbar_destroyedAfterActionRegistered_actionUnregistered()
77 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in toggleTaskbar_destroyedBeforeActionRegistered_pendingActionUnregistered()
84 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in changeHome_sameAsOverviewBeforeActionUnregistered_actionRegisteredAgain()
88 assertThat(callbackSemaphore.tryAcquire(TIMEOUT, SECONDS)).isTrue() in changeHome_sameAsOverviewBeforeActionUnregistered_actionRegisteredAgain()
/packages/modules/AdServices/adservices/apk/java/com/android/adservices/ui/settings/
DDialogManager.java52 if (!sSemaphore.tryAcquire()) return; in showOptOutDialog()
78 if (!sSemaphore.tryAcquire()) return; in showBlockTopicDialog()
105 if (!sSemaphore.tryAcquire()) return; in showUnblockTopicDialog()
127 if (!sSemaphore.tryAcquire()) return; in showResetTopicDialog()
159 if (!sSemaphore.tryAcquire()) return; in showBlockAppDialog()
188 if (!sSemaphore.tryAcquire()) return; in showUnblockAppDialog()
207 if (!sSemaphore.tryAcquire()) return; in showResetAppDialog()
/packages/modules/OnDevicePersonalization/federatedcompute/src/com/android/federatedcompute/services/statsd/
DFederatedComputeStatsdLogger.java56 if (mRateLimiter.tryAcquire()) { in logApiCallStats()
72 if (mRateLimiter.tryAcquire()) { in logTrainingEventReported()
95 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/modules/AdServices/adservices/service-core/java/com/android/adservices/service/common/
DThrottler.java157 public boolean tryAcquire(ApiKey apiKey, String requester) { in tryAcquire() method in Throttler
169 return rateLimiter.tryAcquire(); in tryAcquire()
234 boolean unused = rateLimiter.tryAcquire(); in create()
DFledgeApiThrottleFilter.java52 boolean isThrottled = !mThrottler.tryAcquire(apiKey, callerPackageName); in assertCallerNotThrottled()
/packages/services/Car/tests/carservice_test/src/com/android/car/power/
DCarPowerManagementTest.java499 if (completionSemaphore.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testSleepShutdownFromPreShutdownPrepare()
521 assertThat(eventWaitSemaphore.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testSleepShutdownFromPreShutdownPrepare()
562 if (completionSemaphore.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testShutdownImmediatelyFromPreShutdownPrepare()
584 assertThat(eventWaitSemaphore.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testShutdownImmediatelyFromPreShutdownPrepare()
645 if (!notificationSem.tryAcquire(DEFAULT_WAIT_TIMEOUT_MS, in testShutdownPostponeWhileListenerPendingInState()
786 mDisplayStateWait.tryAcquire(MockedCarTestBase.SHORT_WAIT_TIMEOUT_MS, in waitForDisplayState()
895 if (!mSubscriptionWaitSemaphore.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForSubscription()
903 if (!mSetWaitSemaphore.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForStateSetAndGetAll()
948 if (!mSetWaitSemaphore.tryAcquire(STATE_TRANSITION_MAX_WAIT_MS, in sendStateAndExpectNoResponse()
/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
/packages/apps/Settings/src/com/android/settings/network/ims/
DIntegerConsumer.java43 tryAcquire(timeout, TimeUnit.MILLISECONDS); in get()
DBooleanConsumer.java43 tryAcquire(timeout, TimeUnit.MILLISECONDS); in get()
/packages/services/Car/tests/android_car_api_test/src/android/car/apitest/
DCarAppFocusManagerTest.java325 if (!mChangeWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForFocusChangeAndAssert()
366 if (!mLossEventWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForOwnershipLossAndAssert()
375 if (!mGrantEventWait.tryAcquire(timeoutMs, TimeUnit.MILLISECONDS)) { in waitForOwnershipGrantAndAssert()
/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/modules/IntentResolver/tests/unit/src/com/android/intentresolver/contentpreview/
DImagePreviewImageLoaderTest.kt229 override fun tryAcquire(): Boolean { in invoke_semaphoreGuardsContentResolverCalls() method
267 override fun tryAcquire(): Boolean { in invoke_semaphoreIsReleasedAfterContentResolverFailure() method
/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.java126 when(mMockThrottler.tryAcquire( in setup()
156 when(mMockThrottler.tryAcquire( in checkThrottler_rateLimitReached_forAppPackageName()
/packages/modules/AdServices/adservices/service-core/java/com/android/adservices/service/topics/
DTopicsServiceImpl.java247 ? !mThrottler.tryAcquire( in isThrottled()
250 : !mThrottler.tryAcquire( in isThrottled()

123