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

Commit 2cb3c3fa authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "configurable private address rotation intervals" into main

parents 094c1fcf bbb0bb88
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -8,3 +8,19 @@ prop {
    access: Readonly
    prop_name: "bluetooth.ble.vnd.included"
}

prop {
    api_name: "random_address_rotation_interval_min"
    type: Integer
    scope: Internal
    access: Readonly
    prop_name: "bluetooth.ble.random_address_rotation_interval_min"
}

prop {
    api_name: "random_address_rotation_interval_max"
    type: Integer
    scope: Internal
    access: Readonly
    prop_name: "bluetooth.ble.random_address_rotation_interval_max"
}
+7 −0
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ cc_defaults {
        "libbt-platform-protos-lite",
        "libbt_shim_bridge",
        "libbt_shim_ffi",
        "libcom.android.sysprop.bluetooth.wrapped",
        "libosi",
        "server_configurable_flags",
    ],
@@ -318,10 +319,12 @@ cc_binary {
        "libbt_shim_bridge",
        "libbt_shim_ffi",
        "libchrome",
        "libcom.android.sysprop.bluetooth.wrapped",
        "libflatbuffers-cpp",
        "libosi",
    ],
    shared_libs: [
        "libPlatformProperties",
        "libcrypto",
        "libgrpc++",
        "libgrpc_wrap",
@@ -449,12 +452,14 @@ cc_test {
        "libbt_shim_ffi",
        "libc++fs",
        "libchrome",
        "libcom.android.sysprop.bluetooth.wrapped",
        "libflagtest",
        "libflatbuffers-cpp",
        "libgmock",
        "libosi",
    ],
    shared_libs: [
        "libPlatformProperties",
        "libbase",
        "libcrypto",
        "server_configurable_flags",
@@ -583,6 +588,7 @@ cc_defaults {
        "libbt_shim_bridge",
        "libbt_shim_ffi",
        "libchrome",
        "libcom.android.sysprop.bluetooth.wrapped",
        "libgmock",
        "libgtest",
        "libosi",
@@ -592,6 +598,7 @@ cc_defaults {
        "BluetoothGeneratedDumpsysDataSchema_h",
    ],
    shared_libs: [
        "libPlatformProperties",
        "libbase",
        "libcrypto",
        "libgrpc++",
+8 −3
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
 */
#include "security_manager_impl.h"

#include <android_bluetooth_sysprop.h>

#include "common/bind.h"
#include "hci/address_with_type.h"
#include "hci/octets.h"
@@ -109,9 +111,12 @@ void SecurityManagerImpl::Init() {
  hci::LeAddressManager::AddressPolicy address_policy = hci::LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS;
  hci::AddressWithType address_with_type(hci::Address{}, hci::AddressType::RANDOM_DEVICE_ADDRESS);

  /* 7 minutes minimum, 15 minutes maximum for random address refreshing */
  auto minimum_rotation_time = std::chrono::minutes(7);
  auto maximum_rotation_time = std::chrono::minutes(15);
  /* Default to 7 minutes minimum, 15 minutes maximum for random address refreshing;
   * device can override. */
  auto minimum_rotation_time = std::chrono::minutes(
      GET_SYSPROP(Ble, random_address_rotation_interval_min, 7));
  auto maximum_rotation_time = std::chrono::minutes(
      GET_SYSPROP(Ble, random_address_rotation_interval_max, 15));

  acl_manager_->SetPrivacyPolicyForInitiatorAddress(
      address_policy, address_with_type, minimum_rotation_time, maximum_rotation_time);
+2 −0
Original line number Diff line number Diff line
@@ -219,6 +219,7 @@ cc_test {
        "libbt_shim_ffi",
        "libbtdevice",
        "libchrome",
        "libcom.android.sysprop.bluetooth.wrapped",
        "libevent",
        "libflatbuffers-cpp",
        "libgmock",
@@ -226,6 +227,7 @@ cc_test {
        "libosi",
    ],
    shared_libs: [
        "libPlatformProperties",
        "libcrypto",
        "server_configurable_flags",
    ],