/frameworks/base/services/tests/powerstatstests/src/com/android/server/power/stats/ |
D | PowerStatsAggregatorTest.java | 53 private final MockClock mClock = new MockClock(); field in PowerStatsAggregatorTest 54 private final MonotonicClock mMonotonicClock = new MonotonicClock(START_TIME, mClock); 62 mock(BatteryStatsHistory.HistoryStepDetailsCalculator.class), mClock, in setup() 83 mClock.currentTime = 1222156800000L; // An important date in world history in stateUpdates() 88 mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats); in stateUpdates() 90 mHistory.recordBatteryState(mClock.realtime, mClock.uptime, 10, /* plugged */ true); in stateUpdates() 91 mHistory.recordStateStartEvent(mClock.realtime, mClock.uptime, in stateUpdates() 93 mHistory.recordProcessStateChange(mClock.realtime, mClock.uptime, TEST_UID, in stateUpdates() 100 mHistory.recordPowerStats(mClock.realtime, mClock.uptime, powerStats); in stateUpdates() 102 mHistory.recordBatteryState(mClock.realtime, mClock.uptime, 90, /* plugged */ false); in stateUpdates() [all …]
|
D | BatteryStatsHistoryTest.java | 74 private final MockClock mClock = new MockClock(); field in BatteryStatsHistoryTest 75 private final MonotonicClock mMonotonicClock = new MonotonicClock(0, mClock); 99 mClock.realtime = 123; in setUp() 102 mStepDetailsCalculator, mClock, mMonotonicClock, mTracer, mEventLogger); in setUp() 115 mHistory.recordStateStartEvent(mClock.elapsedRealtime(), in testAtraceBinaryState1() 116 mClock.uptimeMillis(), HistoryItem.STATE_MOBILE_RADIO_ACTIVE_FLAG); in testAtraceBinaryState1() 117 mHistory.recordStateStopEvent(mClock.elapsedRealtime(), in testAtraceBinaryState1() 118 mClock.uptimeMillis(), HistoryItem.STATE_MOBILE_RADIO_ACTIVE_FLAG); in testAtraceBinaryState1() 119 mHistory.recordStateStartEvent(mClock.elapsedRealtime(), in testAtraceBinaryState1() 120 mClock.uptimeMillis(), HistoryItem.STATE_MOBILE_RADIO_ACTIVE_FLAG); in testAtraceBinaryState1() [all …]
|
D | PowerStatsSchedulerTest.java | 61 private MockClock mClock = new MockClock(); field in PowerStatsSchedulerTest 62 private MonotonicClock mMonotonicClock = new MonotonicClock(0, mClock); 76 mClock.currentTime = Instant.parse("2023-01-02T03:04:05.00Z").toEpochMilli(); in setup() 77 mClock.realtime = START_REALTIME; in setup() 93 mClock, mMonotonicClock, () -> 12345L, mHandler); in setup() 104 createAggregatedPowerStats(mMonotonicClock.monotonicTime(), mClock.currentTime, in storeAggregatePowerStats() 108 mClock.realtime += delayBeforeAggregating; in storeAggregatePowerStats() 109 mClock.currentTime += delayBeforeAggregating; in storeAggregatePowerStats() 119 mClock.currentTime - (mMonotonicClock.monotonicTime() - startTime); in storeAggregatePowerStats() 121 mClock.currentTime - (mMonotonicClock.monotonicTime() - endTime); in storeAggregatePowerStats() [all …]
|
/frameworks/base/core/tests/coretests/src/com/android/internal/os/ |
D | MonotonicClockTest.java | 43 private final MockClock mClock = new MockClock(); field in MonotonicClockTest 57 MonotonicClock monotonicClock = new MonotonicClock(mFile, 1000, mClock); in persistence() 58 mClock.realtime = 234; in persistence() 64 mClock.realtime = 42; in persistence() 65 MonotonicClock newMonotonicClock = new MonotonicClock(mFile, 0, mClock); in persistence() 67 mClock.realtime = 2000; in persistence() 73 MonotonicClock monotonicClock = new MonotonicClock(null, 1000, mClock); in constructor() 74 mClock.realtime = 234; in constructor() 87 MonotonicClock monotonicClock = new MonotonicClock(mFile, 1000, mClock); in corruptedFile() 88 mClock.realtime = 234; in corruptedFile()
|
/frameworks/av/media/libstagefright/tests/fuzzers/ |
D | MediaClockFuzzer.cpp | 26 sp<MediaClock> mClock(new MediaClock); in LLVMFuzzerTestOneInput() local 33 mClock->init(); in LLVMFuzzerTestOneInput() 40 mClock->setStartingTimeMedia(startingTimeMediaUs); in LLVMFuzzerTestOneInput() 44 mClock->clearAnchor(); in LLVMFuzzerTestOneInput() 51 mClock->updateAnchor(anchorTimeMediaUs, anchorTimeRealUs, in LLVMFuzzerTestOneInput() 57 mClock->updateMaxTimeMedia(maxTimeMediaUs); in LLVMFuzzerTestOneInput() 62 mClock->setNotificationMessage(msg.promote()); in LLVMFuzzerTestOneInput()
|
/frameworks/av/media/libstagefright/rtsp/include/media/stagefright/rtsp/ |
D | TrafficRecorder.h | 43 Time mClock; variable 97 mClock = 0; in init() 105 mClock = now; in updateClock() 116 if (period > mClock) in readBytesForLastPeriod() 123 << " \t EndOfPeriod " << mClock - period in readBytesForLastPeriod() 125 if (mTimeArray[i] < mClock - period) { in readBytesForLastPeriod() 139 if (mClock == mTimeArray[mHeadIdx]) { in writeBytes() 144 mTimeArray[writeIdx] = mClock; in writeBytes() 148 LOG(VERBOSE) << "WRITE " << writeIdx << " time " << mClock; in writeBytes() 159 Time timeSinceLastPrint = mClock - mLastTimeOfPrint; in printAccuBitsForLastPeriod() [all …]
|
/frameworks/base/services/tests/servicestests/src/com/android/server/ |
D | WatchdogTest.java | 42 private TestClock mClock; field in WatchdogTest 48 mClock = new TestClock(); in setUp() 51 new HandlerChecker(mHandler, "monitor thread", new Object(), mClock) { in setUp() 84 mClock.advanceBy(5); in checkerPausedUntilDeadline() 89 mClock.advanceBy(6); in checkerPausedUntilDeadline() 100 mClock.advanceBy(5); in checkerPausedDuringScheduledRun() 106 mClock.advanceBy(11); in checkerPausedDuringScheduledRun() 116 mClock.advanceBy(6); in blockedThread() 120 mClock.advanceBy(6); in blockedThread()
|
/frameworks/base/services/tests/servicestests/src/com/android/server/am/ |
D | DropboxRateLimiterTest.java | 36 private TestClock mClock; field in DropboxRateLimiterTest 40 mClock = new TestClock(); in setUp() 41 mRateLimiter = new DropboxRateLimiter(mClock); in setUp() 74 mClock.setOffsetMillis(11 * 60 * 1000); in testBufferClearing() 99 mClock.setOffsetMillis(11 * 60 * 1000); in testRecentlyDroppedCount() 123 mClock.setOffsetMillis(11 * 60 * 1000); in testStrictRepeatedLimiting() 137 mClock.setOffsetMillis(22 * 60 * 1000); in testStrictRepeatedLimiting() 144 mClock.setOffsetMillis(43 * 60 * 1000); in testStrictRepeatedLimiting() 149 mClock.setOffsetMillis(64 * 60 * 1000); in testStrictRepeatedLimiting() 155 mClock.setOffsetMillis(75 * 60 * 1000); in testStrictRepeatedLimiting()
|
/frameworks/base/services/tests/wmtests/src/com/android/server/policy/ |
D | WindowWakeUpPolicyTests.java | 89 @Mock Clock mClock; field in WindowWakeUpPolicyTests 113 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testSupportsInputWakeDelegatse_publishesLocalService() 122 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testDoesNotSupportInputWakeDelegatse_doesNotPublishLocalService() 131 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testMotionWakeUpDelegation_wakePowerManagerIfDelegateDoesNotHandleWake() 156 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testKeyWakeUpDelegation_wakePowerManagerIfDelegateDoesNotHandleWake() 184 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testDelegatedKeyWakeIsSubjectToPolicyChecks() 199 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testDelegatedMotionWakeIsSubjectToPolicyChecks() 214 mPolicy = new WindowWakeUpPolicy(mContextSpy, mClock); in testTheaterModeChecksNotAppliedWhenScreenIsOn() 224 () -> mPolicy.wakeUpFromMotion(mClock.uptimeMillis(), SOURCE_TOUCHSCREEN, true), in testWakeUpFromMotion() 233 () -> mPolicy.wakeUpFromKey(mClock.uptimeMillis(), KEYCODE_HOME, true), in testWakeUpFromKey_nonPowerKey() [all …]
|
/frameworks/base/packages/SystemUI/tests/utils/src/com/android/systemui/util/concurrency/ |
D | FakeExecutor.java | 27 private final FakeSystemClock mClock; field in FakeExecutor 40 mClock = clock; in FakeExecutor() 41 mClock.addListener(() -> { in FakeExecutor() 59 if (!mQueuedRunnables.isEmpty() && mQueuedRunnables.peek().mWhen <= mClock.uptimeMillis()) { in runNextReady() 102 long startTime = mClock.uptimeMillis(); in advanceClockToNext() 126 long startTime = mClock.uptimeMillis(); in advanceClockToLast() 149 return executeAtTime(r, mClock.uptimeMillis() + unit.toMillis(delay)); in executeDelayed() 190 mClock.setUptimeMillis(nextTime); in updateClock()
|
/frameworks/base/location/java/android/location/ |
D | GnssMeasurementsEvent.java | 41 private final GnssClock mClock; field in GnssMeasurementsEvent 137 mClock = clock; in GnssMeasurementsEvent() 147 return mClock; in getClock() 218 parcel.writeParcelable(mClock, flags); in writeToParcel() 227 builder.append(mClock); in toString() 240 private GnssClock mClock; field in GnssMeasurementsEvent.Builder 249 mClock = new GnssClock(); in Builder() 260 mClock = event.getClock(); in Builder() 272 mClock = clock; in setClock() 355 return new GnssMeasurementsEvent(mFlag, mClock, mMeasurements, mGnssAgcs, in build()
|
D | GpsMeasurementsEvent.java | 58 private final GpsClock mClock; field in GpsMeasurementsEvent 91 mClock = clock; in GpsMeasurementsEvent() 98 return mClock; in getClock() 137 parcel.writeParcelable(mClock, flags); in writeToParcel() 151 builder.append(mClock.toString()); in toString()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coalescer/ |
D | GroupCoalescerTest.java | 71 private final FakeSystemClock mClock = new FakeSystemClock(); field in GroupCoalescerTest 72 private final FakeExecutor mExecutor = new FakeExecutor(mClock); 81 mClock, in setUp() 100 mClock.advanceTime(MIN_LINGER_DURATION); in testUngroupedNotificationsAreNotCoalesced() 148 mClock.advanceTime(2); in testCoalescedNotificationsArePosted() 156 mClock.advanceTime(3); in testCoalescedNotificationsArePosted() 169 mClock.advanceTime(MIN_LINGER_DURATION); in testCoalescedNotificationsArePosted() 220 mClock.advanceTime(MIN_LINGER_DURATION); in testCoalescedEventsThatAreLaterUngroupedAreEmittedImmediatelyAndNotLater() 233 mClock.advanceTime(2); in testUpdatingCoalescedNotifTriggersBatchEmit() 239 mClock.advanceTime(4); in testUpdatingCoalescedNotifTriggersBatchEmit() [all …]
|
/frameworks/base/core/tests/utiltests/src/com/android/internal/util/ |
D | PersistentServiceConnectionTest.java | 84 private OffsettableClock mClock; field in PersistentServiceConnectionTest 90 mClock = new OffsettableClock.Stopped(); in setup() 91 mHandler = spy(new TestHandler(null, mClock)); in setup() 103 new TestInjector(mClock)); in setup() 105 mClock.fastForward(1000); in setup() 189 mClock.fastForward(millis); in advanceTime() 194 private final OffsettableClock mClock; field in PersistentServiceConnectionTest.TestInjector 197 mClock = clock; in TestInjector() 202 return mClock.now(); in uptimeMillis()
|
/frameworks/base/packages/SystemUI/tests/src/com/android/keyguard/ |
D | KeyguardClockSwitchTest.java | 68 ClockController mClock; field in KeyguardClockSwitchTest 91 when(mClock.getSmallClock()).thenReturn(mSmallClock); in setUp() 92 when(mClock.getLargeClock()).thenReturn(mLargeClock); in setUp() 131 mKeyguardClockSwitch.setClock(mClock, StatusBarState.KEYGUARD); in pluginConnectedThenDisconnected_showNothing() 142 mKeyguardClockSwitch.setClock(mClock, StatusBarState.KEYGUARD); in onPluginConnected_showClock() 144 assertEquals(mClock.getSmallClock().getView().getParent(), mSmallClockFrame); in onPluginConnected_showClock() 145 assertEquals(mClock.getLargeClock().getView().getParent(), mLargeClockFrame); in onPluginConnected_showClock() 158 mKeyguardClockSwitch.setClock(mClock, StatusBarState.KEYGUARD); in onPluginConnected_showSecondPluginClock() 164 assertThat(mClock.getSmallClock().getView().getParent()).isNull(); in onPluginConnected_showSecondPluginClock() 165 assertThat(mClock.getLargeClock().getView().getParent()).isNull(); in onPluginConnected_showSecondPluginClock() [all …]
|
/frameworks/base/services/tests/displayservicetests/src/com/android/server/display/ |
D | AutomaticBrightnessControllerTest.java | 87 private OffsettableClock mClock = new OffsettableClock(); field in AutomaticBrightnessControllerTest 131 mClock = new OffsettableClock.Stopped(); in setupController() 132 mTestLooper = new TestLooper(mClock::now); in setupController() 157 return mClock.now(); in setupController() 162 return mClock.now() + ANDROID_SLEEP_TIME; in setupController() 622 mClock.fastForward(increment); in testAmbientLightHorizon() 626 mClock.fastForward(increment); in testAmbientLightHorizon() 631 mClock.fastForward(increment); in testAmbientLightHorizon() 637 mClock.fastForward(increment); in testAmbientLightHorizon() 643 mClock.fastForward(increment); in testAmbientLightHorizon() [all …]
|
/frameworks/base/packages/SystemUI/src/com/android/keyguard/ |
D | KeyguardClockSwitch.java | 99 private ClockController mClock; field in KeyguardClockSwitch 173 if (mClock != null) { in setLargeClockOnSecondaryDisplay() 174 mClock.getLargeClock().getEvents().onSecondaryDisplayChanged(onSecondaryDisplay); in setLargeClockOnSecondaryDisplay() 232 if (mClock == null) { in getClockId() 235 return mClock.getConfig().getId(); in getClockId() 239 mClock = clock; in setClock() 272 if (mClock != null) { in updateClockTargetRegions() 275 mClock.getSmallClock().getEvents().onTargetRegionChanged(targetRegion); in updateClockTargetRegions() 280 if (mClock instanceof DefaultClockController) { in updateClockTargetRegions() 281 mClock.getLargeClock().getEvents().onTargetRegionChanged( in updateClockTargetRegions() [all …]
|
/frameworks/base/services/core/java/com/android/server/selinux/ |
D | RateLimiter.java | 38 private final Clock mClock; field in RateLimiter 43 mClock = clock; in RateLimiter() 61 Instant now = Instant.ofEpochMilli(mClock.currentTimeMillis()); in acquire() 77 final Instant now = Instant.ofEpochMilli(mClock.currentTimeMillis()); in tryAcquire()
|
/frameworks/base/core/java/com/android/internal/os/ |
D | MonotonicClock.java | 51 private final Clock mClock; field in MonotonicClock 65 mClock = clock; in MonotonicClock() 68 mTimeshift = read(monotonicTime - mClock.elapsedRealtime()); in MonotonicClock() 71 mTimeshift = monotonicTime - mClock.elapsedRealtime(); in MonotonicClock() 80 return monotonicTime(mClock.elapsedRealtime()); in monotonicTime() 142 return savedTimeshift - mClock.elapsedRealtime(); in readXml()
|
/frameworks/base/packages/SystemUI/multivalentTests/src/com/android/systemui/dreams/complication/ |
D | HideComplicationTouchHandlerTest.java | 82 FakeSystemClock mClock; field in HideComplicationTouchHandlerTest 89 mClock = new FakeSystemClock(); in setup() 90 mFakeExecutor = new FakeExecutor(mClock); in setup() 120 mClock.advanceTime(HIDE_DELAY); in testSessionEndOnMultipleSessions() 153 mClock.advanceTime(HIDE_DELAY); in testSessionEndWhenBouncerShowing() 202 mClock.advanceTime(HIDE_DELAY); in testSessionEndWithTouchInInset() 252 mClock.advanceTime(HIDE_DELAY); in testSessionLifecycle() 264 mClock.advanceTime(RESTORE_TIMEOUT); in testSessionLifecycle() 295 mClock.advanceTime(HIDE_DELAY); in testNoActionWhenDisabledByFlag()
|
/frameworks/base/packages/SystemUI/src/com/android/systemui/tuner/ |
D | ClockPreference.java | 33 private final String mClock; field in ClockPreference 43 mClock = context.getString(com.android.internal.R.string.status_bar_clock); in ClockPreference() 65 mClockEnabled = !mHideList.contains(mClock); in onTuningChanged() 90 mHideList.add(mClock); in persistString() 92 mHideList.remove(mClock); in persistString()
|
/frameworks/base/services/tests/wmtests/src/com/android/server/wm/ |
D | PendingRemoteAnimationRegistryTest.java | 51 private final OffsettableClock mClock = new OffsettableClock.Stopped(); field in PendingRemoteAnimationRegistryTest 58 mHandler = new TestHandler(null, mClock); in setUp() 96 mClock.fastForward(5000); in testTimeout() 104 mClock.fastForward(2500); in testTimeout_overridenEntry() 107 mClock.fastForward(1000); in testTimeout_overridenEntry()
|
/frameworks/base/services/core/java/com/android/server/power/ |
D | ScreenUndimDetector.java | 94 private InternalClock mClock; field in ScreenUndimDetector 97 mClock = new InternalClock(); in ScreenUndimDetector() 101 mClock = clock; in ScreenUndimDetector() 149 final long now = mClock.getCurrentTime(); in recordScreenPolicy() 172 mUndimOccurredTime = mClock.getCurrentTime(); in recordScreenPolicy() 277 mInteractionAfterUndimTime = mClock.getCurrentTime(); in userActivity() 290 long now = mClock.getCurrentTime(); in checkAndLogUndim()
|
/frameworks/native/services/surfaceflinger/Scheduler/ |
D | OneShotTimer.cpp | 45 : mClock(std::move(clock)), in OneShotTimer() 51 LOG_ALWAYS_FATAL_IF(!mClock, "Clock must not be provided"); in OneShotTimer() 118 auto triggerTime = mClock->now() + mInterval.load(); in loop() 137 if (const auto triggerInterval = triggerTime - mClock->now(); triggerInterval > 0ns) { in loop() 155 if (!mPaused && state == TimerState::WAITING && (triggerTime - mClock->now()) <= 0ns) { in loop() 187 mLastResetTime = mClock->now(); in reset()
|
/frameworks/opt/net/wifi/libs/WifiTrackerLib/src/com/android/wifitrackerlib/ |
D | ScanResultUpdater.java | 39 private final Clock mClock; field in ScanResultUpdater 56 mClock = clock; in ScanResultUpdater() 97 if (mClock.millis() - result.timestamp / 1000 <= maxScanAgeMillis) { in getScanResults() 108 mClock.millis() - entry.getValue().timestamp / 1000 > mMaxScanAgeMillis); in evictOldScans()
|