1 /* 2 * Copyright (c) 2022 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 #ifndef WALLPAPER_SERVICES_WALLPAPER_COMMON_H 16 #define WALLPAPER_SERVICES_WALLPAPER_COMMON_H 17 18 #include <string> 19 20 #include "errors.h" 21 22 namespace OHOS { 23 namespace WallpaperMgrService { 24 #define WALLPAPER_SERVICE_NAME "WallpaperMgrService" 25 static const std::string WALLPAPER_BUNDLE_NAME = "ohos"; 26 static const std::string WALLPAPER_PERMISSION_NAME_GET_WALLPAPER = "ohos.permission.GET_WALLPAPER"; 27 static const std::string WALLPAPER_PERMISSION_NAME_SET_WALLPAPER = "ohos.permission.SET_WALLPAPER"; 28 static const std::string WALLPAPER_PERMISSION_NAME_CAPTURE_SCREEN = "ohos.permission.CAPTURE_SCREEN"; 29 30 static const std::string TEST_LABEL = "test label"; 31 static const std::string TEST_DESCRIPTION = "test description"; 32 33 static const int TEST_LABEL_ID = 9527; 34 static const int TEST_DESCRIPTION_ID = 9528; 35 static const int TEST_INVALID_USER_ID = -1; 36 static const int TEST_USER_ID = 0; 37 static const int TEST_SUB_USER_ID = 10; 38 39 struct ApiInfo { 40 bool needException; 41 bool isSystemApi; 42 }; 43 44 enum WallpaperModule { 45 WALLPAPER_MODULE_SERVICE_ID = 0x07, 46 }; 47 // time error offset, used only in this file. 48 constexpr ErrCode WALLPAPER_ERR_OFFSET = ErrCodeOffset(SUBSYS_SMALLSERVICES, WALLPAPER_MODULE_SERVICE_ID); 49 50 enum ErrorCode : int32_t { 51 E_OK = WALLPAPER_ERR_OFFSET, 52 E_SA_DIED, 53 E_READ_PARCEL_ERROR, 54 E_WRITE_PARCEL_ERROR, 55 E_PUBLISH_FAIL, 56 E_TRANSACT_ERROR, 57 E_DEAL_FAILED, 58 E_PARAMETERS_INVALID, 59 E_SET_RTC_FAILED, 60 E_NOT_FOUND, 61 E_NO_PERMISSION, 62 E_FILE_ERROR, 63 E_IMAGE_ERRCODE, 64 E_NO_MEMORY, 65 E_NOT_SYSTEM_APP, 66 }; 67 } // namespace WallpaperMgrService 68 } // namespace OHOS 69 70 #endif // WALLPAPER_SERVICES_WALLPAPER_COMMON_H