• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 Google Inc. All Rights Reserved.
2 // Author: pkanwar@google.com (Pankaj Kanwar)
3 // Protos for uploading bluetooth metrics.
4 
5 syntax = "proto2";
6 
7 package clearcut.connectivity;
8 
9 option java_package = "com.google.wireless.android.play.playlog.connectivity";
10 //option (datapol.file_vetting_status) = "latest";
11 
12 // import "storage/datapol/annotations/proto/semantic_annotations.proto";
13 
14 message BluetoothLog {
15 
16   // Session information that gets logged for every BT connection.
17   repeated BluetoothSession session = 1;
18 
19   // Session information that gets logged for every Pair event.
20   repeated PairEvent pair_event = 2;
21 
22   // Information for Wake locks.
23   repeated WakeEvent wake_event = 3;
24 
25   // Scan event information.
26   repeated ScanEvent scan_event = 4;
27 }
28 
29 // The information about the device.
30 message DeviceInfo {
31 
32   // Device type.
33   enum DeviceType {
34 
35      // Type is unknown.
36      DEVICE_TYPE_UNKNOWN = 0;
37 
38      DEVICE_TYPE_BREDR = 1;
39 
40      DEVICE_TYPE_LE = 2;
41 
42      DEVICE_TYPE_DUMO = 3;
43   }
44 
45   // Device class
46   // https://cs.corp.google.com/#android/system/bt/stack/include/btm_api.h&q=major_computer.
47   optional int32 device_class = 1;
48 
49   // Device type.
50   optional DeviceType device_type = 2;
51 }
52 
53 // Information that gets logged for every Bluetooth connection.
54 message BluetoothSession {
55 
56   // Type of technology used in the connection.
57   enum ConnectionTechnologyType {
58 
59      CONNECTION_TECHNOLOGY_TYPE_UNKNOWN = 0;
60 
61      CONNECTION_TECHNOLOGY_TYPE_LE = 1;
62 
63      CONNECTION_TECHNOLOGY_TYPE_BREDR = 2;
64   }
65 
66   // Duration of the session.
67   optional int64 session_duration_sec = 2;
68 
69   // Technology type.
70   optional ConnectionTechnologyType connection_technology_type = 3;
71 
72   // Reason for disconnecting.
73   optional string disconnect_reason = 4;
74 
75   // The information about the device which it is connected to.
76   optional DeviceInfo device_connected_to = 5;
77 
78   // The information about the RFComm session.
79   optional RFCommSession rfcomm_session = 6;
80 
81   // The information about the A2DP session.
82   optional A2DPSession a2dp_session = 7;
83 }
84 
85 message RFCommSession {
86 
87   // bytes transmitted.
88   optional int32 rx_bytes = 1;
89 
90   // bytes transmitted.
91   optional int32 tx_bytes = 2;
92 }
93 
94 // Session information that gets logged for every A2DP session.
95 message A2DPSession {
96 
97   // Media timer in milliseconds.
98   optional int32 media_timer_min_millis = 1;
99 
100   // Media timer in milliseconds.
101   optional int32 media_timer_max_millis = 2;
102 
103   // Media timer in milliseconds.
104   optional int32 media_timer_avg_millis = 3;
105 
106   // Buffer overruns count.
107   optional int32 buffer_overruns_max_count = 4;
108 
109   // Buffer overruns total.
110   optional int32 buffer_overruns_total = 5;
111 
112   // Buffer underruns average.
113   optional float buffer_underruns_average = 6;
114 
115   // Buffer underruns count.
116   optional int32 buffer_underruns_count = 7;
117 }
118 
119 message PairEvent {
120 
121   // The reason for disconnecting
122   // https://cs.corp.google.com/#android/system/bt/stack/include/hcidefs.h&q=failed_establish.
123   optional int32 disconnect_reason = 1;
124 
125   // Pair event time
126   optional int64 event_time_millis = 2; // [(datapol.semantic_type) = ST_TIMESTAMP];
127 
128   // The information about the device which it is paired to.
129   optional DeviceInfo device_paired_with = 3;
130 }
131 
132 message WakeEvent {
133 
134   // Information about the wake event type.
135   enum WakeEventType {
136 
137      // Type is unknown.
138      UNKNOWN = 0;
139 
140      // WakeLock was acquired.
141      ACQUIRED = 1;
142 
143      // WakeLock was released.
144      RELEASED = 2;
145   }
146 
147   // Information about the wake event type.
148   optional WakeEventType wake_event_type = 1;
149 
150   // Initiator of the scan. Only the first three names will be stored.
151   // e.g. com.google.gms.
152   optional string requestor = 2;
153 
154   // Name of the wakelock (e.g. bluedroid_timer).
155   optional string name = 3;
156 
157   // Time of the event.
158   optional int64 event_time_millis = 4; // [(datapol.semantic_type) = ST_TIMESTAMP];
159 }
160 
161 message ScanEvent {
162 
163   // Scan type.
164   enum ScanTechnologyType {
165 
166      // Scan Type is unknown.
167      SCAN_TYPE_UNKNOWN = 0;
168 
169      SCAN_TECH_TYPE_LE = 1;
170 
171      SCAN_TECH_TYPE_BREDR = 2;
172 
173      SCAN_TECH_TYPE_BOTH = 3;
174   }
175 
176   // Scan event type.
177   enum ScanEventType {
178 
179      // Scan started.
180      SCAN_EVENT_START = 0;
181 
182      // Scan stopped.
183      SCAN_EVENT_STOP = 1;
184   }
185 
186   // Scan event type.
187   optional ScanEventType scan_event_type = 1;
188 
189   // Initiator of the scan. Only the first three names will be stored.
190   // e.g. com.google.gms.
191   optional string initiator = 2;
192 
193   // Technology used for scanning.
194   optional ScanTechnologyType scan_technology_type = 3;
195 
196   // Number of results returned.
197   optional int32 number_results = 4;
198 
199   // Time of the event.
200   optional int64 event_time_millis = 5; // [(datapol.semantic_type) = ST_TIMESTAMP];
201 }
202