• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #pragma once
18 
19 /**
20  * Gabeldorsche related legacy-only-stack-side expansion and support code.
21  */
22 #include "btcore/include/module.h"
23 #include "main/shim/entry.h"
24 #include "osi/include/future.h"
25 
26 static const char GD_IDLE_MODULE[] = "gd_idle_module";
27 static const char GD_SHIM_MODULE[] = "gd_shim_module";
28 
29 constexpr future_t* kReturnImmediate = nullptr;
30 constexpr module_lifecycle_fn kUnusedModuleApi = nullptr;
31 constexpr char* kUnusedModuleDependencies = nullptr;
32 
33 namespace bluetooth {
34 namespace shim {
35 
36 /**
37  * Checks if the bluetooth stack is running in legacy or gd mode.
38  *
39  * This check is used throughout the legacy stack to determine which
40  * methods, classes or functions to invoke.  The default (false) mode
41  * is the legacy mode which runs the original legacy bluetooth stack.
42  * When enabled (true) the core portion of the gd stack is invoked
43  * at key points to execute equivalent functionality using the
44  * gd core components.
45  *
46  * @return true if using gd shim core, false if using legacy.
47  */
48 bool is_gd_advertising_enabled();
49 bool is_gd_scanning_enabled();
50 bool is_gd_security_enabled();
51 bool is_gd_acl_enabled();
52 bool is_gd_link_policy_enabled();
53 bool is_gd_hci_enabled();
54 bool is_gd_controller_enabled();
55 bool is_gd_l2cap_enabled();
56 bool is_gd_shim_enabled();
57 bool is_gd_btaa_enabled();
58 bool is_any_gd_enabled();
59 
60 /**
61  * Checks if the bluetooth gd stack has been started up.
62  *
63  * @return true if bluetooth gd stack is started, false otherwise.
64  */
65 bool is_gd_stack_started_up();
66 
67 /**
68  * Checks if the dumpsys module has been started.
69  *
70  * @return true if specified module has started, false otherwise.
71  */
72 bool is_gd_dumpsys_module_started();
73 
74 }  // namespace shim
75 }  // namespace bluetooth
76