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

Commit 897ec1ef authored by David Duarte's avatar David Duarte Committed by Gerrit Code Review
Browse files

Merge "Replace bt_did.conf by sysprops" into main

parents 4f7c36b7 8a9a567f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ sysprop_library {
        "avrcp.sysprop",
        "ble.sysprop",
        "bta.sysprop",
        "device_id.sysprop",
        "hfp.sysprop",
    ],
    property_owner: "Platform",
+26 −0
Original line number Diff line number Diff line
module: "android.sysprop.bluetooth.DeviceIDProperties"
owner: Platform

prop {
    api_name: "vendor_id"
    type: Integer
    scope: Internal
    access: Readonly
    prop_name: "bluetooth.device_id.vendor_id"
}

prop {
    api_name: "vendor_id_source"
    type: Integer
    scope: Internal
    access: Readonly
    prop_name: "bluetooth.device_id.vendor_id_source"
}

prop {
    api_name: "product_id"
    type: Integer
    scope: Internal
    access: Readonly
    prop_name: "bluetooth.device_id.product_id"
}
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <avrcp.sysprop.h>
#include <ble.sysprop.h>
#include <bta.sysprop.h>
#include <device_id.sysprop.h>
#include <hfp.sysprop.h>

#define GET_SYSPROP(namespace, prop, default) \
+1 −0
Original line number Diff line number Diff line
@@ -244,6 +244,7 @@ cc_library_static {
        "libbt-platform-protos-lite",
        "libbt-stack-core",
        "libbt_shim_bridge",
        "libcom.android.sysprop.bluetooth.wrapped",
        "libflatbuffers-cpp",
        "libstatslog_bt",
    ],
+21 −2
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@

#define LOG_TAG "bt_btif_core"

#include <android_bluetooth_flags.h>
#include <android_bluetooth_sysprop.h>
#include <base/at_exit.h>
#include <base/functional/bind.h>
#include <base/logging.h>
@@ -216,8 +218,25 @@ void btif_enable_bluetooth_evt() {

  GetInterfaceToProfiles()->onBluetoothEnabled();

  /* load did configuration */
  if (!IS_FLAG_ENABLED(load_did_config_from_sysprops)) {
    bte_load_did_conf(BTE_DID_CONF_FILE);
  } else {
    tSDP_DI_RECORD record = {
        .vendor = uint16_t(
            GET_SYSPROP(DeviceIDProperties, vendor_id, LMP_COMPID_GOOGLE)),
        .vendor_id_source = uint16_t(GET_SYSPROP(
            DeviceIDProperties, vendor_id_source, DI_VENDOR_ID_SOURCE_BTSIG)),
        .product = uint16_t(GET_SYSPROP(DeviceIDProperties, product_id, 0)),
        .primary_record = true,
    };

    uint32_t record_handle;
    tBTA_STATUS status = BTA_DmSetLocalDiRecord(&record, &record_handle);
    if (status != BTA_SUCCESS) {
      log::error("unable to set device ID record error {}.",
                 bta_status_text(status));
    }
  }

  btif_dm_load_local_oob();