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 <hidl/HidlSupport.h> 21 22 namespace android { 23 namespace hardware { 24 namespace contexthub { 25 namespace common { 26 namespace implementation { 27 28 // List of permissions supported by this HAL. 29 const hidl_string kBackgroundLocationPerm = 30 "android.permission.ACCESS_BACKGROUND_LOCATION"; 31 const hidl_string kFineLocationPerm = "android.permission.ACCESS_FINE_LOCATION"; 32 const hidl_string kRecordAudioPerm = "android.permission.RECORD_AUDIO"; 33 const hidl_vec<hidl_string> kSupportedPermissions = { 34 kBackgroundLocationPerm, kFineLocationPerm, kRecordAudioPerm}; 35 36 //! Converts the CHRE permissions bitmask to a list of CHRE permissions. 37 hidl_vec<hidl_string> chreToAndroidPermissions(uint32_t chrePermissions); 38 39 } // namespace implementation 40 } // namespace common 41 } // namespace contexthub 42 } // namespace hardware 43 } // namespace android 44 45 #endif // ANDROID_HARDWARE_CONTEXTHUB_COMMON_PERMISSIONS_UTIL_H 46