Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bd8f4300 authored by Jack He's avatar Jack He
Browse files

Metrics: Move bluetooth.proto to one place

* Move bluetooth.proto to proto/ and compile it for both Java LITE
  runtime and C++ LITE runtime so that it can be shared between Java
  and native code
* Remove redundant comments in bluetooth.proto

Bug: 33693818
Test: make, toggle Bluetooth, clearcut server-client E2E test
      adb shell dumpsys bluetooth_manager --proto-bin
      ACTS tests: BtMetricsTest, BtFunhausMetricsTest
Change-Id: I7cd5e1b4fb8fcc197272ef8161ff384e53022424
(cherry picked from commit 8948b090088330d4ad12cd550986465228d20965)
parent 11ec5795
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,4 +19,5 @@ subdirs = [
    "types",
    "udrv",
    "tools",
    "proto",
]

proto/Android.bp

0 → 100644
+19 −0
Original line number Diff line number Diff line
java_library_static {
    name: "bluetooth-protos-lite",
    host_supported: true,
    proto: {
        type: "lite",
    },
    srcs: ["bluetooth/metrics/bluetooth.proto"],
}

cc_library_static {
    name: "libbt-protos-lite",
    host_supported: true,
    proto: {
        export_proto_headers: true,
        type: "lite",
    },
    srcs: ["bluetooth/metrics/bluetooth.proto"],
}
+23 −16
Original line number Diff line number Diff line
// Copyright 2014 Google Inc. All Rights Reserved.
// Author: pkanwar@google.com (Pankaj Kanwar)
// Protos for uploading bluetooth metrics.
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

syntax = "proto2";
option optimize_for = LITE_RUNTIME;

package clearcut.connectivity;
option optimize_for = LITE_RUNTIME;

option java_package = "com.google.wireless.android.play.playlog.connectivity";
// option (datapol.file_vetting_status) = "latest";
// C++ namespace: bluetooth::metrics::BluetoothMetricsProto
package bluetooth.metrics.BluetoothMetricsProto;

// import "storage/datapol/annotations/proto/semantic_annotations.proto";
option java_package = "com.android.bluetooth";
option java_outer_classname = "BluetoothMetricsProto";

message BluetoothLog {
  // Session information that gets logged for every BT connection.
@@ -144,7 +156,7 @@ message A2DPSession {

message PairEvent {
  // The reason for disconnecting
  // https://cs.corp.google.com/#android/packages/modules/Bluetooth/system/stack/include/hcidefs.h&q=failed_establish.
  // See: packages/modules/Bluetooth/system/stack/include/hcidefs.h, HCI_ERR_CONN_FAILED_ESTABLISHMENT
  optional int32 disconnect_reason = 1;

  // Pair event time
@@ -158,12 +170,9 @@ message PairEvent {
message WakeEvent {
  // Information about the wake event type.
  enum WakeEventType {
    // Type is unknown.
    UNKNOWN = 0;

    // WakeLock was acquired.
    ACQUIRED = 1;

    // WakeLock was released.
    RELEASED = 2;
  }
@@ -172,7 +181,7 @@ message WakeEvent {
  optional WakeEventType wake_event_type = 1;

  // Initiator of the scan. Only the first three names will be stored.
  // e.g. com.google.gms.
  // e.g. com.company.app
  optional string requestor = 2;

  // Name of the wakelock (e.g. bluedroid_timer).
@@ -186,7 +195,6 @@ message WakeEvent {
message ScanEvent {
  // Scan type.
  enum ScanTechnologyType {
    // Scan Type is unknown.
    SCAN_TYPE_UNKNOWN = 0;

    SCAN_TECH_TYPE_LE = 1;
@@ -200,7 +208,6 @@ message ScanEvent {
  enum ScanEventType {
    // Scan started.
    SCAN_EVENT_START = 0;

    // Scan stopped.
    SCAN_EVENT_STOP = 1;
  }
@@ -209,7 +216,7 @@ message ScanEvent {
  optional ScanEventType scan_event_type = 1;

  // Initiator of the scan. Only the first three names will be stored.
  // e.g. com.google.gms.
  // e.g. com.company.app
  optional string initiator = 2;

  // Technology used for scanning.
+1 −1
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ cc_test {
        "libbtcore",
        "libbt-bta",
        "libbluetooth-types",
        "libbt-protos-lite",
        "libosi",
        "libbt-protos",
    ],
}
+1 −1
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ cc_test {
        "libudrv-uipc",
        "libbluetooth-types",
        "libosi",
        "libbt-protos",
        "libbt-protos-lite",
    ],
    whole_static_libs: [
        "libbtif",
Loading