1dfe32fa1Soh_ci/* 2dfe32fa1Soh_ci * Copyright (c) 2023 Huawei Device Co., Ltd. 3dfe32fa1Soh_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4dfe32fa1Soh_ci * you may not use this file except in compliance with the License. 5dfe32fa1Soh_ci * You may obtain a copy of the License at 6dfe32fa1Soh_ci * 7dfe32fa1Soh_ci * http://www.apache.org/licenses/LICENSE-2.0 8dfe32fa1Soh_ci * 9dfe32fa1Soh_ci * Unless required by applicable law or agreed to in writing, software 10dfe32fa1Soh_ci * distributed under the License is distributed on an "AS IS" BASIS, 11dfe32fa1Soh_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12dfe32fa1Soh_ci * See the License for the specific language governing permissions and 13dfe32fa1Soh_ci * limitations under the License. 14dfe32fa1Soh_ci */ 15dfe32fa1Soh_ci 16dfe32fa1Soh_ci#ifndef BMS_WRAPPER 17dfe32fa1Soh_ci#define BMS_WRAPPER 18dfe32fa1Soh_ci 19dfe32fa1Soh_ci#include <stdint.h> 20dfe32fa1Soh_ci 21dfe32fa1Soh_ci#ifdef __cplusplus 22dfe32fa1Soh_ciextern "C" { 23dfe32fa1Soh_ci#endif 24dfe32fa1Soh_ci 25dfe32fa1Soh_cienum OwnerType { 26dfe32fa1Soh_ci HAP = 0, 27dfe32fa1Soh_ci NATIVE = 1, 28dfe32fa1Soh_ci}; 29dfe32fa1Soh_ci 30dfe32fa1Soh_citypedef struct { 31dfe32fa1Soh_ci uint8_t *appId; 32dfe32fa1Soh_ci uint32_t appIdLen; 33dfe32fa1Soh_ci int32_t appIndex; 34dfe32fa1Soh_ci} HapInfo; 35dfe32fa1Soh_ci 36dfe32fa1Soh_citypedef struct { 37dfe32fa1Soh_ci uint32_t uid; 38dfe32fa1Soh_ci} NativeInfo; 39dfe32fa1Soh_ci 40dfe32fa1Soh_citypedef struct { 41dfe32fa1Soh_ci uint32_t userId; 42dfe32fa1Soh_ci OwnerType ownerType; 43dfe32fa1Soh_ci 44dfe32fa1Soh_ci // Bundle name for hap or process name for native. 45dfe32fa1Soh_ci uint8_t *processName; 46dfe32fa1Soh_ci uint32_t processNameLen; 47dfe32fa1Soh_ci 48dfe32fa1Soh_ci HapInfo hapInfo; 49dfe32fa1Soh_ci NativeInfo nativeInfo; 50dfe32fa1Soh_ci} ProcessInfo; 51dfe32fa1Soh_ci 52dfe32fa1Soh_ciint32_t GetCallingProcessInfo(uint32_t userId, uint64_t uid, ProcessInfo *processInfo); 53dfe32fa1Soh_ci 54dfe32fa1Soh_ci#ifdef __cplusplus 55dfe32fa1Soh_ci} 56dfe32fa1Soh_ci#endif 57dfe32fa1Soh_ci 58dfe32fa1Soh_ci#endif