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

Commit c30c8578 authored by Rob Seymour's avatar Rob Seymour
Browse files

Add prebuilt_etc module (bt_controller_properties) for controller properties.

Add prebuilt_etc module to copy controller_properties.json to:
/vendor/etc/bluetooth

Update default path for controller properties to match the above and look for
the file under /vendor/etc/bluetooth/

Add bt_controller_properties as a required module of:
android.hardware.bluetooth@1.1-service.sim

Bug: 202523580
Test: atest CtsBluetoothTestCases
Tag: #refactor
Change-Id: I111135a28a260c91a535256f99985dc42586a40b
parent 84878903
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -72,6 +72,7 @@ cc_binary {
        "packages/modules/Bluetooth/system/stack/include",
    ],
    init_rc: ["android.hardware.bluetooth@1.1-service.sim.rc"],
    required: ["bt_controller_properties"],
}

cc_library_shared {
+8 −0
Original line number Diff line number Diff line
@@ -12,3 +12,11 @@ prebuilt_etc_host {
    src: "controller_properties.json",
    sub_dir: "rootcanal/data",
}

prebuilt_etc {
    name: "bt_controller_properties",
    src: "controller_properties.json",
    vendor: true,
    filename_from_src: true,
    sub_dir: "bluetooth",
}
+2 −1
Original line number Diff line number Diff line
@@ -48,7 +48,8 @@ using ::bluetooth::hci::CommandView;
// "Hci" to distinguish it as a controller command.
class DualModeController : public Device {
  // The location of the config file loaded to populate controller attributes.
  static constexpr char kControllerPropertiesFile[] = "/etc/bluetooth/controller_properties.json";
  static constexpr char kControllerPropertiesFile[] =
      "/vendor/etc/bluetooth/controller_properties.json";
  static constexpr uint16_t kSecurityManagerNumKeys = 15;

 public:
+2 −2
Original line number Diff line number Diff line
@@ -92,8 +92,8 @@ DeviceProperties::DeviceProperties(const std::string& file_name)

  std::string errs;
  if (!Json::parseFromStream(builder, file, &root, &errs)) {
    LOG_ERROR("Error reading controller properties from file: %s",
              errs.c_str());
    LOG_ERROR("Error reading controller properties from file: %s error: %s",
              file_name.c_str(), errs.c_str());
    return;
  }