1 /* 2 * Copyright (c) 2021 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 * miscservices under the License is miscservices 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 MISCSERVICES_DFX_TYPES_H 17 #define MISCSERVICES_DFX_TYPES_H 18 19 #include <string> 20 21 namespace OHOS { 22 namespace MiscServices { 23 enum class FaultCode { 24 // Service Fault 25 SF_SERVICE_UNAVAILABLE = 0, 26 SF_SERVICE_SUBSCRIBECOMMINEVENT, 27 SF_STARTABILITY_FAILED, 28 29 // Runtime Fault 30 RF_DROP_FAILED = 10, 31 RF_FD_INPUT_FAILED, 32 }; 33 34 enum class FaultType { 35 SERVICE_FAULT = 0, 36 SET_WALLPAPER_FAULT, 37 LOAD_WALLPAPER_FAULT, 38 }; 39 40 struct FaultMsg { 41 FaultType faultType; 42 std::string moduleName; 43 FaultCode errorCode; 44 }; 45 46 struct UsageTimeStat { 47 std::string packagesName; 48 time_t startTime; 49 std::string cumulativeTime; 50 }; 51 52 enum class ReportStatus { 53 SUCCESS = 0, 54 ERROR = 1, 55 }; 56 57 enum class TraceTaskId : int32_t { 58 SET_WALLPAPER = 0, 59 ONSTART_EXTENSION, 60 ONSTART_MIDDLE_EXTENSION, 61 ONCREATE_EXTENSION, 62 ONCONNECT_EXTENSION, 63 ONCONNECT_MIDDLE_EXTENSION, 64 SET_VIDEO, 65 SET_CUSTOM_WALLPAPER, 66 SET_ALL_WALLPAPERS, 67 GET_CORRESPOND_WALLPAPER, 68 }; 69 } // namespace MiscServices 70 } // namespace OHOS 71 #endif // MISCSERVICES_DFX_TYPES_H 72