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

Commit 6d0856f9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Replace sanitize.address with sanitize.hwaddress" am: c0fee617 am:...

Merge "Replace sanitize.address with sanitize.hwaddress" am: c0fee617 am: e1dc57cd am: 9d261983

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2266483



Change-Id: Ie5f6a086aac8d9b2568b545d395ca1c6ce3afb61
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 92273a6d 9d261983
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -833,7 +833,10 @@ cc_test {
        ":BluetoothBtaaSources_host",
        ":BluetoothBtaaSources_host",
        ":BluetoothHalSources_hci_host",
        ":BluetoothHalSources_hci_host",
        ":BluetoothOsSources_host",
        ":BluetoothOsSources_host",
        ":TestCommonLogMsg",
        ":TestCommonMainHandler",
        ":TestCommonMainHandler",
        ":TestCommonMockFunctions",
        ":TestCommonStackConfig",
        ":TestMockBta",
        ":TestMockBta",
        ":TestMockBtif",
        ":TestMockBtif",
        ":TestMockDevice",
        ":TestMockDevice",
+8 −69
Original line number Original line Diff line number Diff line
@@ -60,77 +60,10 @@ tL2C_CB l2cb;


const hci_t* hci_layer_get_interface() { return nullptr; }
const hci_t* hci_layer_get_interface() { return nullptr; }


void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {}

const std::string kSmpOptions("mock smp options");
const std::string kSmpOptions("mock smp options");
const std::string kBroadcastAudioConfigOptions(
const std::string kBroadcastAudioConfigOptions(
    "mock broadcast audio config options");
    "mock broadcast audio config options");


bool get_trace_config_enabled(void) { return false; }
bool get_pts_avrcp_test(void) { return false; }
bool get_pts_secure_only_mode(void) { return false; }
bool get_pts_conn_updates_disabled(void) { return false; }
bool get_pts_crosskey_sdp_disable(void) { return false; }
const std::string* get_pts_smp_options(void) { return &kSmpOptions; }
int get_pts_smp_failure_case(void) { return 123; }
bool get_pts_force_eatt_for_notifications(void) { return false; }
bool get_pts_connect_eatt_unconditionally(void) { return false; }
bool get_pts_connect_eatt_before_encryption(void) { return false; }
bool get_pts_unencrypt_broadcast(void) { return false; }
bool get_pts_eatt_peripheral_collision_support(void) { return false; }
bool get_pts_use_eatt_for_all_services(void) { return false; }
bool get_pts_force_le_audio_multiple_contexts_metadata(void) { return false; }
bool get_pts_l2cap_ecoc_upper_tester(void) { return false; }
int get_pts_l2cap_ecoc_min_key_size(void) { return -1; }
int get_pts_l2cap_ecoc_initial_chan_cnt(void) { return -1; }
bool get_pts_l2cap_ecoc_connect_remaining(void) { return false; }
int get_pts_l2cap_ecoc_send_num_of_sdu(void) { return -1; }
bool get_pts_l2cap_ecoc_reconfigure(void) { return false; }
const std::string* get_pts_broadcast_audio_config_options(void) {
  return &kBroadcastAudioConfigOptions;
}
bool get_pts_le_audio_disable_ases_before_stopping(void) { return false; }
config_t* get_all(void) { return nullptr; }
const packet_fragmenter_t* packet_fragmenter_get_interface() { return nullptr; }

stack_config_t mock_stack_config{
    .get_trace_config_enabled = get_trace_config_enabled,
    .get_pts_avrcp_test = get_pts_avrcp_test,
    .get_pts_secure_only_mode = get_pts_secure_only_mode,
    .get_pts_conn_updates_disabled = get_pts_conn_updates_disabled,
    .get_pts_crosskey_sdp_disable = get_pts_crosskey_sdp_disable,
    .get_pts_smp_options = get_pts_smp_options,
    .get_pts_smp_failure_case = get_pts_smp_failure_case,
    .get_pts_force_eatt_for_notifications =
        get_pts_force_eatt_for_notifications,
    .get_pts_connect_eatt_unconditionally =
        get_pts_connect_eatt_unconditionally,
    .get_pts_connect_eatt_before_encryption =
        get_pts_connect_eatt_before_encryption,
    .get_pts_unencrypt_broadcast = get_pts_unencrypt_broadcast,
    .get_pts_eatt_peripheral_collision_support =
        get_pts_eatt_peripheral_collision_support,
    .get_pts_l2cap_ecoc_upper_tester = get_pts_l2cap_ecoc_upper_tester,
    .get_pts_l2cap_ecoc_min_key_size = get_pts_l2cap_ecoc_min_key_size,
    .get_pts_force_le_audio_multiple_contexts_metadata =
        get_pts_force_le_audio_multiple_contexts_metadata,
    .get_pts_l2cap_ecoc_initial_chan_cnt = get_pts_l2cap_ecoc_initial_chan_cnt,
    .get_pts_l2cap_ecoc_connect_remaining =
        get_pts_l2cap_ecoc_connect_remaining,
    .get_pts_l2cap_ecoc_send_num_of_sdu = get_pts_l2cap_ecoc_send_num_of_sdu,
    .get_pts_l2cap_ecoc_reconfigure = get_pts_l2cap_ecoc_reconfigure,
    .get_pts_broadcast_audio_config_options =
        get_pts_broadcast_audio_config_options,
    .get_pts_le_audio_disable_ases_before_stopping =
        get_pts_le_audio_disable_ases_before_stopping,
    .get_all = get_all,
};
const stack_config_t* stack_config_get_interface(void) {
  return &mock_stack_config;
}

std::map<std::string, int> mock_function_count_map;

namespace {
namespace {


using testing::_;
using testing::_;
@@ -160,8 +93,14 @@ class StackBtmTest : public Test {
class StackBtmWithInitFreeTest : public StackBtmTest {
class StackBtmWithInitFreeTest : public StackBtmTest {
 public:
 public:
 protected:
 protected:
  void SetUp() override { btm_cb.Init(BTM_SEC_MODE_SC); }
  void SetUp() override {
  void TearDown() override { btm_cb.Free(); }
    StackBtmTest::SetUp();
    btm_cb.Init(BTM_SEC_MODE_SC);
  }
  void TearDown() override {
    btm_cb.Free();
    StackBtmTest::TearDown();
  }
};
};


TEST_F(StackBtmTest, GlobalLifecycle) {
TEST_F(StackBtmTest, GlobalLifecycle) {
+14 −0
Original line number Original line Diff line number Diff line
@@ -354,6 +354,13 @@ filegroup {
  ],
  ],
}
}


filegroup {
  name: "TestMockStackEatt",
  srcs: [
      "mock/mock_stack_eatt*.cc",
  ],
}

filegroup {
filegroup {
  name: "TestMockStackGatt",
  name: "TestMockStackGatt",
  srcs: [
  srcs: [
@@ -438,6 +445,13 @@ filegroup {
  ],
  ],
}
}


filegroup {
  name: "TestCommonLogMsg",
  srcs: [
      "common/log_msg.cc",
  ],
}

filegroup {
filegroup {
  name: "TestMockBluetoothInterface",
  name: "TestMockBluetoothInterface",
  srcs: [
  srcs: [
+19 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright 2022 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <cstdint>

extern "C" void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {}