File: user_charging_event.proto

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (156 lines) | stat: -rw-r--r-- 4,657 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

syntax = "proto2";

option optimize_for = LITE_RUNTIME;

package power_manager;
option go_package = "go.chromium.org/chromiumos/system_api/power_manager_proto";

// UserChargingEvent contains information about users activities that are
// related to charging.
message UserChargingEvent {
  message Features {
    enum DayOfWeek {
      SUN = 0;
      MON = 1;
      TUE = 2;
      WED = 3;
      THU = 4;
      FRI = 5;
      SAT = 6;
    }

    enum Month {
      JAN = 1;
      FEB = 2;
      MAR = 3;
      APR = 4;
      MAY = 5;
      JUN = 6;
      JUL = 7;
      AUG = 8;
      SEP = 9;
      OCT = 10;
      NOV = 11;
      DEC = 12;
    }

    enum DeviceType {
      UNKNOWN = 0;
      CLAMSHELL = 1;
      CONVERTIBLE = 2;
      DETACHABLE = 3;
      TABLET = 4;
      OTHER = 5;

      // Next value to use: 6
    }

    enum DeviceMode {
      UNKNOWN_MODE = 0;
      CLOSED_LID_MODE = 1;
      LAPTOP_MODE = 2;
      TABLET_MODE = 3;

      // Next value to use: 4
    }

    // Percentage of the battery.
    optional int32 battery_percentage = 1;
    // Time since the last time user unplugged the charger in minutes.
    optional int32 time_since_last_charge_minutes = 2;
    // Duration of the last time the device was charged in minutes.
    optional int32 duration_of_last_charge_minutes = 3;
    // The percentage of the battery that the last charge reached.
    optional int32 battery_percentage_of_last_charge = 4;
    // The percentage of the battery at the beginning of the last charge.
    optional int32 battery_percentage_before_last_charge = 5;
    // Time of the event in minutes since midnight in the local time zone.
    optional int32 time_of_the_day_minutes = 6;
    // Logging event's day of week.
    optional DayOfWeek day_of_week = 7;
    // Logging event's day of month.
    optional int32 day_of_month = 8;
    // Logging event's month.
    optional Month month = 9;
    // Timezone difference from the last charge. It is equal to
    // current_timezone - timezone_from_the_last_charge. The valid range of time
    // zone value will be -12 (UTC -12:00) to +14 (UTC +14:00).
    optional double timezone_difference_from_last_charge_hours = 10;
    // Type of the device.
    optional DeviceType device_type = 11;
    // Mode of the device.
    optional DeviceMode device_mode = 12;
    // Number of various events in past 30 minutes.
    optional int32 num_recent_key_events = 13;
    optional int32 num_recent_mouse_events = 14;
    optional int32 num_recent_touch_events = 15;
    optional int32 num_recent_stylus_events = 16;
    // Duration of video and audio playing in the last 30 minutes.
    optional int32 duration_recent_video_playing_minutes = 17;
    optional int32 duration_recent_audio_playing_minutes = 18;
    // Brightness of the screen in percent.
    optional int32 screen_brightness_percent = 19;
    // Charge voltage in mV.
    optional int32 voltage_mv = 20;
    // Whether there's any shutdown/suspend action between the last charge
    // and current event.
    optional bool halt_from_last_charge = 21;
    // Whether the device is being charged or not.
    optional bool is_charging = 22;

    // Next ID to use: 23
  }

  message Event {
    enum Reason {
      // User plugs in the charger.
      CHARGER_PLUGGED_IN = 1;
      // User unplugs the charger.
      CHARGER_UNPLUGGED = 2;
      // Logging at a regular time interval.
      PERIODIC_LOG = 3;
      // Device goes into shutdown mode.
      SHUTDOWN = 4;
      // Device goes into suspend mode.
      SUSPEND = 5;

      // Next value to use: 6
    }

    // Unique number that represent the event.
    optional int32 event_id = 1;
    // Reason for the event.
    optional Reason reason = 2;

    // Next ID to use: 3
  }

  optional Features features = 1;
  optional Event event = 2;

  // Next ID to use: 3
}

// PastChargingEvents contain a list of events that have information about "past
// charging events". It will only store the plug/unplug pair of the last charge
// and a recent plug/halt event if any.
message PastChargingEvents {
  message Event {
    // Time of the event in minutes since Windows epoch.
    optional int32 time = 1;
    // Battery percentage of the device.
    optional int32 battery_percent = 2;
    // Timezone of the device.
    optional int32 timezone = 3;
    // Reason for the event.
    optional UserChargingEvent.Event.Reason reason = 4;

    // Next ID to use: 5
  }
  // A list containing past charging events.
  repeated Event events = 1;
}