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 CHRE_UTIL_SYSTEM_NAPP_PERMISSONS 18 #define CHRE_UTIL_SYSTEM_NAPP_PERMISSONS 19 20 #include <stdint.h> 21 22 namespace chre { 23 24 /** 25 * Enum declaring the various CHRE permissions that can be declared. Nanoapps 26 * built against CHRE API v1.5+ must contain the respective permission for the 27 * set of APIs they attempt to call. For example, CHRE_NANOAPP_USES_WIFI must 28 * be declared by the nanoapp in order for it to make use of any WiFi APIs. 29 * 30 * The 8 most-significant bits (MSBs) are reserved for vendor use and must be 31 * used if a vendor API allows access to privacy sensitive information that is 32 * guarded by a permission on the Android side (e.g. location). 33 */ 34 enum NanoappPermissions : uint32_t { 35 CHRE_PERMS_NONE = 0, 36 CHRE_PERMS_AUDIO = 1, 37 CHRE_PERMS_GNSS = 1 << 1, 38 CHRE_PERMS_WIFI = 1 << 2, 39 CHRE_PERMS_WWAN = 1 << 3, 40 CHRE_PERMS_BLE = 1 << 4, 41 CHRE_PERMS_ALL = 0xffffffff, 42 }; 43 44 } // namespace chre 45 46 #endif // CHRE_UTIL_SYSTEM_NAPP_PERMISSONS 47