summaryrefslogtreecommitdiff
path: root/system/main/shim/shim.h
blob: ca96eea6fa25c38bb5f3a81156f97dad4ef73b7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * Copyright 2019 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.
 */

#pragma once

/**
 * Gabeldorsche related legacy-only-stack-side expansion and support code.
 */
#include "btcore/include/module.h"
#include "main/shim/entry.h"
#include "osi/include/future.h"

static const char GD_IDLE_MODULE[] = "gd_idle_module";
static const char GD_SHIM_MODULE[] = "gd_shim_module";

constexpr future_t* kReturnImmediate = nullptr;
constexpr module_lifecycle_fn kUnusedModuleApi = nullptr;
constexpr char* kUnusedModuleDependencies = nullptr;

namespace bluetooth {
namespace shim {

/**
 * Checks if the bluetooth stack is running in legacy or gd mode.
 *
 * This check is used throughout the legacy stack to determine which
 * methods, classes or functions to invoke.  The default (false) mode
 * is the legacy mode which runs the original legacy bluetooth stack.
 * When enabled (true) the core portion of the gd stack is invoked
 * at key points to execute equivalent functionality using the
 * gd core components.
 *
 * @return true if using gd shim core, false if using legacy.
 */
bool is_gd_security_enabled();
bool is_gd_link_policy_enabled();
bool is_gd_l2cap_enabled();
bool is_gd_shim_enabled();
bool is_gd_btaa_enabled();

/**
 * Checks if the bluetooth gd stack has been started up.
 *
 * @return true if bluetooth gd stack is started, false otherwise.
 */
bool is_gd_stack_started_up();

/**
 * Checks if the dumpsys module has been started.
 *
 * @return true if specified module has started, false otherwise.
 */
bool is_gd_dumpsys_module_started();

}  // namespace shim
}  // namespace bluetooth