• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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 #include "rdb_fault_hiview_reporter.h"
16 
17 #include "connection.h"
18 namespace OHOS::NativeRdb {
19 
ReportCorruptedOnce(const RdbCorruptedEvent & eventInfo)20 void RdbFaultHiViewReporter::ReportCorruptedOnce(const RdbCorruptedEvent &eventInfo)
21 {
22     (void)eventInfo;
23 }
24 
ReportRestore(const RdbCorruptedEvent & eventInfo,bool repair)25 void RdbFaultHiViewReporter::ReportRestore(const RdbCorruptedEvent &eventInfo, bool repair)
26 {
27     (void)eventInfo;
28 }
29 
ReportCorrupted(const RdbCorruptedEvent & eventInfo)30 void RdbFaultHiViewReporter::ReportCorrupted(const RdbCorruptedEvent &eventInfo)
31 {
32     (void)eventInfo;
33 }
34 
IsReportCorruptedFault(const std::string & dbPath)35 bool RdbFaultHiViewReporter::IsReportCorruptedFault(const std::string &dbPath)
36 {
37     return false;
38 }
39 
CreateCorruptedFlag(const std::string & dbPath)40 void RdbFaultHiViewReporter::CreateCorruptedFlag(const std::string &dbPath)
41 {
42     (void)dbPath;
43 }
44 
DeleteCorruptedFlag(const std::string & dbPath)45 void RdbFaultHiViewReporter::DeleteCorruptedFlag(const std::string &dbPath)
46 {
47     (void)dbPath;
48 }
49 
ReportRAGFault(const std::string & errMsg,const std::string & functionName,const std::string & bundleName,const int faultType,const int errCode)50 void RdbFaultHiViewReporter::ReportRAGFault(const std::string &errMsg, const std::string &functionName,
51     const std::string &bundleName, const int faultType, const int errCode)
52 {
53     (void)errMsg;
54     (void)functionName;
55     (void)bundleName;
56 }
57 
Create(const RdbStoreConfig & config,int32_t errCode,const std::string & appendix,bool needSyncParaFromSrv)58 RdbCorruptedEvent RdbFaultHiViewReporter::Create(
59     const RdbStoreConfig &config, int32_t errCode, const std::string &appendix, bool needSyncParaFromSrv)
60 {
61     (void)config;
62     (void)errCode;
63     (void)appendix;
64     (void)needSyncParaFromSrv;
65     RdbCorruptedEvent eventInfo;
66     return eventInfo;
67 }
68 
RegCollector(Collector collector)69 bool RdbFaultHiViewReporter::RegCollector(Collector collector)
70 {
71     (void)collector;
72     return true;
73 }
Update(std::map<std::string,DebugInfo> & localInfos,const std::map<std::string,DebugInfo> & infos)74 void RdbFaultHiViewReporter::Update(std::map<std::string, DebugInfo> &localInfos,
75     const std::map<std::string, DebugInfo> &infos)
76 {
77     (void)localInfos;
78     (void)infos;
79 }
80 
GetBundleName(const std::string & bundleName,const std::string & storeName)81 std::string RdbFaultHiViewReporter::GetBundleName(const std::string &bundleName, const std::string &storeName)
82 {
83     (void)bundleName;
84     (void)storeName;
85     return "";
86 }
87 
ReportFault(const RdbFaultEvent & faultEvent)88 void RdbFaultHiViewReporter::ReportFault(const RdbFaultEvent &faultEvent)
89 {
90     (void)faultEvent;
91 }
92 
RdbFaultEvent(const std::string & faultType,int32_t errorCode,const std::string & bundleName,const std::string & custLog)93 RdbFaultEvent::RdbFaultEvent(const std::string &faultType, int32_t errorCode,
94     const std::string &bundleName, const std::string &custLog)
95 {
96     (void)faultType;
97     (void)errorCode;
98     (void)bundleName;
99     (void)custLog;
100 }
101 
Report() const102 void RdbFaultEvent::Report() const
103 {
104 }
105 
RdbFaultDbFileEvent(const std::string & faultType,int32_t errorCode,const RdbStoreConfig & config,const std::string & custLog,bool printDbInfo)106 RdbFaultDbFileEvent::RdbFaultDbFileEvent(const std::string &faultType, int32_t errorCode, const RdbStoreConfig &config,
107     const std::string &custLog, bool printDbInfo) : RdbFaultEvent(faultType, errorCode, "", custLog), config_(config)
108 {
109     (void)printDbInfo;
110 }
111 
Report() const112 void RdbFaultDbFileEvent::Report() const
113 {
114 }
115 } // namespace OHOS::NativeRdb