1 /*
2  * Copyright (C) 2021 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 #ifndef ANDROID_HARDWARE_CONTEXTHUB_COMMON_PERMISSIONS_UTIL_H
18 #define ANDROID_HARDWARE_CONTEXTHUB_COMMON_PERMISSIONS_UTIL_H
19 
20 #include <string>
21 #include <vector>
22 
23 namespace android {
24 namespace hardware {
25 namespace contexthub {
26 namespace common {
27 namespace implementation {
28 
29 // List of permissions supported by this HAL.
30 const std::string kBackgroundLocationPerm =
31     "android.permission.ACCESS_BACKGROUND_LOCATION";
32 const std::string kFineLocationPerm = "android.permission.ACCESS_FINE_LOCATION";
33 const std::string kRecordAudioPerm = "android.permission.RECORD_AUDIO";
34 const std::string kBluetoothScanPerm = "android.permission.BLUETOOTH_SCAN";
35 const std::vector<std::string> kSupportedPermissions = {
36     kBackgroundLocationPerm, kFineLocationPerm, kRecordAudioPerm,
37     kBluetoothScanPerm};
38 
39 //! Converts the CHRE permissions bitmask to a list of CHRE permissions.
40 std::vector<std::string> chreToAndroidPermissions(uint32_t chrePermissions);
41 
42 }  // namespace implementation
43 }  // namespace common
44 }  // namespace contexthub
45 }  // namespace hardware
46 }  // namespace android
47 
48 #endif  // ANDROID_HARDWARE_CONTEXTHUB_COMMON_PERMISSIONS_UTIL_H
49