• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-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 BMS_ECOLOGICALRULEMANAGERSERVICE_PARAM_H
17 #define BMS_ECOLOGICALRULEMANAGERSERVICE_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 BmsExperienceRule : public Parcelable {
30     bool isAllow = true;
31     std::string sceneCode = "";
32     sptr<Want> replaceWant = nullptr;
33 
34     bool Marshalling(Parcel &parcel) const override;
35 
36     static BmsExperienceRule *Unmarshalling(Parcel &parcel);
37 };
38 
39 struct BmsCallerInfo : public Parcelable {
40     enum:uint8_t {
41         MODEL_STAGE = 0,
42         MODEL_FA
43     };
44 
45     enum:uint8_t {
46         TYPE_INVALID = 0,
47         TYPE_HARMONY_APP = 1,
48         TYPE_ATOM_SERVICE = 2,
49         TYPE_QUICK_APP = 4,
50         TYPE_BOXED_ATOM_SERVICE = 5
51     };
52 
53     int32_t uid = 0;
54     int32_t pid = 0;
55 
56     int32_t callerAppType = TYPE_INVALID;
57     int32_t targetAppType = TYPE_INVALID;
58 
59     int32_t callerModelType = 0L;
60     int32_t targetLinkType = 0L;
61     int32_t callerAbilityType = 0L;
62     int32_t embedded = 0;
63     std::string packageName;
64     std::string targetAppDistType = "";
65     std::string targetLinkFeature = "";
66     std::string callerAppProvisionType;
67     std::string targetAppProvisionType;
68 
69     bool ReadFromParcel(Parcel &parcel);
70 
71     bool Marshalling(Parcel &parcel) const override;
72 
73     static BmsCallerInfo *Unmarshalling(Parcel &parcel);
74 
75     std::string ToString() const;
76 };
77 
78 } // namespace AppExecFwk
79 } // namespace OHOS
80 #endif // BMS_ECOLOGICALRULEMANAGERSERVICE_PARAM_H
81