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_SHIM_MODULE[] = "gd_shim_module"; 27 28 constexpr future_t* kReturnImmediate = nullptr; 29 constexpr module_lifecycle_fn kUnusedModuleApi = nullptr; 30 constexpr char* kUnusedModuleDependencies = nullptr; 31 32 namespace bluetooth { 33 namespace shim { 34 35 /** 36 * Checks if the bluetooth stack is running in legacy or gd mode. 37 * 38 * This check is used throughout the legacy stack to determine which 39 * methods, classes or functions to invoke. The default (false) mode 40 * is the legacy mode which runs the original legacy bluetooth stack. 41 * When enabled (true) the core portion of the gd stack is invoked 42 * at key points to execute equivalent functionality using the 43 * gd core components. 44 * 45 * @return true if using gd shim core, false if using legacy. 46 */ 47 bool is_gd_link_policy_enabled(); 48 bool is_gd_l2cap_enabled(); 49 bool is_gd_shim_enabled(); 50 bool is_gd_btaa_enabled(); 51 52 /** 53 * Checks if the bluetooth gd stack has been started up. 54 * 55 * @return true if bluetooth gd stack is started, false otherwise. 56 */ 57 bool is_gd_stack_started_up(); 58 59 /** 60 * Checks if the dumpsys module has been started. 61 * 62 * @return true if specified module has started, false otherwise. 63 */ 64 bool is_gd_dumpsys_module_started(); 65 66 /** 67 * Checks whether discovery should be classic only (vs also triggering BLE). 68 * 69 * @return true if discovery should be limited to classic. 70 */ 71 bool is_classic_discovery_only_enabled(); 72 73 } // namespace shim 74 } // namespace bluetooth 75