Merge "statsd atom: add WallClockTimeShifted"
This commit is contained in:
committed by
Android (Google) Code Review
commit
ebe5626d8b
@@ -91,7 +91,7 @@ message Atom {
|
||||
ActivityForegroundStateChanged activity_foreground_state_changed = 42;
|
||||
IsolatedUidChanged isolated_uid_changed = 43;
|
||||
PacketWakeupOccurred packet_wakeup_occurred = 44;
|
||||
// 45 is available
|
||||
WallClockTimeShifted wall_clock_time_shifted = 45;
|
||||
AnomalyDetected anomaly_detected = 46;
|
||||
AppBreadcrumbReported app_breadcrumb_reported = 47;
|
||||
AppStartOccurred app_start_occurred = 48;
|
||||
@@ -1478,6 +1478,18 @@ message AppBreadcrumbReported {
|
||||
optional State state = 3;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs the wall-clock time when a significant wall-clock time shift occurs.
|
||||
* For example, this could be due to the user manually changing the time.
|
||||
*
|
||||
* Logged from:
|
||||
* frameworks/base/services/core/java/com/android/server/AlarmManagerService.java
|
||||
*/
|
||||
message WallClockTimeShifted {
|
||||
// New wall-clock time in milliseconds, according to System.currentTimeMillis().
|
||||
optional int64 wall_clock_timestamp_millis = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs when statsd detects an anomaly.
|
||||
*
|
||||
|
||||
@@ -81,6 +81,7 @@ import android.util.Slog;
|
||||
import android.util.SparseArray;
|
||||
import android.util.SparseBooleanArray;
|
||||
import android.util.SparseLongArray;
|
||||
import android.util.StatsLog;
|
||||
import android.util.TimeUtils;
|
||||
import android.util.proto.ProtoOutputStream;
|
||||
|
||||
@@ -3637,6 +3638,8 @@ class AlarmManagerService extends SystemService {
|
||||
if (DEBUG_BATCH) {
|
||||
Slog.v(TAG, "Time changed notification from kernel; rebatching");
|
||||
}
|
||||
// StatsLog requires currentTimeMillis(), which == nowRTC to within usecs.
|
||||
StatsLog.write(StatsLog.WALL_CLOCK_TIME_SHIFTED, nowRTC);
|
||||
removeImpl(mTimeTickSender);
|
||||
removeImpl(mDateChangeSender);
|
||||
rebatchAllAlarms();
|
||||
|
||||
Reference in New Issue
Block a user