/aosp14/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ |
H A D | ScheduleConditionProviderTest.java | 84 Calendar now = getNow(); in testEvaluateSubscription_noAlarmExit_InSchedule() local 101 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 1000); in testEvaluateSubscription_noAlarmExit_InSchedule() 108 Calendar now = getNow(); in testEvaluateSubscription_noAlarmExit_InScheduleSnoozed() local 127 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 1000); in testEvaluateSubscription_noAlarmExit_InScheduleSnoozed() 155 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 1000); in testEvaluateSubscription_noAlarmExit_beforeSchedule() 178 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 1000); in testEvaluateSubscription_noAlarmExit_endSchedule() 199 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 1000); in testEvaluateSubscription_alarmSetBeforeInSchedule() 252 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 2000); in testEvaluateSubscription_earlierAlarmSet() 281 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 500); in testEvaluateSubscription_laterAlarmSet() 310 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 500); in testEvaluateSubscription_alarmCanceled() [all …]
|
/aosp14/frameworks/base/core/java/com/android/internal/app/procstats/ |
H A D | ServiceState.java | 223 public void resetSafely(long now) { in resetSafely() argument 259 mRunStartTime = now; in commitStateTime() 264 mStartedStartTime = now; in commitStateTime() 269 mBoundStartTime = now; in commitStateTime() 274 mExecStartTime = now; in commitStateTime() 295 mRunStartTime = now; in updateRunning() 324 mStartedStartTime = now; in updateStartedState() 350 mBoundStartTime = now; in setBound() 368 mExecStartTime = now; in setExecuting() 392 long now) { in getDuration() argument [all …]
|
H A D | UidState.java | 75 updateCombinedState(now); in updateCombinedState() 83 public void updateCombinedState(long now) { in updateCombinedState() argument 110 if (now >= 0) { in setCombinedStateInner() 111 commitStateTime(now); in setCombinedStateInner() 135 public void commitStateTime(long now) { in commitStateTime() argument 137 long dur = now - mStartTime; in commitStateTime() 142 mTotalRunningStartTime = now; in commitStateTime() 144 mStartTime = now; in commitStateTime() 150 public void resetSafely(long now) { in resetSafely() argument 152 mStartTime = now; in resetSafely() [all …]
|
H A D | AssociationState.java | 151 return now; in start() 154 long start(long now) { in start() argument 157 if (now < 0) { in start() 163 return now; in start() 176 long stop(long now) { in stop() argument 179 if (now < 0) { in stop() 183 stopTracking(now); in stop() 185 return now; in stop() 286 stopActive(now); in stopActiveIfNecessary() 361 stopActive(now); in stopTracking() [all …]
|
H A D | ProcessState.java | 197 long now) { in ProcessState() argument 205 mStartTime = now; in ProcessState() 207 mTotalRunningStartTime = now; in ProcessState() 213 public ProcessState clone(long now) { in clone() argument 298 public void resetSafely(long now) { in resetSafely() argument 301 mStartTime = now; in resetSafely() 494 commitStateTime(now); in setCombinedStateIdv() 529 mStartTime = now; in commitStateTime() 780 time += now - mStartTime; in getDuration() 943 long now, long totalTime) { in dumpSummary() argument [all …]
|
/aosp14/frameworks/base/services/core/java/com/android/server/am/ |
H A D | BaseAppStateDurationsTracker.java | 108 return durations.getTotalDurations(now, index); in getTotalDurations() 132 return durations.getTotalDurations(now, index); in getTotalDurations() 136 long getTotalDurations(int uid, long now, int index) { in getTotalDurations() argument 140 long getTotalDurations(int uid, long now) { in getTotalDurations() argument 212 events.dump(pw, " " + prefix, now); in dumpEventLocked() 217 bgEvents.dump(pw, " " + prefix, now); in dumpEventLocked() 220 events.dump(pw, " " + prefix, now); in dumpEventLocked() 239 void addEvent(boolean active, long now) { in addEvent() argument 243 long getTotalDurations(long now) { in getTotalDurations() argument 244 return getTotalDurations(now, DEFAULT_INDEX); in getTotalDurations() [all …]
|
/aosp14/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/ |
H A D | JobPackageTracker.java | 162 long getTotalTime(long now) { in getTotalTime() argument 455 void rebatchIfNeeded(long now) { in rebatchIfNeeded() argument 469 job.madePending = now; in notePending() 470 rebatchIfNeeded(now); in notePending() 477 rebatchIfNeeded(now); in noteNonpending() 482 job.madeActive = now; in noteActive() 483 rebatchIfNeeded(now); in noteActive() 501 rebatchIfNeeded(now); in noteInactive() 526 time += cur.getActiveTime(now) + cur.getPendingTime(now); in getLoadFactor() 530 time += last.getActiveTime(now) + last.getPendingTime(now); in getLoadFactor() [all …]
|
/aosp14/frameworks/base/services/core/java/com/android/server/pm/ |
H A D | SnapshotStatistics.java | 314 private Stats(long now) { in Stats() argument 315 mStartTimeUs = now; in Stats() 521 mLong[0] = new Stats(now); in SnapshotStatistics() 523 mShort[0] = new Stats(now); in SnapshotStatistics() 524 mLastLogTimeUs = now; in SnapshotStatistics() 591 private void shift(Stats[] s, long now) { in shift() argument 592 s[0].complete(now); in shift() 596 s[0] = new Stats(now); in shift() 613 shift(mLong, now); in tick() 614 mLastLogTimeUs = now; in tick() [all …]
|
/aosp14/frameworks/base/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/ |
H A D | MidiBtleTimeTracker.java | 40 public MidiBtleTimeTracker(long now) { in MidiBtleTimeTracker() argument 42 mBaseHostTimeNanos = now; in MidiBtleTimeTracker() 43 mPreviousNow = now; in MidiBtleTimeTracker() 53 public long convertTimestampToNanotime(int timestamp, long now) { in convertTimestampToNanotime() argument 63 if ((now - mPreviousNow) > (RANGE_NANOS / 2)) { in convertTimestampToNanotime() 65 long minimumTimeNanos = (now - mBaseHostTimeNanos) in convertTimestampToNanotime() 78 if (timestampHostNanos > now) { in convertTimestampToNanotime() 80 mBaseHostTimeNanos = now; in convertTimestampToNanotime() 81 timestampHostNanos = now; in convertTimestampToNanotime() 84 long windowBottom = now - mWindowNanos; in convertTimestampToNanotime() [all …]
|
/aosp14/frameworks/base/services/tests/servicestests/src/com/android/server/tare/ |
H A D | LedgerTest.java | 182 new Ledger.Transaction(now + 2 * HOUR_IN_MILLIS, now + 3 * HOUR_IN_MILLIS, in test24HourSum() 221 now - 48 * HOUR_IN_MILLIS, now - 40 * HOUR_IN_MILLIS, 1, null, 4800, 0); in testRemoveOldTransactions() 223 now - 24 * HOUR_IN_MILLIS, now - 23 * HOUR_IN_MILLIS, 1, null, 600, 0); in testRemoveOldTransactions() 225 now - 22 * HOUR_IN_MILLIS, now - 21 * HOUR_IN_MILLIS, 1, null, 600, 0); in testRemoveOldTransactions() 228 now - 20 * HOUR_IN_MILLIS, now - 20 * HOUR_IN_MILLIS, 1, null, 500, 0); in testRemoveOldTransactions() 231 now - 5 * MINUTE_IN_MILLIS, now - MINUTE_IN_MILLIS, 1, null, 400, 0); in testRemoveOldTransactions() 262 now - 48 * HOUR_IN_MILLIS, now - 40 * HOUR_IN_MILLIS, 1, null, 4800, 0); in testTransactionsAlwaysInOrder() 264 now - 24 * HOUR_IN_MILLIS, now - 23 * HOUR_IN_MILLIS, 1, null, 600, 0); in testTransactionsAlwaysInOrder() 266 now - 22 * HOUR_IN_MILLIS, now - 21 * HOUR_IN_MILLIS, 1, null, 600, 0); in testTransactionsAlwaysInOrder() 269 now - 20 * HOUR_IN_MILLIS, now - 20 * HOUR_IN_MILLIS, 1, null, 500, 0); in testTransactionsAlwaysInOrder() [all …]
|
/aosp14/frameworks/base/services/tests/mockingservicestests/src/com/android/server/utils/quota/ |
H A D | CountQuotaTrackerTest.java | 218 mInjector.mElapsedTime = now; in logEventAt() 234 logEventAt(now - 6 * HOUR_IN_MILLIS); in testDeleteObsoleteEventsLocked() 235 logEventAt(now - 5 * HOUR_IN_MILLIS); in testDeleteObsoleteEventsLocked() 236 logEventAt(now - 4 * HOUR_IN_MILLIS); in testDeleteObsoleteEventsLocked() 237 logEventAt(now - 3 * HOUR_IN_MILLIS); in testDeleteObsoleteEventsLocked() 238 logEventAt(now - 2 * HOUR_IN_MILLIS); in testDeleteObsoleteEventsLocked() 239 logEventAt(now - HOUR_IN_MILLIS); in testDeleteObsoleteEventsLocked() 240 logEventAt(now - 1); in testDeleteObsoleteEventsLocked() 244 expectedEvents.addLast(now - 1); in testDeleteObsoleteEventsLocked() 314 logEventAt(now - HOUR_IN_MILLIS); in testUpdateExecutionStatsLocked_NoTimer() [all …]
|
/aosp14/frameworks/base/services/tests/mockingservicestests/src/com/android/server/usage/ |
H A D | UserUsageStatsServiceTest.java | 108 long now = System.currentTimeMillis(); in testReportEvent_eventAppearsInQueries() local 135 long now = System.currentTimeMillis(); in testReportEvent_packageUsedEventNotTracked() local 163 long now = System.currentTimeMillis(); in testQueryEarliestEventsForPackage() local 238 now = event1ReportTime; in testQueryEarliestEventsForPackage_Caching() 239 startTime = now - forcedDiff * 2; in testQueryEarliestEventsForPackage_Caching() 278 now = event2ReportTime + 1; in testQueryEarliestEventsForPackage_Caching() 298 now = event2ReportTime + 1; in testQueryEarliestEventsForPackage_Caching() 299 startTime = now - forcedDiff * 2; in testQueryEarliestEventsForPackage_Caching() 318 now = event1ReportTime; in testQueryEarliestEventsForPackage_Caching() 319 startTime = now - forcedDiff * 2; in testQueryEarliestEventsForPackage_Caching() [all …]
|
/aosp14/frameworks/base/services/core/java/com/android/server/wm/ |
H A D | WindowOrientationListener.java | 708 final long now = event.timestamp; in onSensorChanged() local 712 if (now < then in onSensorChanged() 732 mLastFilteredTimestampNanos = now; in onSensorChanged() 767 if (isFlatLocked(now)) { in onSensorChanged() 769 mFlatTimestampNanos = now; in onSensorChanged() 773 mSwingTimestampNanos = now; in onSensorChanged() 994 if (now < mAccelerationTimestampNanos in isPredictedRotationAcceptableLocked() 1017 mPredictedRotationTimestampNanos = now; in updatePredictedRotationLocked() 1038 private boolean isFlatLocked(long now) { in isFlatLocked() argument 1074 private float remainingMS(long now, long until) { in remainingMS() argument [all …]
|
/aosp14/frameworks/base/services/tests/mockingservicestests/src/com/android/server/am/ |
H A D | ActiveServicesTest.java | 91 final long now = SystemClock.uptimeMillis(); in testRescheduleServiceRestartsOnChanges() local 112 final long now2 = now + elapsed; in testRescheduleServiceRestartsOnChanges() 127 final long now3 = now + elapsed3; in testRescheduleServiceRestartsOnChanges() 138 final long now4 = now + elapsed4; in testRescheduleServiceRestartsOnChanges() 149 final long now5 = now + elapsed5; in testRescheduleServiceRestartsOnChanges() 160 final long now = SystemClock.uptimeMillis(); in testRescheduleServiceRestartsOnOtherChanges() local 195 verifyDelays(now, new long[] {extra, btwn + extra * 2, rd2, in testRescheduleServiceRestartsOnOtherChanges() 300 r.nextRestartTime = now + r.restartDelay; in setNextRestarts() 312 r.nextRestartTime = r.mEarliestRestartTime = now + delay; in createRestartingService() 313 r.mRestartSchedulingTime = now; in createRestartingService() [all …]
|
/aosp14/frameworks/base/services/core/java/com/android/server/notification/ |
H A D | RateEstimator.java | 38 public void update(long now) { in update() argument 41 mInterarrivalTime = getInterarrivalEstimate(now); in update() 43 mLastEventTime = now; in update() 47 public float getRate(long now) { in getRate() argument 51 return (float) (1.0 / getInterarrivalEstimate(now)); in getRate() 55 private double getInterarrivalEstimate(long now) { in getInterarrivalEstimate() argument 56 double dt = ((double) (now - mLastEventTime)) / 1000.0; in getInterarrivalEstimate()
|
/aosp14/system/core/healthd/ |
H A D | healthd_mode_charger.cpp | 430 int64_t now = curr_time_ms(); in SetKeyCallback() local 440 if (down) keys_[code].timestamp = now; in SetKeyCallback() 492 if (now >= reboot_timeout) { in ProcessKey() 507 now); in ProcessKey() 549 ProcessKey(KEY_POWER, now); in HandleInputState() 603 int64_t now = curr_time_ms(); in OnHeartbeat() local 605 HandleInputState(now); in OnHeartbeat() 606 HandlePowerSupplyState(now); in OnHeartbeat() 611 UpdateScreenState(now); in OnHeartbeat() 638 int64_t now = curr_time_ms(); in OnPrepareToWait() local [all …]
|
/aosp14/frameworks/base/core/java/android/service/notification/ |
H A D | ScheduleCalendar.java | 66 public void maybeSetNextAlarm(long now, long nextAlarm) { in maybeSetNextAlarm() argument 71 } else if (nextAlarm > now) { in maybeSetNextAlarm() 74 } else if (mSchedule.nextAlarm < now) { in maybeSetNextAlarm() 95 public long getNextChangeTime(long now) { in getNextChangeTime() argument 98 final long nextEnd = getNextTime(now, mSchedule.endHour, mSchedule.endMinute, false); in getNextChangeTime() 104 private long getNextTime(long now, int hr, int min, boolean adjust) { in getNextTime() argument 107 final long time = adjust ? getClosestActualTime(now, hr, min) : getTime(now, hr, min); in getNextTime() 108 if (time <= now) { in getNextTime() 143 public boolean isAlarmInSchedule(long alarm, long now) { in isAlarmInSchedule() argument 151 && isInSchedule(-1, now, start, end)) in isAlarmInSchedule() [all …]
|
/aosp14/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/ |
H A D | NetworkCycleDataLoaderTest.java | 120 final ZonedDateTime now = ZonedDateTime.now(); in loadPolicyData_shouldRecordUsageFromPolicyCycle() local 121 final Range<ZonedDateTime> cycle = new Range<>(now, now); in loadPolicyData_shouldRecordUsageFromPolicyCycle() 122 final long nowInMs = now.toInstant().toEpochMilli(); in loadPolicyData_shouldRecordUsageFromPolicyCycle() 149 final long now = System.currentTimeMillis(); in loadFourWeeksData_shouldRecordUsageForLast4Weeks() local 150 final long fourWeeksAgo = now - (DateUtils.WEEK_IN_MILLIS * 4); in loadFourWeeksData_shouldRecordUsageForLast4Weeks() 151 final long twoDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 2); in loadFourWeeksData_shouldRecordUsageForLast4Weeks() 156 verify(mLoader).recordUsage(fourWeeksAgo, now); in loadFourWeeksData_shouldRecordUsageForLast4Weeks() 162 final long now = System.currentTimeMillis(); in loadDataForSpecificCycles_shouldRecordUsageForSpecifiedTime() local 163 final long tenDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 10); in loadDataForSpecificCycles_shouldRecordUsageForSpecifiedTime() 167 cycles.add(now); in loadDataForSpecificCycles_shouldRecordUsageForSpecifiedTime() [all …]
|
/aosp14/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/controllers/ |
H A D | PrefetchController.java | 158 final long now = sSystemClock.millis(); in maybeStartTrackingJobLocked() local 164 updateConstraintLocked(jobStatus, now, nowElapsed); in maybeStartTrackingJobLocked() 222 @CurrentTimeMillisLong long now) { in getNextEstimatedLaunchTimeLocked() argument 246 changed |= updateConstraintLocked(js, now, nowElapsed); in maybeUpdateConstraintForPkgLocked() 259 final long now = sSystemClock.millis(); in maybeUpdateConstraintForUid() local 306 final long now = sSystemClock.millis(); in processUpdatedEstimatedLaunchTime() local 381 @CurrentTimeMillisLong long now) { in willBeLaunchedSoonLocked() argument 382 return getNextEstimatedLaunchTimeLocked(userId, pkgName, now) in willBeLaunchedSoonLocked() 407 final long now = sSystemClock.millis(); in onConstantsUpdatedLocked() 445 final long now = sSystemClock.millis(); in processExpiredAlarms() local [all …]
|
/aosp14/frameworks/base/core/tests/coretests/src/android/text/format/ |
H A D | RelativeDateTimeFormatterTest.java | 402 now - 42 * MINUTE_IN_MILLIS, now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman() 405 now + 42 * MINUTE_IN_MILLIS, now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman() 408 now - DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman() 411 now - 2 * DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman() 414 now + DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman() 417 now + 2 * DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringGerman() 431 now - (42 * MINUTE_IN_MILLIS), now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringFrench() 437 now - DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringFrench() 440 now - 2 * DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringFrench() 443 now + DAY_IN_MILLIS, now, DAY_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringFrench() [all …]
|
/aosp14/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/collection/coordinator/ |
H A D | SmartspaceDedupingCoordinatorTest.kt | 80 private val now = clock.currentTimeMillis() regex 124 .setLastAudiblyAlertedMs(now - 10000) 133 .setLastAudiblyAlertedMs(now - 10000) 160 assertTrue(filter.shouldFilterOut(entry2HasNotRecentlyAlerted, now)) 162 assertFalse(filter.shouldFilterOut(entry4HasNotRecentlyAlerted, now)) 176 assertFalse(filter.shouldFilterOut(entry1HasRecentlyAlerted, now)) 184 .setLastAudiblyAlertedMs(now - 40000) 194 assertTrue(filter.shouldFilterOut(entryOldAlert, now)) 221 assertFalse(filter.shouldFilterOut(entry1HasRecentlyAlerted, now)) 272 .setLastAudiblyAlertedMs(now - 1000) [all …]
|
/aosp14/frameworks/base/services/core/java/com/android/server/power/batterysaver/ |
H A D | BatterySavingStats.java | 297 final long now = injectCurrentTime(); in transitionStateLocked() local 309 mLastBatterySaverEnabledTime = now; in transitionStateLocked() 311 mLastAdaptiveBatterySaverDisabledTime = now; in transitionStateLocked() 316 mLastBatterySaverDisabledTime = now; in transitionStateLocked() 318 mLastAdaptiveBatterySaverDisabledTime = now; in transitionStateLocked() 323 mLastAdaptiveBatterySaverEnabledTime = now; in transitionStateLocked() 325 mLastBatterySaverDisabledTime = now; in transitionStateLocked() 331 endLastStateLocked(now, batteryLevel, batteryPercent); in transitionStateLocked() 344 stat.endTime = now; 390 stat.startTime = now; [all …]
|
/aosp14/frameworks/base/core/java/android/app/admin/ |
H A D | FreezePeriod.java | 141 Pair<LocalDate, LocalDate> toCurrentOrFutureRealDates(LocalDate now) { in toCurrentOrFutureRealDates() argument 142 final int nowDays = dayOfYearDisregardLeapYear(now); in toCurrentOrFutureRealDates() 144 if (contains(now)) { in toCurrentOrFutureRealDates() 170 now.getYear() + startYearAdjustment); in toCurrentOrFutureRealDates() 172 now.getYear() + endYearAdjustment); in toCurrentOrFutureRealDates() 303 LocalDate prevPeriodStart, LocalDate prevPeriodEnd, LocalDate now) { in validateAgainstPreviousFreezePeriod() argument 307 if (prevPeriodStart.isAfter(now) || prevPeriodEnd.isAfter(now)) { in validateAgainstPreviousFreezePeriod() 309 + " current date " + now); in validateAgainstPreviousFreezePeriod() 319 if (interval.contains(now) in validateAgainstPreviousFreezePeriod() 326 .toCurrentOrFutureRealDates(now); in validateAgainstPreviousFreezePeriod() [all …]
|
/aosp14/frameworks/base/core/tests/coretests/src/android/provider/ |
H A D | SmsProviderTest.java | 41 long now = System.currentTimeMillis(); in testProvider() local 49 Long.toString(now - (5 * 24 * 60 * 60 * 1000)), in testProvider() 50 Long.toString(now - (2 * 24 * 60 * 60 * 1000)), in testProvider() 51 Long.toString(now - (5 * 60 * 60 * 1000)), in testProvider() 52 Long.toString(now - (30 * 60 * 1000)), in testProvider() 53 Long.toString(now - (5 * 60 * 1000)), in testProvider() 54 Long.toString(now) in testProvider()
|
/aosp14/frameworks/base/core/java/android/os/ |
H A D | ConditionVariable.java | 124 long now = SystemClock.elapsedRealtime(); in block() local 125 long end = now + timeoutMs; in block() 126 while (!mCondition && now < end) { in block() 128 this.wait(end-now); in block() 132 now = SystemClock.elapsedRealtime(); in block()
|