• 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 #ifndef OHOS_ABILITY_RUNTIME_PROCESS_BIND_DATA_H
17 #define OHOS_ABILITY_RUNTIME_PROCESS_BIND_DATA_H
18 
19 #include <sys/types.h>
20 
21 #include "iremote_object.h"
22 #include "parcel.h"
23 #include "running_process_info.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 struct UIExtensionProcessBindInfo {
28     std::string bundleName;
29     int32_t pid = 0;
30     int32_t uid = 0;
31     bool isKeepAlive = false;
32     ProcessType processType = ProcessType::EXTENSION;
33     ExtensionAbilityType extensionType = ExtensionAbilityType::UNSPECIFIED;
34     int32_t callerPid = -1;
35     int32_t callerUid = -1;
36     std::string callerBundleName;
37     int32_t notifyProcessBind = -1;
38 };
39 struct ProcessBindData : public Parcelable {
40     /**
41      * @brief read this Sequenceable object from a Parcel.
42      *
43      * @param inParcel Indicates the Parcel object into which the Sequenceable
44      * object has been marshaled.
45      * @return Returns true if read successed; returns false otherwise.
46      */
47     bool ReadFromParcel(Parcel &parcel);
48 
49     /**
50      * @brief Marshals this Sequenceable object into a Parcel.
51      *
52      * @param outParcel Indicates the Parcel object to which the Sequenceable
53      * object will be marshaled.
54      */
55     virtual bool Marshalling(Parcel &parcel) const override;
56 
57     /**
58      * @brief Unmarshals this Sequenceable object from a Parcel.
59      *
60      * @param inParcel Indicates the Parcel object into which the Sequenceable
61      * object has been marshaled.
62      */
63     static ProcessBindData *Unmarshalling(Parcel &parcel);
64 
65     std::string bundleName;
66     int32_t pid = 0;
67     int32_t uid = 0;
68     bool isKeepAlive = false;
69     ProcessType processType = ProcessType::EXTENSION;
70     ExtensionAbilityType extensionType = ExtensionAbilityType::UNSPECIFIED;
71     int32_t callerPid = -1;
72     int32_t callerUid = -1;
73     std::string callerBundleName;
74     // 0:unBind 1:Bind
75     int32_t bindingRelation;
76 };
77 } // namespace AppExecFwk
78 } // namespace OHOS
79 #endif // OHOS_ABILITY_RUNTIME_PROCESS_BIND_DATA_H
80