Home
last modified time | relevance | path

Searched refs:now (Results 1 – 25 of 519) sorted by relevance

12345678910>>...21

/frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/
DScheduleConditionProviderTest.java82 Calendar now = getNow(); in testEvaluateSubscription_noAlarmExit_InSchedule() local
87 info.startHour = now.get(Calendar.HOUR_OF_DAY); in testEvaluateSubscription_noAlarmExit_InSchedule()
88 info.startMinute = now.get(Calendar.MINUTE); in testEvaluateSubscription_noAlarmExit_InSchedule()
91 info.endHour = now.get(Calendar.HOUR_OF_DAY) + 1; in testEvaluateSubscription_noAlarmExit_InSchedule()
96 assertTrue(cal.isInSchedule(now.getTimeInMillis())); in testEvaluateSubscription_noAlarmExit_InSchedule()
99 conditionId, cal, now.getTimeInMillis(), now.getTimeInMillis() + 1000); in testEvaluateSubscription_noAlarmExit_InSchedule()
106 Calendar now = getNow(); in testEvaluateSubscription_noAlarmExit_InScheduleSnoozed() local
111 info.startHour = now.get(Calendar.HOUR_OF_DAY); in testEvaluateSubscription_noAlarmExit_InScheduleSnoozed()
112 info.startMinute = now.get(Calendar.MINUTE); in testEvaluateSubscription_noAlarmExit_InScheduleSnoozed()
115 info.endHour = now.get(Calendar.HOUR_OF_DAY) + 1; in testEvaluateSubscription_noAlarmExit_InScheduleSnoozed()
[all …]
DScheduleCalendarTest.java212 Calendar now = new GregorianCalendar(); in testShouldExitForAlarm_oldAlarm() local
213 now.set(Calendar.HOUR_OF_DAY, 14); in testShouldExitForAlarm_oldAlarm()
214 now.set(Calendar.MINUTE, 15); in testShouldExitForAlarm_oldAlarm()
215 now.set(Calendar.SECOND, 0); in testShouldExitForAlarm_oldAlarm()
216 now.set(Calendar.MILLISECOND, 0); in testShouldExitForAlarm_oldAlarm()
228 assertTrue(mScheduleCalendar.isInSchedule(now.getTimeInMillis())); in testShouldExitForAlarm_oldAlarm()
231 assertFalse(mScheduleCalendar.shouldExitForAlarm(now.getTimeInMillis())); in testShouldExitForAlarm_oldAlarm()
426 Calendar now = getDaylightSavingsDay(); in testIsAlarmInSchedule_alarmAndNowInSchedule_sameScheduleTrigger_daylightSavings() local
427 now.set(Calendar.HOUR_OF_DAY, 2); in testIsAlarmInSchedule_alarmAndNowInSchedule_sameScheduleTrigger_daylightSavings()
428 now.set(Calendar.MINUTE, 10); in testIsAlarmInSchedule_alarmAndNowInSchedule_sameScheduleTrigger_daylightSavings()
[all …]
/frameworks/base/core/java/com/android/internal/app/procstats/
DServiceState.java103 public void setMemFactor(int memFactor, long now) { in setMemFactor() argument
105 setRestarting(true, memFactor, now); in setMemFactor()
108 setStarted(true, memFactor, now); in setMemFactor()
111 setBound(true, memFactor, now); in setMemFactor()
114 setExecuting(true, memFactor, now); in setMemFactor()
117 setForeground(true, memFactor, now); in setMemFactor()
133 long now = SystemClock.uptimeMillis(); in applyNewOwner() local
138 setStarted(false, 0, now); in applyNewOwner()
144 setBound(false, 0, now); in applyNewOwner()
150 setExecuting(false, 0, now); in applyNewOwner()
[all …]
DAssociationState.java112 public void trackProcState(int procState, int seq, long now) { in trackProcState() argument
128 mTrackingUptime = now; in trackProcState()
137 commonSource.trackProcState(processState, seq, now); in trackProcState()
143 final long now = start(-1); in start() local
147 commonSource.start(now); in start()
150 return now; in start()
153 long start(long now) { in start() argument
156 if (now < 0) { in start()
157 now = SystemClock.uptimeMillis(); in start()
160 mStartUptime = now; in start()
[all …]
DProcessState.java195 long now) { in ProcessState() argument
203 mStartTime = now; in ProcessState()
205 mTotalRunningStartTime = now; in ProcessState()
211 public ProcessState clone(long now) { in clone() argument
212 ProcessState pnew = new ProcessState(this, mPackage, mUid, mVersion, mName, now); in clone()
216 pnew.mTotalRunningDuration = getTotalRunningDuration(now); in clone()
296 public void resetSafely(long now) { in resetSafely() argument
299 mStartTime = now; in resetSafely()
310 state.resetSafely(now); in resetSafely()
330 public void writeToParcel(Parcel out, long now) { in writeToParcel() argument
[all …]
/frameworks/base/apex/jobscheduler/service/java/com/android/server/job/
DJobPackageTracker.java94 public long getActiveTime(long now) { in getActiveTime() argument
97 time += now - activeStartTime; in getActiveTime()
102 public long getActiveTopTime(long now) { in getActiveTopTime() argument
105 time += now - activeTopStartTime; in getActiveTopTime()
110 public long getPendingTime(long now) { in getPendingTime() argument
113 time += now - pendingStartTime; in getPendingTime()
162 long getTotalTime(long now) { in getTotalTime() argument
166 return now - mStartUptimeTime; in getTotalTime()
169 void incPending(int uid, String pkg, long now) { in incPending() argument
172 pe.pendingStartTime = now; in incPending()
[all …]
/frameworks/base/media/packages/BluetoothMidiService/src/com/android/bluetoothmidiservice/
DMidiBtleTimeTracker.java40 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 …]
/frameworks/base/services/core/java/com/android/server/pm/
DSnapshotStatistics.java307 private Stats(long now) { in Stats() argument
308 mStartTimeUs = now; in Stats()
363 private void dumpPrefix(PrintWriter pw, String indent, long now, boolean header, in dumpPrefix() argument
369 pw.format(Locale.US, "%11s", durationToString(now - mStartTimeUs)); in dumpPrefix()
371 pw.format(Locale.US, " %11s", durationToString(now - mStopTimeUs)); in dumpPrefix()
388 private void dumpStats(PrintWriter pw, String indent, long now, boolean header) { in dumpStats() argument
389 dumpPrefix(pw, indent, now, header, "Summary stats"); in dumpStats()
406 private void dumpTimes(PrintWriter pw, String indent, long now, boolean header) { in dumpTimes() argument
407 dumpPrefix(pw, indent, now, header, "Build times"); in dumpTimes()
427 private void dumpUsage(PrintWriter pw, String indent, long now, boolean header) { in dumpUsage() argument
[all …]
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/utils/quota/
DCountQuotaTrackerTest.java215 long now = mInjector.getElapsedRealtime(); in logEventAt() local
218 mInjector.mElapsedTime = now; in logEventAt()
232 final long now = mInjector.getElapsedRealtime(); in testDeleteObsoleteEventsLocked() local
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()
[all …]
/frameworks/native/opengl/tests/finish/
Dfinish.cpp77 long long now, t; in main() local
90 now = systemTime(); in main()
93 printf("memcpy() time = %llu us\n", (t-now)/1000); in main()
107 now = systemTime(); in main()
111 printf("glFinish() time = %llu us\n", (t-now)/1000); in main()
121 now = systemTime(); in main()
125 printf("glFinish() time = %llu us\n", (t-now)/1000); in main()
135 now = systemTime(); in main()
140 printf("glFinish() time = %llu us\n", (t-now)/1000); in main()
150 now = systemTime(); in main()
[all …]
/frameworks/base/services/core/java/com/android/server/notification/
DRateEstimator.java37 public float update(long now) { in update() argument
44 mInterarrivalTime = getInterarrivalEstimate(now); in update()
47 mLastEventTime = now; in update()
52 public float getRate(long now) { in getRate() argument
56 return (float) (1.0 / getInterarrivalEstimate(now)); in getRate()
60 private double getInterarrivalEstimate(long now) { in getInterarrivalEstimate() argument
61 double dt = ((double) (now - mLastEventTime)) / 1000.0; in getInterarrivalEstimate()
/frameworks/base/services/core/java/com/android/server/wm/
DWindowOrientationListener.java702 final long now = event.timestamp; in onSensorChanged() local
704 final float timeDeltaMS = (now - then) * 0.000001f; in onSensorChanged()
706 if (now < then in onSensorChanged()
707 || now > then + MAX_FILTER_DELTA_TIME_NANOS in onSensorChanged()
726 mLastFilteredTimestampNanos = now; in onSensorChanged()
747 mAccelerationTimestampNanos = now; in onSensorChanged()
758 addTiltHistoryEntryLocked(now, tiltAngle); in onSensorChanged()
761 if (isFlatLocked(now)) { in onSensorChanged()
763 mFlatTimestampNanos = now; in onSensorChanged()
765 if (isSwingingLocked(now, tiltAngle)) { in onSensorChanged()
[all …]
/frameworks/native/services/surfaceflinger/Scheduler/
DVSyncDispatchTimerQueue.cpp35 nsecs_t getExpectedCallbackTime(VSyncTracker& tracker, nsecs_t now, in getExpectedCallbackTime() argument
38 std::max(timing.earliestVsync, now + timing.workDuration + timing.readyDuration)); in getExpectedCallbackTime()
84 VSyncTracker& tracker, nsecs_t now) { in schedule() argument
86 std::max(timing.earliestVsync, now + timing.workDuration + timing.readyDuration)); in schedule()
120 void VSyncDispatchTimerQueueEntry::update(VSyncTracker& tracker, nsecs_t now) { in update() argument
130 const auto earliestReadyBy = now + mScheduleTiming.workDuration + mScheduleTiming.readyDuration; in update()
218 mLastTimerSchedule = mTimeKeeper->now(); in setTimer()
221 void VSyncDispatchTimerQueue::rearmTimer(nsecs_t now) { in rearmTimer() argument
222 rearmTimerSkippingUpdateFor(now, mCallbacks.end()); in rearmTimer()
236 nsecs_t now, CallbackMap::iterator const& skipUpdateIt) { in rearmTimerSkippingUpdateFor() argument
[all …]
DLayerInfo.cpp48 void LayerInfo::setLastPresentTime(nsecs_t lastPresentTime, nsecs_t now, LayerUpdateType updateType, in setLastPresentTime() argument
52 mLastUpdatedTime = std::max(lastPresentTime, now); in setLastPresentTime()
56 mLastAnimationTime = std::max(lastPresentTime, now); in setLastPresentTime()
77 bool LayerInfo::isFrequent(nsecs_t now) const { in isFrequent()
87 if (it->queueTime >= getActiveLayerThreshold(now)) { in isFrequent()
103 bool LayerInfo::isAnimating(nsecs_t now) const { in isAnimating()
104 return mLastAnimationTime >= getActiveLayerThreshold(now); in isAnimating()
187 std::optional<Fps> LayerInfo::calculateRefreshRateIfPossible(nsecs_t now) { in calculateRefreshRateIfPossible() argument
197 const bool refreshRateConsistent = mRefreshRateHistory.add(refreshRate, now); in calculateRefreshRateIfPossible()
223 LayerInfo::LayerVote LayerInfo::getRefreshRateVote(nsecs_t now) { in getRefreshRateVote() argument
[all …]
DLayerInfo.h42 constexpr nsecs_t getActiveLayerThreshold(nsecs_t now) { in getActiveLayerThreshold() argument
43 return now - MAX_ACTIVE_LAYER_PERIOD_NS.count(); in getActiveLayerThreshold()
145 void setLastPresentTime(nsecs_t lastPresentTime, nsecs_t now, LayerUpdateType updateType,
164 LayerVote getRefreshRateVote(nsecs_t now);
181 void onLayerInactive(nsecs_t now) { in onLayerInactive() argument
186 const auto timePoint = std::chrono::nanoseconds(now); in onLayerInactive()
192 void clearHistory(nsecs_t now) { in clearHistory() argument
193 onLayerInactive(now); in clearHistory()
229 bool add(Fps refreshRate, nsecs_t now);
263 bool isFrequent(nsecs_t now) const;
[all …]
/frameworks/base/packages/SettingsLib/tests/robotests/src/com/android/settingslib/net/
DNetworkCycleDataLoaderTest.java120 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()
144 final long now = System.currentTimeMillis(); in loadFourWeeksData_shouldRecordUsageForLast4Weeks() local
145 final long fourWeeksAgo = now - (DateUtils.WEEK_IN_MILLIS * 4); in loadFourWeeksData_shouldRecordUsageForLast4Weeks()
146 final long twoDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 2); in loadFourWeeksData_shouldRecordUsageForLast4Weeks()
148 when(networkHistory.getEnd()).thenReturn(now); in loadFourWeeksData_shouldRecordUsageForLast4Weeks()
152 verify(mLoader).recordUsage(fourWeeksAgo, now); in loadFourWeeksData_shouldRecordUsageForLast4Weeks()
158 final long now = System.currentTimeMillis(); in loadDataForSpecificCycles_shouldRecordUsageForSpecifiedTime() local
159 final long tenDaysAgo = now - (DateUtils.DAY_IN_MILLIS * 10); in loadDataForSpecificCycles_shouldRecordUsageForSpecifiedTime()
[all …]
/frameworks/base/core/java/android/service/notification/
DScheduleCalendar.java64 public void maybeSetNextAlarm(long now, long nextAlarm) { in maybeSetNextAlarm() argument
69 } else if (nextAlarm > now) { in maybeSetNextAlarm()
72 } else if (mSchedule.nextAlarm < now) { in maybeSetNextAlarm()
93 public long getNextChangeTime(long now) { in getNextChangeTime() argument
95 final long nextStart = getNextTime(now, mSchedule.startHour, mSchedule.startMinute); in getNextChangeTime()
96 final long nextEnd = getNextTime(now, mSchedule.endHour, mSchedule.endMinute); in getNextChangeTime()
102 private long getNextTime(long now, int hr, int min) { in getNextTime() argument
103 final long time = getTime(now, hr, min); in getNextTime()
104 return time <= now ? addDays(time, 1) : time; in getNextTime()
135 public boolean isAlarmInSchedule(long alarm, long now) { in isAlarmInSchedule() argument
[all …]
/frameworks/base/core/java/android/os/
DConditionVariable.java124 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()
/frameworks/base/core/tests/coretests/src/android/provider/
DSmsProviderTest.java41 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()
/frameworks/base/core/tests/coretests/src/android/text/format/
DRelativeDateTimeFormatterTest.java398 final long now = cal.getTimeInMillis(); in test_getRelativeTimeSpanStringGerman() local
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()
427 final long now = cal.getTimeInMillis(); in test_getRelativeTimeSpanStringFrench() local
431 now - (42 * MINUTE_IN_MILLIS), now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringFrench()
434 now + (42 * MINUTE_IN_MILLIS), now, MINUTE_IN_MILLIS, 0)); in test_getRelativeTimeSpanStringFrench()
[all …]
/frameworks/base/core/java/android/app/admin/
DFreezePeriod.java141 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()
320 || interval.mStartDay > FreezePeriod.dayOfYearDisregardLeapYear(now)) { in validateAgainstPreviousFreezePeriod()
[all …]
/frameworks/base/services/core/java/com/android/server/power/batterysaver/
DBatterySavingStats.java297 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()
332 startNewStateLocked(newState, now, batteryLevel, batteryPercent); in transitionStateLocked()
336 private void endLastStateLocked(long now, int batteryLevel, int batteryPercent) {
[all …]
/frameworks/opt/telephony/src/java/com/android/internal/telephony/metrics/
DServiceStateStats.java54 final long now = getTimeMillis(); in conclude() local
57 state -> new TimestampedServiceState(state.mServiceState, now)); in conclude()
58 addServiceState(lastState, now); in conclude()
63 final long now = getTimeMillis(); in onServiceStateChanged() local
66 addServiceState(mLastState.getAndSet(new TimestampedServiceState(null, now)), now); in onServiceStateChanged() local
79 mLastState.getAndSet(new TimestampedServiceState(newState, now)); in onServiceStateChanged()
81 prevState, now, getDataServiceSwitch(prevState.mServiceState, newState)); in onServiceStateChanged()
85 private void addServiceState(TimestampedServiceState prevState, long now) { in addServiceState() argument
86 addServiceStateAndSwitch(prevState, now, null); in addServiceState()
91 long now, in addServiceStateAndSwitch() argument
[all …]
/frameworks/base/tests/ActivityTests/src/com/google/android/test/activity/
DSlowReceiver.java34 long now = SystemClock.elapsedRealtime(); in onReceive() local
35 final long end = now + RECEIVER_DELAY; in onReceive()
36 while (now < end) { in onReceive()
38 Thread.sleep(end - now); in onReceive()
40 now = SystemClock.elapsedRealtime(); in onReceive()
/frameworks/base/core/java/android/util/
DTimingLogger.java131 long now = SystemClock.elapsedRealtime(); in addSplit() local
132 mSplits.add(now); in addSplit()
145 long now = first; in dumpToLog() local
147 now = mSplits.get(i); in dumpToLog()
151 Log.d(mTag, mLabel + ": " + (now - prev) + " ms, " + splitLabel); in dumpToLog()
153 Log.d(mTag, mLabel + ": end, " + (now - first) + " ms"); in dumpToLog()

12345678910>>...21