Home | History | Annotate | Download | only in protos
      1 // Copyright 2014 Google Inc. All Rights Reserved.
      2 // Author: pkanwar (a] google.com (Pankaj Kanwar)
      3 // Protos for uploading bluetooth metrics.
      4 
      5 syntax = "proto2";
      6 option optimize_for = LITE_RUNTIME;
      7 
      8 package clearcut.connectivity;
      9 
     10 option java_package = "com.google.wireless.android.play.playlog.connectivity";
     11 // option (datapol.file_vetting_status) = "latest";
     12 
     13 // import "storage/datapol/annotations/proto/semantic_annotations.proto";
     14 
     15 message BluetoothLog {
     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   // Number of bonded devices.
     29   optional int32 num_bonded_devices = 5;
     30 
     31   // Number of BluetoothSession including discarded ones beyond capacity
     32   optional int64 num_bluetooth_session = 6;
     33 
     34   // Number of PairEvent including discarded ones beyond capacity
     35   optional int64 num_pair_event = 7;
     36 
     37   // Number of WakeEvent including discarded ones beyond capacity
     38   optional int64 num_wake_event = 8;
     39 
     40   // Number of ScanEvent including discarded ones beyond capacity
     41   optional int64 num_scan_event = 9;
     42 }
     43 
     44 // The information about the device.
     45 message DeviceInfo {
     46   // Device type.
     47   enum DeviceType {
     48     // Type is unknown.
     49     DEVICE_TYPE_UNKNOWN = 0;
     50 
     51     DEVICE_TYPE_BREDR = 1;
     52 
     53     DEVICE_TYPE_LE = 2;
     54 
     55     DEVICE_TYPE_DUMO = 3;
     56   }
     57 
     58   // Device class
     59   // https://cs.corp.google.com/#android/system/bt/stack/include/btm_api.h&q=major_computer.
     60   optional int32 device_class = 1;
     61 
     62   // Device type.
     63   optional DeviceType device_type = 2;
     64 }
     65 
     66 // Information that gets logged for every Bluetooth connection.
     67 message BluetoothSession {
     68   // Type of technology used in the connection.
     69   enum ConnectionTechnologyType {
     70     CONNECTION_TECHNOLOGY_TYPE_UNKNOWN = 0;
     71 
     72     CONNECTION_TECHNOLOGY_TYPE_LE = 1;
     73 
     74     CONNECTION_TECHNOLOGY_TYPE_BREDR = 2;
     75   }
     76 
     77   enum DisconnectReasonType {
     78     UNKNOWN = 0;
     79 
     80     // A metrics dump takes a snapshot of current Bluetooth session and thus
     81     // is not a real disconnect, but a discontinuation in metrics logging.
     82     // This enum indicates this situation.
     83     METRICS_DUMP = 1;
     84 
     85     NEXT_START_WITHOUT_END_PREVIOUS = 2;
     86   }
     87 
     88   // Duration of the session.
     89   optional int64 session_duration_sec = 2;
     90 
     91   // Technology type.
     92   optional ConnectionTechnologyType connection_technology_type = 3;
     93 
     94   // Reason for disconnecting.
     95   optional string disconnect_reason = 4 [deprecated = true];
     96 
     97   // The information about the device which it is connected to.
     98   optional DeviceInfo device_connected_to = 5;
     99 
    100   // The information about the RFComm session.
    101   optional RFCommSession rfcomm_session = 6;
    102 
    103   // The information about the A2DP audio session.
    104   optional A2DPSession a2dp_session = 7;
    105 
    106   // Numeric reason for disconnecting as defined in metrics.h
    107   optional DisconnectReasonType disconnect_reason_type = 8;
    108 }
    109 
    110 message RFCommSession {
    111   // bytes transmitted.
    112   optional int32 rx_bytes = 1;
    113 
    114   // bytes transmitted.
    115   optional int32 tx_bytes = 2;
    116 }
    117 
    118 // Session information that gets logged for A2DP session.
    119 message A2DPSession {
    120   // Media timer in milliseconds.
    121   optional int32 media_timer_min_millis = 1;
    122 
    123   // Media timer in milliseconds.
    124   optional int32 media_timer_max_millis = 2;
    125 
    126   // Media timer in milliseconds.
    127   optional int32 media_timer_avg_millis = 3;
    128 
    129   // Buffer overruns count.
    130   optional int32 buffer_overruns_max_count = 4;
    131 
    132   // Buffer overruns total.
    133   optional int32 buffer_overruns_total = 5;
    134 
    135   // Buffer underruns average.
    136   optional float buffer_underruns_average = 6;
    137 
    138   // Buffer underruns count.
    139   optional int32 buffer_underruns_count = 7;
    140 
    141   // Total audio time in this A2DP session
    142   optional int64 audio_duration_millis = 8;
    143 }
    144 
    145 message PairEvent {
    146   // The reason for disconnecting
    147   // https://cs.corp.google.com/#android/system/bt/stack/include/hcidefs.h&q=failed_establish.
    148   optional int32 disconnect_reason = 1;
    149 
    150   // Pair event time
    151   optional int64 event_time_millis =
    152       2;  // [(datapol.semantic_type) = ST_TIMESTAMP];
    153 
    154   // The information about the device which it is paired to.
    155   optional DeviceInfo device_paired_with = 3;
    156 }
    157 
    158 message WakeEvent {
    159   // Information about the wake event type.
    160   enum WakeEventType {
    161     // Type is unknown.
    162     UNKNOWN = 0;
    163 
    164     // WakeLock was acquired.
    165     ACQUIRED = 1;
    166 
    167     // WakeLock was released.
    168     RELEASED = 2;
    169   }
    170 
    171   // Information about the wake event type.
    172   optional WakeEventType wake_event_type = 1;
    173 
    174   // Initiator of the scan. Only the first three names will be stored.
    175   // e.g. com.google.gms.
    176   optional string requestor = 2;
    177 
    178   // Name of the wakelock (e.g. bluedroid_timer).
    179   optional string name = 3;
    180 
    181   // Time of the event.
    182   optional int64 event_time_millis =
    183       4;  // [(datapol.semantic_type) = ST_TIMESTAMP];
    184 }
    185 
    186 message ScanEvent {
    187   // Scan type.
    188   enum ScanTechnologyType {
    189     // Scan Type is unknown.
    190     SCAN_TYPE_UNKNOWN = 0;
    191 
    192     SCAN_TECH_TYPE_LE = 1;
    193 
    194     SCAN_TECH_TYPE_BREDR = 2;
    195 
    196     SCAN_TECH_TYPE_BOTH = 3;
    197   }
    198 
    199   // Scan event type.
    200   enum ScanEventType {
    201     // Scan started.
    202     SCAN_EVENT_START = 0;
    203 
    204     // Scan stopped.
    205     SCAN_EVENT_STOP = 1;
    206   }
    207 
    208   // Scan event type.
    209   optional ScanEventType scan_event_type = 1;
    210 
    211   // Initiator of the scan. Only the first three names will be stored.
    212   // e.g. com.google.gms.
    213   optional string initiator = 2;
    214 
    215   // Technology used for scanning.
    216   optional ScanTechnologyType scan_technology_type = 3;
    217 
    218   // Number of results returned.
    219   optional int32 number_results = 4;
    220 
    221   // Time of the event.
    222   optional int64 event_time_millis =
    223       5;  // [(datapol.semantic_type) = ST_TIMESTAMP];
    224 }
    225