1 /* 2 * Copyright (c) 2025 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 DATASHARESERVICE_HIVIEW_ADAPTER_H 17 #define DATASHARESERVICE_HIVIEW_ADAPTER_H 18 19 #include "executor_pool.h" 20 #include "hisysevent_c.h" 21 22 namespace OHOS { 23 namespace DataShare { 24 25 struct DataShareFaultInfo { 26 std::string faultType; 27 std::string bundleName; 28 std::string moduleName; 29 std::string storeName; 30 std::string businessType; 31 int32_t errorCode; 32 std::string appendix; 33 }; 34 35 class HiViewFaultAdapter { 36 public: 37 static constexpr const char* extensionFailed = "EXT_FAILED"; 38 static constexpr const char* silentFailed = "SILENT_FAILED"; 39 static constexpr const char* trustsFailed = "TRUSTS_FAILED"; 40 static void ReportDataFault(const DataShareFaultInfo &faultInfo); 41 static std::pair<std::string, int> GetCallingName(uint32_t callingTokenid); 42 }; 43 44 } // namespace DataShare 45 } // namespace OHOS 46 #endif // DATASHARESERVICE_HIVIEW_ADAPTER_H 47