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

Commit 9a30a9f9 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
parent b64aca18
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -19,4 +19,5 @@ subdirs = [
    "types",
    "types",
    "udrv",
    "udrv",
    "tools",
    "tools",
    "proto",
]
]

proto/Android.bp

0 → 100644
+19 −0
Original line number Original line 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 Original line Diff line number Diff line
// Copyright 2014 Google Inc. All Rights Reserved.
/*
// Author: pkanwar@google.com (Pankaj Kanwar)
 * Copyright (C) 2018 The Android Open Source Project
// Protos for uploading bluetooth metrics.
 *
 * 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";
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";
// C++ namespace: bluetooth::metrics::BluetoothMetricsProto
// option (datapol.file_vetting_status) = "latest";
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 {
message BluetoothLog {
  // Session information that gets logged for every BT connection.
  // Session information that gets logged for every BT connection.
@@ -144,7 +156,7 @@ message A2DPSession {


message PairEvent {
message PairEvent {
  // The reason for disconnecting
  // 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;
  optional int32 disconnect_reason = 1;


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

    // WakeLock was acquired.
    // WakeLock was acquired.
    ACQUIRED = 1;
    ACQUIRED = 1;

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


  // Initiator of the scan. Only the first three names will be stored.
  // 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;
  optional string requestor = 2;


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


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

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


  // Initiator of the scan. Only the first three names will be stored.
  // 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;
  optional string initiator = 2;


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