• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include "imc_hisysevent_reporter.h"
17 
18 namespace OHOS {
19 namespace MiscServices {
GetInstance()20 ImcHiSysEventReporter &ImcHiSysEventReporter::GetInstance()
21 {
22     static ImcHiSysEventReporter instance;
23     return instance;
24 }
25 
ImcHiSysEventReporter()26 ImcHiSysEventReporter::ImcHiSysEventReporter()
27 {
28 }
29 
~ImcHiSysEventReporter()30 ImcHiSysEventReporter::~ImcHiSysEventReporter()
31 {
32 }
33 
IsValidErrCode(int32_t errCode)34 bool ImcHiSysEventReporter::IsValidErrCode(int32_t errCode)
35 {
36     return !((ErrorCode::ERROR_IMA_BEGIN < errCode && errCode < ErrorCode::ERROR_IMA_END)
37              || (ErrorCode::ERROR_IMSA_BEGIN < errCode && errCode < ErrorCode::ERROR_IMSA_END));
38 }
39 
IsFault(int32_t errCode)40 bool ImcHiSysEventReporter::IsFault(int32_t errCode)
41 {
42     return errCode != ErrorCode::ERROR_TEXT_PREVIEW_NOT_SUPPORTED;
43 }
44 } // namespace MiscServices
45 } // namespace OHOS