1 /*
2  * Copyright 2019 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include "hci/acl_manager_mock.h"
18 #include "hci/controller_interface_mock.h"
19 #include "hci/distance_measurement_manager_mock.h"
20 #include "hci/hci_interface.h"
21 #include "hci/le_advertising_manager_mock.h"
22 #include "hci/le_scanning_manager_mock.h"
23 #include "lpp/lpp_offload_interface_mock.h"
24 #include "main/shim/entry.h"
25 #include "os/handler.h"
26 #include "storage/storage_module.h"
27 
28 namespace bluetooth {
29 namespace hci {
30 namespace testing {
31 
32 MockAclManager* mock_acl_manager_{nullptr};
33 MockControllerInterface* mock_controller_{nullptr};
34 shim::Dumpsys* shim_dumpsys_ = {};
35 HciInterface* mock_hci_layer_{nullptr};
36 os::Handler* mock_gd_shim_handler_{nullptr};
37 MockLeAdvertisingManager* mock_le_advertising_manager_{nullptr};
38 MockLeScanningManager* mock_le_scanning_manager_{nullptr};
39 MockDistanceMeasurementManager* mock_distance_measurement_manager_{nullptr};
40 
41 }  // namespace testing
42 }  // namespace hci
43 
44 namespace lpp::testing {
45 MockLppOffloadInterface* mock_lpp_offload_interface_{nullptr};
46 }  // namespace lpp::testing
47 
48 class Dumpsys;
49 
50 namespace shim {
51 
GetDumpsys()52 Dumpsys* GetDumpsys() { return hci::testing::shim_dumpsys_; }
GetAclManager()53 hci::AclManager* GetAclManager() { return hci::testing::mock_acl_manager_; }
GetController()54 hci::ControllerInterface* GetController() { return hci::testing::mock_controller_; }
GetHciLayer()55 hci::HciInterface* GetHciLayer() { return hci::testing::mock_hci_layer_; }
GetAdvertising()56 hci::LeAdvertisingManager* GetAdvertising() { return hci::testing::mock_le_advertising_manager_; }
GetScanning()57 hci::LeScanningManager* GetScanning() { return hci::testing::mock_le_scanning_manager_; }
GetDistanceMeasurementManager()58 hci::DistanceMeasurementManager* GetDistanceMeasurementManager() {
59   return hci::testing::mock_distance_measurement_manager_;
60 }
GetGdShimHandler()61 os::Handler* GetGdShimHandler() { return hci::testing::mock_gd_shim_handler_; }
GetSnoopLogger()62 hal::SnoopLogger* GetSnoopLogger() { return nullptr; }
GetStorage()63 storage::StorageModule* GetStorage() { return nullptr; }
GetCounterMetrics()64 metrics::CounterMetrics* GetCounterMetrics() { return nullptr; }
GetMsftExtensionManager()65 hci::MsftExtensionManager* GetMsftExtensionManager() { return nullptr; }
GetRemoteNameRequest()66 hci::RemoteNameRequestModule* GetRemoteNameRequest() { return nullptr; }
GetLppOffloadManager()67 lpp::LppOffloadInterface* GetLppOffloadManager() {
68   return lpp::testing::mock_lpp_offload_interface_;
69 }
70 
71 }  // namespace shim
72 }  // namespace bluetooth
73