• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 ECOLOGICALRULEMANAGERSERVICE_PARAM_H
17 #define ECOLOGICALRULEMANAGERSERVICE_PARAM_H
18 
19 #include <string>
20 #include <vector>
21 #include "ability_info.h"
22 #include "parcel.h"
23 #include "want.h"
24 
25 namespace OHOS {
26 namespace EcologicalRuleMgrService {
27 using Want = OHOS::AAFwk::Want;
28 
29 struct ExperienceRule : public Parcelable {
30     bool isAllow = true;
31     sptr<Want> replaceWant = nullptr;
32     bool Marshalling(Parcel &parcel) const override;
33     static ExperienceRule *Unmarshalling(Parcel &parcel);
34 };
35 
36 struct CallerInfo : public Parcelable {
37     enum {
38         TYPE_INVALID = 0,
39         TYPE_HARMONY_APP,
40         TYPE_ATOM_SERVICE
41     };
42     enum {
43         LINK_TYPE_INVALID = 0,
44         LINK_TYPE_UNIVERSAL_LINK,
45         LINK_TYPE_DEEP_LINK,
46         LINK_TYPE_WEB_LINK,
47         LINK_TYPE_ABILITY
48     };
49     std::string packageName;
50     int32_t uid = 0L;
51     int32_t pid = 0L;
52     int32_t callerAppType = TYPE_INVALID;
53     int32_t targetAppType = TYPE_INVALID;
54     int32_t callerModeType = 0L;
55     std::string targetAppDistType = "";
56     std::string targetLinkFeature = "";
57     int32_t targetLinkType = LINK_TYPE_INVALID;
58     AppExecFwk::AbilityType callerAbilityType = AppExecFwk::AbilityType::UNKNOWN;
59     int32_t embedded = 0L;
60     std::string callerAppProvisionType;
61     std::string targetAppProvisionType;
62     AppExecFwk::ExtensionAbilityType callerExtensionAbilityType = AppExecFwk::ExtensionAbilityType::UNSPECIFIED;
63     bool ReadFromParcel(Parcel &parcel);
64     bool Marshalling(Parcel &parcel) const override;
65     static CallerInfo *Unmarshalling(Parcel &parcel);
66     std::string ToString() const;
67 };
68 } // namespace EcologicalRuleMgrService
69 } // namespace OHOS
70 #endif // ECOLOGICALRULEMANAGERSERVICE_PARAM_H
71