• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 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 FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_IPC_INSTALLD_HOST_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_IPC_INSTALLD_HOST_H
18 
19 #include <string>
20 
21 #include "iremote_stub.h"
22 
23 #include "ipc/installd_interface.h"
24 
25 namespace OHOS {
26 namespace AppExecFwk {
27 
28 class InstalldHost : public IRemoteStub<IInstalld> {
29 public:
30     InstalldHost();
31     virtual ~InstalldHost() override;
32 
33     virtual int OnRemoteRequest(
34         uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
35 
36 private:
37     /**
38      * @brief Handles the CreateBundleDir function called from a IInstalld proxy object.
39      * @param data Indicates the data to be read.
40      * @param reply Indicates the reply to be sent;
41      * @return Returns true if called successfully; returns false otherwise.
42      */
43     bool HandleCreateBundleDir(MessageParcel &data, MessageParcel &reply);
44     /**
45      * @brief Handles the RemoveBundleDir function called from a IInstalld proxy object.
46      * @param data Indicates the data to be read.
47      * @param reply Indicates the reply to be sent;
48      * @return Returns true if called successfully; returns false otherwise.
49      */
50     bool HandleRemoveBundleDir(MessageParcel &data, MessageParcel &reply);
51     /**
52      * @brief Handles the ExtractModuleFiles function called from a IInstalld proxy object.
53      * @param data Indicates the data to be read.
54      * @param reply Indicates the reply to be sent;
55      * @return Returns true if called successfully; returns false otherwise.
56      */
57     bool HandleExtractModuleFiles(MessageParcel &data, MessageParcel &reply);
58     /**
59      * @brief Handles the RenameModuleDir function called from a IInstalld proxy object.
60      * @param data Indicates the data to be read.
61      * @param reply Indicates the reply to be sent;
62      * @return Returns true if called successfully; returns false otherwise.
63      */
64     bool HandleRenameModuleDir(MessageParcel &data, MessageParcel &reply);
65     /**
66      * @brief Handles the RemoveModuleDir function called from a IInstalld proxy object.
67      * @param data Indicates the data to be read.
68      * @param reply Indicates the reply to be sent;
69      * @return Returns true if called successfully; returns false otherwise.
70      */
71     bool HandleRemoveModuleDir(MessageParcel &data, MessageParcel &reply);
72     /**
73      * @brief Handles the CreateBundleDataDir function called from a IInstalld proxy object.
74      * @param data Indicates the data to be read.
75      * @param reply Indicates the reply to be sent;
76      * @return Returns true if called successfully; returns false otherwise.
77      */
78     bool HandleCreateBundleDataDir(MessageParcel &data, MessageParcel &reply);
79     /**
80      * @brief Handles the RemoveBundleDataDir function called from a IInstalld proxy object.
81      * @param data Indicates the data to be read.
82      * @param reply Indicates the reply to be sent;
83      * @return Returns true if called successfully; returns false otherwise.
84      */
85     bool HandleRemoveBundleDataDir(MessageParcel &data, MessageParcel &reply);
86     /**
87      * @brief Handles the CreateModuleDataDir function called from a IInstalld proxy object.
88      * @param data Indicates the data to be read.
89      * @param reply Indicates the reply to be sent;
90      * @return Returns true if called successfully; returns false otherwise.
91      */
92     bool HandleCreateModuleDataDir(MessageParcel &data, MessageParcel &reply);
93     /**
94      * @brief Handles the RemoveModuleDataDir function called from a IInstalld proxy object.
95      * @param data Indicates the data to be read.
96      * @param reply Indicates the reply to be sent;
97      * @return Returns true if called successfully; returns false otherwise.
98      */
99     bool HandleRemoveModuleDataDir(MessageParcel &data, MessageParcel &reply);
100     /**
101      * @brief Handles the CleanBundleDataDir function called from a IInstalld proxy object.
102      * @param data Indicates the data to be read.
103      * @param reply Indicates the reply to be sent;
104      * @return Returns true if called successfully; returns false otherwise.
105      */
106     bool HandleCleanBundleDataDir(MessageParcel &data, MessageParcel &reply);
107 };
108 
109 }  // namespace AppExecFwk
110 }  // namespace OHOS
111 #endif  // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_IPC_INSTALLD_HOST_H