1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef OHOS_CLOUD_OAID_COMMON_H 17 #define OHOS_CLOUD_OAID_COMMON_H 18 19 #include <map> 20 #include "oaid_hilog_wreapper.h" 21 #include "errors.h" 22 23 namespace OHOS { 24 namespace Cloud { 25 #if defined(__GNUC__) && (__GNUC__ >= 4) 26 #define OAID_PUBLIC_API __attribute__((visibility ("default"))) 27 #define OAID_LOCAL_API __attribute__((visibility ("hidden"))) 28 #else 29 #define OAID_PUBLIC_API 30 #define OAID_LOCAL_API 31 #endif 32 33 enum OAIDError : int32_t { 34 ERR_OK = 0, 35 ERR_INVALID_PARAM = 401, 36 ERR_PERMISSION_ERROR = 403, 37 ERR_SYSYTEM_ERROR = 17300001, 38 ERR_NULL_POINTER = 17300002, 39 ERR_WRITE_PARCEL_FAILED = 17300003, 40 }; 41 42 static std::map<int32_t, std::string> oaidErrCodeMsgMap = { 43 {ERR_INVALID_PARAM, "Invalid input parameter."}, 44 {ERR_SYSYTEM_ERROR, "System internal error."} 45 }; 46 } // namespace Cloud 47 } // namespace OHOS 48 #endif // OHOS_CLOUD_OAID_COMMON_H