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

Commit c3a654f6 authored by Himanshu Rawat's avatar Himanshu Rawat Committed by Gerrit Code Review
Browse files

Merge changes I909053c7,Ibc502eec into main

* changes:
  Remove restricted devices only in non-restricted mode
  Save user ID in restricted mode
parents 42d1b04c c4b7f139
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -245,6 +245,7 @@ cc_library_static {
    ],
    shared_libs: [
        "libcrypto",
        "libcutils",
    ],
    cflags: [
        /* we export all classes, so change default visibility, instead of having EXPORT_SYMBOL on each class*/
+2 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ bool btif_config_remove(const std::string& section, const std::string& key);

void btif_config_remove_device(const std::string& section);

void btif_config_remove_device_with_key(const std::string& key);

size_t btif_config_get_bin_length(const std::string& section, const std::string& key);

std::vector<RawAddress> btif_config_get_paired_devices();
+11 −0
Original line number Diff line number Diff line
@@ -334,6 +334,17 @@ void btif_storage_set_leaudio_has_acceptlist(const RawAddress& address, bool add
 ******************************************************************************/
bool btif_storage_is_restricted_device(const RawAddress* remote_bd_addr);

/*******************************************************************************
 *
 * Function         btif_storage_prune_devices
 *
 * Description      Removes restricted mode devices in non-restricted mode
 *
 * Returns          none
 *
 ******************************************************************************/
void btif_storage_prune_devices();

bt_status_t btif_storage_add_ble_bonding_key(RawAddress* remote_bd_addr, const uint8_t* key,
                                             uint8_t key_type, uint8_t key_length);
bt_status_t btif_storage_get_ble_bonding_key(const RawAddress& remote_bd_addr, uint8_t key_type,
+6 −0
Original line number Diff line number Diff line
@@ -314,6 +314,12 @@ void btif_config_remove_device(const std::string& section) {
  bluetooth::shim::BtifConfigInterface::RemoveSection(section);
}

void btif_config_remove_device_with_key(const std::string& key) {
  log::assert_that(bluetooth::shim::is_gd_stack_started_up(),
                   "assert failed: bluetooth::shim::is_gd_stack_started_up()");
  bluetooth::shim::BtifConfigInterface::RemoveSectionWithProperty(key);
}

bool btif_config_clear(void) {
  log::assert_that(bluetooth::shim::is_gd_stack_started_up(),
                   "assert failed: bluetooth::shim::is_gd_stack_started_up()");
+4 −1
Original line number Diff line number Diff line
@@ -59,7 +59,6 @@
#include "btif_api.h"
#include "btif_bqr.h"
#include "btif_config.h"
#include "btif_dm.h"
#include "btif_metrics_logging.h"
#include "btif_sdp.h"
#include "btif_storage.h"
@@ -1923,6 +1922,10 @@ void BTIF_dm_report_inquiry_status_change(tBTM_INQUIRY_STATE status) {
}

void BTIF_dm_enable() {
  if (com::android::bluetooth::flags::guest_mode_bond()) {
    btif_storage_prune_devices();
  }

  BD_NAME bdname;
  bt_status_t status;
  bt_property_t prop;
Loading