Searched refs:timer (Results 1 - 25 of 34) sorted by relevance

12

/frameworks/base/core/tests/coretests/src/com/android/internal/os/
H A DBatteryStatsDurationTimerTest.java39 final BatteryStatsImpl.DurationTimer timer = new BatteryStatsImpl.DurationTimer(clocks,
42 // TimeBase running, timer not running: current and max are 0
44 assertFalse(timer.isRunningLocked());
45 assertEquals(0, timer.getCurrentDurationMsLocked(300));
46 assertEquals(0, timer.getMaxDurationMsLocked(301));
47 assertEquals(0, timer.getTotalDurationMsLocked(301));
49 // Start timer: current, total, and max advance
50 timer.startRunningLocked(700);
51 assertTrue(timer.isRunningLocked());
52 assertEquals(800, timer
[all...]
H A DBatteryStatsTimerTest.java135 * to the timer.
142 TestTimer timer = new TestTimer(clocks, 0, timeBase);
143 timer.nextComputeCurrentCount = 3000;
145 // Test that starting the timer counts the unplugged time and counters
146 timer.nextComputeRunTime = 4;
147 timer.onTimeStarted(10, 20, 50);
148 Assert.assertEquals(50, timer.lastComputeRunTimeRealtime);
149 Assert.assertEquals(4, timer.getUnpluggedTime());
150 Assert.assertEquals(3000, timer.getUnpluggedCount());
152 // Test that stopping the timer update
[all...]
H A DBatteryStatsSamplingTimerTest.java31 final BatteryStatsImpl.SamplingTimer timer = new BatteryStatsImpl.SamplingTimer(clocks,
34 timer.onTimeStarted(100, 100, 100);
37 timer.update(10, 1);
39 timer.update(20, 2);
41 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED));
42 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED));
44 timer.endSample();
46 assertEquals(1, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED));
47 assertEquals(10, timer.getTotalTimeLocked(200, BatteryStats.STATS_SINCE_CHARGED));
49 timer
[all...]
H A DBatteryStatsDualTimerTest.java38 final BatteryStatsImpl.DualTimer timer = new BatteryStatsImpl.DualTimer(clocks,
41 assertTrue(timeBase.hasObserver(timer));
42 assertFalse(subTimeBase.hasObserver(timer));
43 assertFalse(timeBase.hasObserver(timer.getSubTimer()));
44 assertTrue(subTimeBase.hasObserver(timer.getSubTimer()));
48 timer.startRunningLocked(clocks.realtime);
49 timer.reset(true);
50 assertTrue(timeBase.hasObserver(timer));
51 assertTrue(subTimeBase.hasObserver(timer.getSubTimer()));
53 // Stop timer an
[all...]
H A DBatteryStatsStopwatchTimerTest.java35 final BatteryStatsImpl.StopwatchTimer timer = new BatteryStatsImpl.StopwatchTimer(clocks,
43 timer.startRunningLocked(updateTime(clocks, 100)); // start
45 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED));
46 timer.startRunningLocked(updateTime(clocks, 110)); // start
47 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED));
48 timer.stopRunningLocked(updateTime(clocks, 120)); // stop
49 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED));
50 timer.stopRunningLocked(updateTime(clocks, 130)); // stop
51 assertEquals(expectedCount, timer.getCountLocked(BatteryStats.STATS_SINCE_CHARGED));
54 timer
[all...]
H A DBatteryStatsSensorTest.java348 // bg timer ignores pools, so both totalTime and totalDuration should give the same result
365 // bg timer ignores pools, so both totalTime and totalDuration should give the same result
394 // The sensor is started and the timer has been created.
403 // Reset the stats. Since the sensor is still running, we should still see the timer
413 // Now the sensor timer has stopped so this reset should also take out the sensor.
454 BatteryStats.Timer timer = sensor.getSensorTime();
456 assertEquals(0, timer.getTotalTimeLocked(1000*clocks.realtime, which));
457 assertEquals(0, timer.getTotalDurationMsLocked(clocks.realtime));
464 // Reset the stats. Since the sensor is still running, we should still see the timer
467 assertEquals(0, timer
[all...]
H A DBatteryStatsBackgroundStatsTest.java165 // Start timer
177 // Stop timer
219 // Start timer (optimized)
231 // Start timer (unoptimized)
243 // Stop timer (optimized)
247 // Stop timer (unoptimized)
253 BatteryStats.Timer timer = bi.getUidStats().get(UID).getBluetoothScanTimer();
259 long time = timer.getTotalTimeLocked(curr, STATS_SINCE_CHARGED);
260 int count = timer.getCountLocked(STATS_SINCE_CHARGED);
262 long actualTime = timer
[all...]
/frameworks/base/core/java/com/android/internal/os/
H A DCameraPowerCalculator.java38 final BatteryStats.Timer timer = u.getCameraTurnedOnTimer();
39 if (timer != null) {
40 final long totalTime = timer.getTotalTimeLocked(rawRealtimeUs, statsType) / 1000;
H A DFlashlightPowerCalculator.java36 final BatteryStats.Timer timer = u.getFlashlightTurnedOnTimer();
37 if (timer != null) {
38 final long totalTime = timer.getTotalTimeLocked(rawRealtimeUs, statsType) / 1000;
H A DWakelockPowerCalculator.java44 BatteryStats.Timer timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL);
45 if (timer != null) {
46 wakeLockTimeUs += timer.getTotalTimeLocked(rawRealtimeUs, statsType);
H A DSensorPowerCalculator.java46 final BatteryStats.Timer timer = sensor.getSensorTime();
47 final long sensorTime = timer.getTotalTimeLocked(rawRealtimeUs, statsType) / 1000;
/frameworks/rs/script_api/include/
H A Drs_time.rsh73 * Converts the time specified by timer into a rs_tm structure that provides year, month,
81 * timer: Input time as a number of seconds since January 1, 1970.
86 rsLocaltime(rs_tm* local, const rs_time_t* timer);
93 * If timer is non-NULL, the result is also stored in the memory pointed to by
97 * timer: Location to also store the returned calendar time.
102 rsTime(rs_time_t* timer);
/frameworks/rs/tests/lldb/tests/
H A Drun_test.py158 '''Start a 'timeout' timer, to catch stalled execution.
160 This function will start a timer that will act as a timeout killing this
181 timer = Timer(interval, on_timeout)
182 timer.start()
183 atexit.register(Timer.stop, timer)
184 return timer
187 def _quit_test(num, timer):
193 timer: The current Timer instance.
195 if timer:
196 timer
[all...]
/frameworks/base/services/tests/servicestests/src/com/android/server/display/
H A DAmbientBrightnessStatsTrackerTest.java366 AmbientBrightnessStatsTracker.Timer timer = new AmbientBrightnessStatsTracker.Timer(
368 assertEquals(0, timer.totalDurationSec(), 0);
370 assertEquals(0, timer.totalDurationSec(), 0);
371 assertFalse(timer.isRunning());
372 // Start timer
373 timer.start();
374 assertTrue(timer.isRunning());
375 assertEquals(0, timer.totalDurationSec(), 0);
377 assertTrue(timer.isRunning());
378 assertEquals(1, timer
[all...]
/frameworks/base/services/core/java/com/android/server/connectivity/
H A DNetworkAgentInfo.java116 // the network is no longer considered "lingering". After the linger timer expires, if the network
199 // All linger timers for this network, sorted by expiry time. A linger timer is added whenever
203 // SparseLongArray) combined with the timestamp of when the last timer is scheduled to fire.
209 // Linger expiry timer. Armed whenever mLingerTimers is non-empty, regardless of whether the
211 // When the timer fires, all linger state is cleared, and if the network has no requests, it is
215 // Linger expiry. Holds the expiry time of the linger timer, or 0 if the timer is not armed.
494 LingerTimer timer = new LingerTimer(request, expiryMs);
495 if (VDBG) Log.d(TAG, "Adding LingerTimer " + timer + " to " + this.name());
496 mLingerTimers.add(timer);
[all...]
/frameworks/base/services/core/java/com/android/server/am/
H A DHealthStatsBatteryStatsWriter.java52 BatteryStats.Timer timer;
91 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_FULL);
92 addTimers(uidWriter, UidHealthStats.TIMERS_WAKELOCKS_FULL, key, timer);
95 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_PARTIAL);
96 addTimers(uidWriter, UidHealthStats.TIMERS_WAKELOCKS_PARTIAL, key, timer);
99 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_WINDOW);
100 addTimers(uidWriter, UidHealthStats.TIMERS_WAKELOCKS_WINDOW, key, timer);
103 timer = wakelock.getWakeTime(BatteryStats.WAKE_TYPE_DRAW);
104 addTimers(uidWriter, UidHealthStats.TIMERS_WAKELOCKS_DRAW, key, timer);
456 * Adds a BatteryStats.Timer into a HealthStatsWriter. Safe to pass a null timer
458 addTimer(HealthStatsWriter writer, int key, BatteryStats.Timer timer) argument
468 addTimers(HealthStatsWriter writer, int key, String name, BatteryStats.Timer timer) argument
[all...]
/frameworks/rs/script_api/
H A Drs_time.spec65 arg: const rs_time_t* timer, "Input time as a number of seconds since January 1, 1970."
68 Converts the time specified by timer into a @rs_tm structure that provides year, month,
78 arg: rs_time_t* timer, "Location to also store the returned calendar time."
83 If timer is non-NULL, the result is also stored in the memory pointed to by
/frameworks/rs/tests/lldb/tests/harness/
H A Dtest_base_remote.py32 def __init__(self, device_port, device, timer, *args, **kwargs):
33 super(TestBaseRemote, self).__init__(device_port, device, timer, *args, **kwargs)
H A Dtest_base.py44 def __init__(self, device_port, device, timer, app_type, wimpy=False, **kwargs):
50 self._timer = timer # timer instance, to check whether the test froze
172 # before issuing the command, restart the current timer to check
/frameworks/base/media/mca/filterfw/java/android/filterfw/core/
H A DGLFrame.java145 StopWatchMap timer = GLFrameTimer.get();
146 if (timer.LOG_MFF_RUNNING_TIMES) {
147 timer.start("glFinish " + message);
149 timer.stop("glFinish " + message);
/frameworks/base/core/java/android/os/
H A DBatteryStats.java72 * A constant indicating a partial wake lock timer.
77 * A constant indicating a full wake lock timer.
82 * A constant indicating a window wake lock timer.
87 * A constant indicating a sensor timer.
92 * A constant indicating a a wifi running timer
97 * A constant indicating a full wifi lock timer
107 * A constant indicating a wifi multicast timer
112 * A constant indicating a video turn on timer
117 * A constant indicating a vibrator on timer
122 * A constant indicating a foreground activity timer
3046 computeWakeLock(Timer timer, long elapsedRealtimeUs, int which) argument
3066 printWakeLock(StringBuilder sb, Timer timer, long elapsedRealtimeUs, String name, int which, String linePrefix) argument
3123 printTimer(PrintWriter pw, StringBuilder sb, Timer timer, long rawRealtimeUs, int which, String prefix, String type) argument
3173 printWakeLockCheckin(StringBuilder sb, Timer timer, long elapsedRealtimeUs, String name, int which, String linePrefix) argument
3246 dumpTimer(PrintWriter pw, int uid, String category, String type, Timer timer, long rawRealtime, int which) argument
3267 dumpTimer(ProtoOutputStream proto, long fieldId, Timer timer, long rawRealtimeUs, int which) argument
4292 TimerEntry(String name, int id, BatteryStats.Timer timer, long time) argument
[all...]
/frameworks/base/tools/velocityplot/
H A Dvelocityplot.py117 self.timer = self.fig.canvas.new_timer(interval=100)
118 self.timer.add_callback(lambda: self.update())
119 self.timer.start()
/frameworks/rs/
H A DrsScriptC_Lib.cpp78 time_t rsrTime(Context *rsc, time_t *timer) { argument
79 return time(timer);
82 tm* rsrLocalTime(Context *rsc, tm *local, time_t *timer) { argument
90 tm *tmp = localtime(timer);
/frameworks/base/tools/orientationplot/
H A Dorientationplot.py182 self.timer = self.fig.canvas.new_timer(interval=100)
183 self.timer.add_callback(lambda: self.update())
184 self.timer.start()
189 # Handle a click event to pause or restart the timer.
193 self.timer.stop()
196 self.timer.start()
/frameworks/base/services/tests/servicestests/src/com/android/server/location/
H A DLocationBasedCountryDetectorTest.java354 Timer timer = detector.getTimer();
355 assertTrue(timer == null);

Completed in 338 milliseconds

12