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_shim_enabled(); 49 50 /** 51 * Checks if the bluetooth gd stack has been started up. 52 * 53 * @return true if bluetooth gd stack is started, false otherwise. 54 */ 55 bool is_gd_stack_started_up(); 56 57 } // namespace shim 58 } // namespace bluetooth 59