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 
16 #ifndef HIVIEWDFX_HICOLLIE_FAULT_DATA_H
17 #define HIVIEWDFX_HICOLLIE_FAULT_DATA_H
18 
19 #include <string>
20 #include "parcel.h"
21 #include "iremote_object.h"
22 
23 namespace OHOS {
24 namespace HiviewDFX {
25 struct ErrorObject {
26     std::string name = "";
27     std::string message = "";
28     std::string stack = "";
29 };
30 
31 enum class FaultDataType {
32     UNKNOWN = -1,
33     APP_FREEZE = 3
34 };
35 
36 /**
37  * @struct ReportData
38  * ReportData is used to save information about report data.
39  */
40 struct ReportData : public Parcelable {
41     virtual bool Marshalling(Parcel &parcel) const override;
42     bool WriteContent(Parcel &parcel) const;
43     // error object
44     ErrorObject errorObject;
45     FaultDataType faultType = FaultDataType::UNKNOWN;
46     std::string timeoutMarkers = "";
47     bool waitSaveState = false;
48     bool notifyApp = false;
49     bool forceExit = false;
50     uint32_t state = 0;
51     int32_t eventId = -1;
52     int32_t tid = 0;
53     sptr<IRemoteObject> token = nullptr;
54 };
55 } // end of HiviewDFX
56 } // end of OHOS
57 #endif  // HIVIEWDFX_HICOLLIE_FAULT_DATA_H
58