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

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

Merge changes I1741929c,I6496b34c

* changes:
  Add flag to toggle IRK rotation
  Pass IRK rotation flag into native
parents bf85167b c1ea6e27
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5259,6 +5259,7 @@ public class AdapterService extends Service {
    private static final String GD_LINK_POLICY_FLAG = "INIT_gd_link_policy";
    private static final String GATT_ROBUST_CACHING_CLIENT_FLAG = "INIT_gatt_robust_caching_client";
    private static final String GATT_ROBUST_CACHING_SERVER_FLAG = "INIT_gatt_robust_caching_server";
    private static final String IRK_ROTATION_FLAG = "INIT_irk_rotation";

    /**
     * Logging flags logic (only applies to DEBUG and VERBOSE levels):
@@ -5324,6 +5325,9 @@ public class AdapterService extends Service {
                GATT_ROBUST_CACHING_SERVER_FLAG, false)) {
            initFlags.add(String.format("%s=%s", GATT_ROBUST_CACHING_SERVER_FLAG, "true"));
        }
        if (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_BLUETOOTH, IRK_ROTATION_FLAG, false)) {
            initFlags.add(String.format("%s=%s", IRK_ROTATION_FLAG, "true"));
        }
        if (DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_BLUETOOTH,
                LOGGING_DEBUG_ENABLED_FOR_ALL_FLAG, false)) {
            initFlags.add(String.format("%s=%s", LOGGING_DEBUG_ENABLED_FOR_ALL_FLAG, "true"));
+3 −1
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ constexpr char kPrivateAddressPrefix[] = "xx:xx:xx:xx";
#include "btif_hh.h"
#include "btif_util.h"
#include "device/include/controller.h"
#include "gd/common/init_flags.h"
#include "osi/include/allocator.h"
#include "osi/include/compat.h"
#include "osi/include/config.h"
@@ -972,7 +973,8 @@ bt_status_t btif_storage_remove_bonded_device(

  /* Check the length of the paired devices, and if 0 then reset IRK */
  auto paired_devices = btif_config_get_paired_devices();
  if (paired_devices.empty()) {
  if (paired_devices.empty() &&
      bluetooth::common::init_flags::irk_rotation_is_enabled()) {
    LOG_INFO("Last paired device removed, resetting IRK");
    BTA_DmBleResetId();
  }
+2 −1
Original line number Diff line number Diff line
@@ -82,7 +82,8 @@ init_flags!(
        gatt_robust_caching_server,
        btaa_hci,
        gd_rust,
        gd_link_policy
        gd_link_policy,
        irk_rotation
    },
    dependencies: {
        gd_core => gd_security
+1 −0
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@ mod ffi {
        fn btaa_hci_is_enabled() -> bool;
        fn gd_rust_is_enabled() -> bool;
        fn gd_link_policy_is_enabled() -> bool;
        fn irk_rotation_is_enabled() -> bool;
    }
}