1 /*
2  * Copyright (c) 2023 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 FORM_ECOLOGICAL_RULE_PARAM_H
17 #define FORM_ECOLOGICAL_RULE_PARAM_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "parcel.h"
23 #include "want.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 using Want = OHOS::AAFwk::Want;
28 
29 struct FormErmsCallerInfo : public Parcelable {
30     enum {
31         TYPE_INVALID = 0,
32         TYPE_HARMONY_APP,
33         TYPE_ATOM_SERVICE,
34         TYPE_QUICK_APP = 4,
35         TYPE_BOXED_ATOM_SERVICE
36     };
37 
38     std::string packageName;
39     int32_t uid = 0L;
40     int32_t pid = 0L;
41 
42     int32_t callerAppType = TYPE_INVALID;
43     int32_t targetAppType = TYPE_INVALID;
44 
45     bool ReadFromParcel(Parcel &parcel);
46 
47     bool Marshalling(Parcel &parcel) const override;
48 
49     static FormErmsCallerInfo *Unmarshalling(Parcel &parcel);
50 
51     std::string ToString() const;
52 };
53 
54 } // namespace AppExecFwk
55 } // namespace OHOS
56 #endif // FORM_ECOLOGICAL_RULE_PARAM_H
57