• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_HOST_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_HOST_H
18 
19 #include <mutex>
20 
21 #include "iremote_stub.h"
22 #include "nocopyable.h"
23 
24 #include "appexecfwk_errors.h"
25 #include "bundle_mgr_interface.h"
26 #include "bundle_mgr_proxy.h"
27 
28 namespace OHOS {
29 namespace AppExecFwk {
30 class BundleMgrHost : public IRemoteStub<IBundleMgr> {
31 public:
32     BundleMgrHost();
33     virtual ~BundleMgrHost() = default;
34 
35     int OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option) override;
36 
37 private:
38     /**
39      * @brief Handles the GetApplicationInfo function called from a IBundleMgr proxy object.
40      * @param data Indicates the data to be read.
41      * @param reply Indicates the reply to be sent;
42      * @return Returns ERR_OK if called successfully; returns error code otherwise.
43      */
44     ErrCode HandleGetApplicationInfo(MessageParcel &data, MessageParcel &reply);
45     /**
46      * @brief Handles the GetApplicationInfo function called from a IBundleMgr proxy object.
47      * @param data Indicates the data to be read.
48      * @param reply Indicates the reply to be sent;
49      * @return Returns ERR_OK if called successfully; returns error code otherwise.
50      */
51     ErrCode HandleGetApplicationInfoWithIntFlags(MessageParcel &data, MessageParcel &reply);
52     /**
53      * @brief Handles the GetApplicationInfoV9 function called from a IBundleMgr proxy object.
54      * @param data Indicates the data to be read.
55      * @param reply Indicates the reply to be sent;
56      * @return Returns ERR_OK if called successfully; returns error code otherwise.
57      */
58     ErrCode HandleGetApplicationInfoWithIntFlagsV9(MessageParcel &data, MessageParcel &reply);
59     /**
60      * @brief Handles the GetApplicationInfos function called from a IBundleMgr proxy object.
61      * @param data Indicates the data to be read.
62      * @param reply Indicates the reply to be sent;
63      * @return Returns ERR_OK if called successfully; returns error code otherwise.
64      */
65     ErrCode HandleGetApplicationInfos(MessageParcel &data, MessageParcel &reply);
66     /**
67      * @brief Handles the GetApplicationInfos function called from a IBundleMgr proxy object.
68      * @param data Indicates the data to be read.
69      * @param reply Indicates the reply to be sent;
70      * @return Returns ERR_OK if called successfully; returns error code otherwise.
71      */
72     ErrCode HandleGetApplicationInfosWithIntFlags(MessageParcel &data, MessageParcel &reply);
73     /**
74      * @brief Handles the GetApplicationsInfoV9 function called from a IBundleMgr proxy object.
75      * @param data Indicates the data to be read.
76      * @param reply Indicates the reply to be sent;
77      * @return Returns ERR_OK if called successfully; returns error code otherwise.
78      */
79     ErrCode HandleGetApplicationInfosWithIntFlagsV9(MessageParcel &data, MessageParcel &reply);
80     /**
81      * @brief Handles the GetBundleInfo function called from a IBundleMgr proxy object.
82      * @param data Indicates the data to be read.
83      * @param reply Indicates the reply to be sent;
84      * @return Returns ERR_OK if called successfully; returns error code otherwise.
85      */
86     ErrCode HandleGetBundleInfo(MessageParcel &data, MessageParcel &reply);
87     /**
88      * @brief Handles the GetBundleInfo function called from a IBundleMgr proxy object.
89      * @param data Indicates the data to be read.
90      * @param reply Indicates the reply to be sent;
91      * @return Returns ERR_OK if called successfully; returns error code otherwise.
92      */
93     ErrCode HandleGetBundleInfoForSelf(MessageParcel &data, MessageParcel &reply);
94     /**
95      * @brief Handles the GetDependentBundleInfo function called from a IBundleMgr proxy object.
96      * @param data Indicates the data to be read.
97      * @param reply Indicates the reply to be sent;
98      * @return Returns ERR_OK if called successfully; returns error code otherwise.
99      */
100     virtual ErrCode HandleGetDependentBundleInfo(MessageParcel &data, MessageParcel &reply);
101     /**
102      * @brief Handles the GetBundlePackInfo function called from a IBundleMgr proxy object.
103      * @param data Indicates the data to be read.
104      * @param reply Indicates the reply to be sent;
105      * @return Returns ERR_OK if called successfully; returns error code otherwise.
106      */
107     ErrCode HandleGetBundlePackInfo(MessageParcel &data, MessageParcel &reply);
108     /**
109      * @brief Handles the GetBundlePackInfo function called from a IBundleMgr proxy object.
110      * @param data Indicates the data to be read.
111      * @param reply Indicates the reply to be sent;
112      * @return Returns ERR_OK if called successfully; returns error code otherwise.
113      */
114     ErrCode HandleGetBundlePackInfoWithIntFlags(MessageParcel &data, MessageParcel &reply);
115     /**
116      * @brief Handles the GetBundleInfo function called from a IBundleMgr proxy object.
117      * @param data Indicates the data to be read.
118      * @param reply Indicates the reply to be sent;
119      * @return Returns ERR_OK if called successfully; returns error code otherwise.
120      */
121     ErrCode HandleGetBundleInfoWithIntFlags(MessageParcel &data, MessageParcel &reply);
122     /**
123      * @brief Handles the GetBundleInfo function called from a IBundleMgr proxy object.
124      * @param data Indicates the data to be read.
125      * @param reply Indicates the reply to be sent;
126      * @return Returns ERR_OK if called successfully; returns error code otherwise.
127      */
128     ErrCode HandleGetBundleInfoWithIntFlagsV9(MessageParcel &data, MessageParcel &reply);
129     /**
130      * @brief Handles the BatchGetBundleInfo function called from a IBundleMgr proxy object.
131      * @param data Indicates the data to be read.
132      * @param reply Indicates the reply to be sent;
133      * @return Returns ERR_OK if called successfully; returns error code otherwise.
134      */
135     ErrCode HandleBatchGetBundleInfo(MessageParcel &data, MessageParcel &reply);
136     /**
137      * @brief Handles the GetBundleInfos function called from a IBundleMgr proxy object.
138      * @param data Indicates the data to be read.
139      * @param reply Indicates the reply to be sent;
140      * @return Returns ERR_OK if called successfully; returns error code otherwise.
141      */
142     ErrCode HandleGetBundleInfos(MessageParcel &data, MessageParcel &reply);
143     /**
144      * @brief Handles the GetBundleInfos function called from a IBundleMgr proxy object.
145      * @param data Indicates the data to be read.
146      * @param reply Indicates the reply to be sent;
147      * @return Returns ERR_OK if called successfully; returns error code otherwise.
148      */
149     ErrCode HandleGetBundleInfosWithIntFlags(MessageParcel &data, MessageParcel &reply);
150     /**
151      * @brief Handles the GetBundleInfo function called from a IBundleMgr proxy object.
152      * @param data Indicates the data to be read.
153      * @param reply Indicates the reply to be sent;
154      * @return Returns ERR_OK if called successfully; returns error code otherwise.
155      */
156     ErrCode HandleGetBundleInfosWithIntFlagsV9(MessageParcel &data, MessageParcel &reply);
157     /**
158      * @brief Handles the GetBundleNameForUid function called from a IBundleMgr proxy object.
159      * @param data Indicates the data to be read.
160      * @param reply Indicates the reply to be sent;
161      * @return Returns ERR_OK if called successfully; returns error code otherwise.
162      */
163     ErrCode HandleGetBundleNameForUid(MessageParcel &data, MessageParcel &reply);
164     /**
165      * @brief Handles the GetBundlesForUid function called from a IBundleMgr proxy object.
166      * @param data Indicates the data to be read.
167      * @param reply Indicates the reply to be sent;
168      * @return Returns ERR_OK if called successfully; returns error code otherwise.
169      */
170     ErrCode HandleGetBundlesForUid(MessageParcel &data, MessageParcel &reply);
171     /**
172      * @brief Handles the GetNameForUid function called from a IBundleMgr proxy object.
173      * @param data Indicates the data to be read.
174      * @param reply Indicates the reply to be sent;
175      * @return Returns ERR_OK if called successfully; returns error code otherwise.
176      */
177     ErrCode HandleGetNameForUid(MessageParcel &data, MessageParcel &reply);
178     /**
179      * @brief Handles the GetNameAndIndexForUid function called from a IBundleMgr proxy object.
180      * @param data Indicates the data to be read.
181      * @param reply Indicates the reply to be sent;
182      * @return Returns ERR_OK if called successfully; returns error code otherwise.
183      */
184     ErrCode HandleGetNameAndIndexForUid(MessageParcel &data, MessageParcel &reply);
185     /**
186      * @brief Handles the GetSimpleAppInfoForUid function called from a IBundleMgr proxy object.
187      * @param data Indicates the data to be read.
188      * @param reply Indicates the reply to be sent;
189      * @return Returns ERR_OK if called successfully; returns error code otherwise.
190      */
191     ErrCode HandleGetSimpleAppInfoForUid(MessageParcel &data, MessageParcel &reply);
192     /**
193      * @brief Handles the GetBundleGids function called from a IBundleMgr proxy object.
194      * @param data Indicates the data to be read.
195      * @param reply Indicates the reply to be sent;
196      * @return Returns ERR_OK if called successfully; returns error code otherwise.
197      */
198     ErrCode HandleGetBundleGids(MessageParcel &data, MessageParcel &reply);
199     /**
200      * @brief Handles the GetBundleGidsByUid function called from a IBundleMgr proxy object.
201      * @param data Indicates the data to be read.
202      * @param reply Indicates the reply to be sent;
203      * @return Returns ERR_OK if called successfully; returns error code otherwise.
204      */
205     ErrCode HandleGetBundleGidsByUid(MessageParcel &data, MessageParcel &reply);
206     /**
207      * @brief Handles the GetBundleInfosByMetaData function called from a IBundleMgr proxy object.
208      * @param data Indicates the data to be read.
209      * @param reply Indicates the reply to be sent;
210      * @return Returns ERR_OK if called successfully; returns error code otherwise.
211      */
212     ErrCode HandleGetBundleInfosByMetaData(MessageParcel &data, MessageParcel &reply);
213     /**
214      * @brief Handles the QueryAbilityInfo function called from a IBundleMgr proxy object.
215      * @param data Indicates the data to be read.
216      * @param reply Indicates the reply to be sent;
217      * @return Returns ERR_OK if called successfully; returns error code otherwise.
218      */
219     ErrCode HandleQueryAbilityInfo(MessageParcel &data, MessageParcel &reply);
220 
221      /**
222      * @brief Handles the QueryAbilityInfo function called from a IBundleMgr proxy object with callback.
223      * @param data Indicates the data to be read.
224      * @param reply Indicates the reply to be sent;
225      * @return Returns ERR_OK if called successfully; returns error code otherwise.
226      */
227     ErrCode HandleQueryAbilityInfoWithCallback(MessageParcel &data, MessageParcel &reply);
228 
229      /**
230      * @brief Handles the SilentInstall function called from a IBundleMgr proxy.
231      * @param data Indicates the data to be read.
232      * @param reply Indicates the reply to be sent;
233      * @return Returns ERR_OK if called successfully; returns error code otherwise.
234      */
235     ErrCode HandleSilentInstall(MessageParcel &data, MessageParcel &reply);
236 
237     /**
238      * @brief Handles the UpgradeAtomicService function called from a IBundleMgr proxy object.
239      * @param data Indicates the data to be read.
240      * @param reply Indicates the reply to be sent;
241      * @return Returns ERR_OK if called successfully; returns error code otherwise.
242      */
243     ErrCode HandleUpgradeAtomicService(MessageParcel &data, MessageParcel &reply);
244 
245     /**
246      * @brief Handles the QueryAbilityInfo function called from a IBundleMgr proxy object.
247      * @param data Indicates the data to be read.
248      * @param reply Indicates the reply to be sent;
249      * @return Returns ERR_OK if called successfully; returns error code otherwise.
250      */
251     ErrCode HandleQueryAbilityInfoMutiparam(MessageParcel &data, MessageParcel &reply);
252     /**
253      * @brief Handles the QueryAbilityInfos function called from a IBundleMgr proxy object.
254      * @param data Indicates the data to be read.
255      * @param reply Indicates the reply to be sent;
256      * @return Returns ERR_OK if called successfully; returns error code otherwise.
257      */
258     ErrCode HandleQueryAbilityInfos(MessageParcel &data, MessageParcel &reply);
259     /**
260      * @brief Handles the QueryAbilityInfoByUri function called from a IBundleMgr proxy object.
261      * @param data Indicates the data to be read.
262      * @param reply Indicates the reply to be sent;
263      * @return Returns ERR_OK if called successfully; returns error code otherwise.
264      */
265     ErrCode HandleQueryAbilityInfoByUri(MessageParcel &data, MessageParcel &reply);
266     /**
267      * @brief Handles the QueryAbilityInfoByUri function called from a IBundleMgr proxy object.
268      * @param data Indicates the data to be read.
269      * @param reply Indicates the reply to be sent;
270      * @return Returns ERR_OK if called successfully; returns error code otherwise.
271      */
272     ErrCode HandleQueryAbilityInfosByUri(MessageParcel &data, MessageParcel &reply);
273     /**
274      * @brief Handles the QueryAbilityInfosMutiparam function called from a IBundleMgr proxy object.
275      * @param data Indicates the data to be read.
276      * @param reply Indicates the reply to be sent;
277      * @return Returns ERR_OK if called successfully; returns error code otherwise.
278      */
279     ErrCode HandleQueryAbilityInfosMutiparam(MessageParcel &data, MessageParcel &reply);
280     /**
281      * @brief Handles the QueryAbilityInfosV9 function called from a IBundleMgr proxy object.
282      * @param data Indicates the data to be read.
283      * @param reply Indicates the reply to be sent;
284      * @return Returns ERR_OK if called successfully; returns error code otherwise.
285      */
286     ErrCode HandleQueryAbilityInfosV9(MessageParcel &data, MessageParcel &reply);
287     /**
288      * @brief Handles the BatchQueryAbilityInfos function called from a IBundleMgr proxy object.
289      * @param data Indicates the data to be read.
290      * @param reply Indicates the reply to be sent;
291      * @return Returns ERR_OK if called successfully; returns error code otherwise.
292      */
293     ErrCode HandleBatchQueryAbilityInfos(MessageParcel &data, MessageParcel &reply);
294     /**
295      * @brief Handles the HandleQueryLauncherAbilityInfos function called from a IBundleMgr proxy object.
296      * @param data Indicates the data to be read.
297      * @param reply Indicates the reply to be sent;
298      * @return Returns ERR_OK if called successfully; returns error code otherwise.
299      */
300     ErrCode HandleQueryLauncherAbilityInfos(MessageParcel &data, MessageParcel &reply);
301     /**
302      * @brief Handles the HandleQueryAllAbilityInfos function called from a IBundleMgr proxy object.
303      * @param data Indicates the data to be read.
304      * @param reply Indicates the reply to be sent;
305      * @return Returns ERR_OK if called successfully; returns error code otherwise.
306      */
307     ErrCode HandleQueryAllAbilityInfos(MessageParcel &data, MessageParcel &reply);
308     /**
309      * @brief Handles the QueryAbilityInfoByUri function called from a IBundleMgr proxy object.
310      * @param data Indicates the data to be read.
311      * @param reply Indicates the reply to be sent;
312      * @return Returns ERR_OK if called successfully; returns error code otherwise.
313      */
314     ErrCode HandleQueryAbilityInfoByUriForUserId(MessageParcel &data, MessageParcel &reply);
315     /**
316      * @brief Handles the QueryKeepAliveBundleInfos function called from a IBundleMgr proxy object.
317      * @param data Indicates the data to be read.
318      * @param reply Indicates the reply to be sent;
319      * @return Returns ERR_OK if called successfully; returns error code otherwise.
320      */
321     ErrCode HandleQueryKeepAliveBundleInfos(MessageParcel &data, MessageParcel &reply);
322     /**
323      * @brief Handles the GetAbilityLabel function called from a IBundleMgr proxy object.
324      * @param data Indicates the data to be read.
325      * @param reply Indicates the reply to be sent;
326      * @return Returns ERR_OK if called successfully; returns error code otherwise.
327      */
328     ErrCode HandleGetAbilityLabel(MessageParcel &data, MessageParcel &reply);
329     /**
330      * @brief Handles the GetAbilityLabel function called from a IBundleMgr proxy object.
331      * @param data Indicates the data to be read.
332      * @param reply Indicates the reply to be sent;
333      * @return Returns ERR_OK if called successfully; returns error code otherwise.
334      */
335     ErrCode HandleGetAbilityLabelWithModuleName(MessageParcel &data, MessageParcel &reply);
336     /**
337      * @brief Handles the CheckIsSystemAppByUid function called from a IBundleMgr proxy object.
338      * @param data Indicates the data to be read.
339      * @param reply Indicates the reply to be sent;
340      * @return Returns ERR_OK if called successfully; returns error code otherwise.
341      */
342     ErrCode HandleCheckIsSystemAppByUid(MessageParcel &data, MessageParcel &reply);
343     /**
344      * @brief Handles the GetBundleArchiveInfo function called from a IBundleMgr proxy object.
345      * @param data Indicates the data to be read.
346      * @param reply Indicates the reply to be sent;
347      * @return Returns ERR_OK if called successfully; returns error code otherwise.
348      */
349     ErrCode HandleGetBundleArchiveInfo(MessageParcel &data, MessageParcel &reply);
350     /**
351      * @brief Handles the GetBundleArchiveInfo function called from a IBundleMgr proxy object.
352      * @param data Indicates the data to be read.
353      * @param reply Indicates the reply to be sent;
354      * @return Returns ERR_OK if called successfully; returns error code otherwise.
355      */
356     ErrCode HandleGetBundleArchiveInfoWithIntFlags(MessageParcel &data, MessageParcel &reply);
357     /**
358      * @brief Handles the GetBundleArchiveInfo function called from a IBundleMgr proxy object.
359      * @param data Indicates the data to be read.
360      * @param reply Indicates the reply to be sent;
361      * @return Returns ERR_OK if called successfully; returns error code otherwise.
362      */
363     ErrCode HandleGetBundleArchiveInfoWithIntFlagsV9(MessageParcel &data, MessageParcel &reply);
364     /**
365      * @brief Handles the GetHapModuleInfo function called from a IBundleMgr proxy object.
366      * @param data Indicates the data to be read.
367      * @param reply Indicates the reply to be sent;
368      * @return Returns ERR_OK if called successfully; returns error code otherwise.
369      */
370     ErrCode HandleGetHapModuleInfo(MessageParcel &data, MessageParcel &reply);
371     /**
372      * @brief Handles the GetHapModuleInfo function called from a IBundleMgr proxy object.
373      * @param data Indicates the data to be read.
374      * @param reply Indicates the reply to be sent;
375      * @return Returns ERR_OK if called successfully; returns error code otherwise.
376      */
377     ErrCode HandleGetHapModuleInfoWithUserId(MessageParcel &data, MessageParcel &reply);
378     /**
379      * @brief Handles the GetLaunchWantForBundle function called from a IBundleMgr proxy object.
380      * @param data Indicates the data to be read.
381      * @param reply Indicates the reply to be sent;
382      * @return Returns ERR_OK if called successfully; returns error code otherwise.
383      */
384     ErrCode HandleGetLaunchWantForBundle(MessageParcel &data, MessageParcel &reply);
385     /**
386      * @brief Handles the GetPermissionDef function called from a IBundleMgr proxy object.
387      * @param data Indicates the data to be read.
388      * @param reply Indicates the reply to be sent;
389      * @return Returns ERR_OK if called successfully; returns error code otherwise.
390      */
391     ErrCode HandleGetPermissionDef(MessageParcel &data, MessageParcel &reply);
392     /**
393      * @brief Handles the CleanBundleCacheFilesAutomatic function called from a IBundleMgr proxy object.
394      * @param data Indicates the data to be read.
395      * @param reply Indicates the reply to be sent;
396      * @return Returns ERR_OK if called successfully; returns error code otherwise.
397      */
398     ErrCode HandleCleanBundleCacheFilesAutomatic(MessageParcel &data, MessageParcel &reply);
399     /**
400      * @brief Handles the CleanBundleCacheFiles function called from a IBundleMgr proxy object.
401      * @param data Indicates the data to be read.
402      * @param reply Indicates the reply to be sent;
403      * @return Returns ERR_OK if called successfully; returns error code otherwise.
404      */
405     ErrCode HandleCleanBundleCacheFiles(MessageParcel &data, MessageParcel &reply);
406     /**
407      * @brief Handles the CleanBundleDataFiles function called from a IBundleMgr proxy object.
408      * @param data Indicates the data to be read.
409      * @param reply Indicates the reply to be sent;
410      * @return Returns ERR_OK if called successfully; returns error code otherwise.
411      */
412     ErrCode HandleCleanBundleDataFiles(MessageParcel &data, MessageParcel &reply);
413     /**
414      * @brief Handles the RegisterBundleStatusCallback function called from a IBundleMgr proxy object.
415      * @param data Indicates the data to be read.
416      * @param reply Indicates the reply to be sent;
417      * @return Returns ERR_OK if called successfully; returns error code otherwise.
418      */
419     ErrCode HandleRegisterBundleStatusCallback(MessageParcel &data, MessageParcel &reply);
420 
421     ErrCode HandleRegisterBundleEventCallback(MessageParcel &data, MessageParcel &reply);
422 
423     ErrCode HandleUnregisterBundleEventCallback(MessageParcel &data, MessageParcel &reply);
424     /**
425      * @brief Handles the ClearBundleStatusCallback function called from a IBundleMgr proxy object.
426      * @param data Indicates the data to be read.
427      * @param reply Indicates the reply to be sent;
428      * @return Returns ERR_OK if called successfully; returns error code otherwise.
429      */
430     ErrCode HandleClearBundleStatusCallback(MessageParcel &data, MessageParcel &reply);
431     /**
432      * @brief Handles the UnregisterBundleStatusCallback function called from a IBundleMgr proxy object.
433      * @param data Indicates the data to be read.
434      * @param reply Indicates the reply to be sent;
435      * @return Returns ERR_OK if called successfully; returns error code otherwise.
436      */
437     ErrCode HandleUnregisterBundleStatusCallback(MessageParcel &data, MessageParcel &reply);
438     /**
439      * @brief Handles the DumpInfos function called from a IBundleMgr proxy object.
440      * @param data Indicates the data to be read.
441      * @param reply Indicates the reply to be sent;
442      * @return Returns ERR_OK if called successfully; returns error code otherwise.
443      */
444     ErrCode HandleDumpInfos(MessageParcel &data, MessageParcel &reply);
445     /**
446      * @brief Handles the CompileProcessAOT function called from a IBundleMgr proxy object.
447      * @param data Indicates the data to be read.
448      * @param reply Indicates the reply to be sent;
449      * @return Returns ERR_OK if called successfully; returns error code otherwise.
450      */
451     ErrCode HandleCompileProcessAOT(MessageParcel &data, MessageParcel &reply);
452     /**
453      * @brief Handles the CompileReset function called from a IBundleMgr proxy object.
454      * @param data Indicates the data to be read.
455      * @param reply Indicates the reply to be sent;
456      * @return Returns ERR_OK if called successfully; returns error code otherwise.
457      */
458     ErrCode HandleCompileReset(MessageParcel &data, MessageParcel &reply);
459     /**
460      * @brief Handles the CopyAp function called from a IBundleMgr proxy object.
461      * @param data Indicates the data to be read.
462      * @param reply Indicates the reply to be sent;
463      * @return Returns ERR_OK if called successfully; returns error code otherwise.
464      */
465     ErrCode HandleCopyAp(MessageParcel &data, MessageParcel &reply);
466     /**
467      * @brief Handles the GetBundleInstaller function called from a IBundleMgr proxy object.
468      * @param data Indicates the data to be read.
469      * @param reply Indicates the reply to be sent;
470      * @return Returns ERR_OK if called successfully; returns error code otherwise.
471      */
472     ErrCode HandleGetBundleInstaller(MessageParcel &data, MessageParcel &reply);
473     /**
474      * @brief Handles the GetBundleUserMgr function called from a IBundleMgr proxy object.
475      * @param data Indicates the data to be read.
476      * @param reply Indicates the reply to be sent;
477      * @return Returns ERR_OK if called successfully; returns error code otherwise.
478      */
479     ErrCode HandleGetBundleUserMgr(MessageParcel &data, MessageParcel &reply);
480     /**
481      * @brief Handles the GetVerifyManager function called from a IBundleMgr proxy object.
482      * @param data Indicates the data to be read.
483      * @param reply Indicates the reply to be sent;
484      * @return Returns ERR_OK if called successfully; returns error code otherwise.
485      */
486     ErrCode HandleGetVerifyManager(MessageParcel &data, MessageParcel &reply);
487     /**
488      * @brief Handles the IsApplicationEnabled function called from a IBundleMgr proxy object.
489      * @param data Indicates the data to be read.
490      * @param reply Indicates the reply to be sent;
491      * @return Returns ERR_OK if called successfully; returns error code otherwise.
492      */
493     ErrCode HandleIsApplicationEnabled(MessageParcel &data, MessageParcel &reply);
494     /**
495      * @brief Handles the IsCloneApplicationEnabled function called from a IBundleMgr proxy object.
496      * @param data Indicates the data to be read.
497      * @param reply Indicates the reply to be sent;
498      * @return Returns ERR_OK if called successfully; returns error code otherwise.
499      */
500     ErrCode HandleIsCloneApplicationEnabled(MessageParcel &data, MessageParcel &reply);
501     /**
502      * @brief Handles the SetApplicationEnabled function called from a IBundleMgr proxy object.
503      * @param data Indicates the data to be read.
504      * @param reply Indicates the reply to be sent;
505      * @return Returns ERR_OK if called successfully; returns error code otherwise.
506      */
507     ErrCode HandleSetApplicationEnabled(MessageParcel &data, MessageParcel &reply);
508     /**
509      * @brief Handles the SetCloneApplicationEnabled function called from a IBundleMgr proxy object.
510      * @param data Indicates the data to be read.
511      * @param reply Indicates the reply to be sent;
512      * @return Returns ERR_OK if called successfully; returns error code otherwise.
513      */
514     ErrCode HandleSetCloneApplicationEnabled(MessageParcel &data, MessageParcel &reply);
515     /**
516      * @brief Handles the IsAbilityEnabled function called from a IBundleMgr proxy object.
517      * @param data Indicates the data to be read.
518      * @param reply Indicates the reply to be sent;
519      * @return Returns ERR_OK if called successfully; returns error code otherwise.
520      */
521     ErrCode HandleIsAbilityEnabled(MessageParcel &data, MessageParcel &reply);
522     /**
523      * @brief Handles the IsCloneAbilityEnabled function called from a IBundleMgr proxy object.
524      * @param data Indicates the data to be read.
525      * @param reply Indicates the reply to be sent;
526      * @return Returns ERR_OK if called successfully; returns error code otherwise.
527      */
528     ErrCode HandleIsCloneAbilityEnabled(MessageParcel &data, MessageParcel &reply);
529     /**
530      * @brief Handles the SetAbilityEnabled function called from a IBundleMgr proxy object.
531      * @param data Indicates the data to be read.
532      * @param reply Indicates the reply to be sent;
533      * @return Returns ERR_OK if called successfully; returns error code otherwise.
534      */
535     ErrCode HandleSetAbilityEnabled(MessageParcel &data, MessageParcel &reply);
536     /**
537      * @brief Handles the SetCloneAbilityEnabled function called from a IBundleMgr proxy object.
538      * @param data Indicates the data to be read.
539      * @param reply Indicates the reply to be sent;
540      * @return Returns ERR_OK if called successfully; returns error code otherwise.
541      */
542     ErrCode HandleSetCloneAbilityEnabled(MessageParcel &data, MessageParcel &reply);
543     /**
544      * @brief Handles the GetAllFormsInfo function called from a IBundleMgr proxy object.
545      * @param data Indicates the data to be read.
546      * @param reply Indicates the reply to be sent;
547      * @return Returns ERR_OK if called successfully; returns error code otherwise.
548      */
549     ErrCode HandleGetAllFormsInfo(MessageParcel &data, MessageParcel &reply);
550     /**
551      * @brief Handles the GetFormsInfoByApp function called from a IBundleMgr proxy object.
552      * @param data Indicates the data to be read.
553      * @param reply Indicates the reply to be sent;
554      * @return Returns ERR_OK if called successfully; returns error code otherwise.
555      */
556     ErrCode HandleGetFormsInfoByApp(MessageParcel &data, MessageParcel &reply);
557     /**
558      * @brief Handles the HandleGetFormsInfoByModule function called from a IBundleMgr proxy object.
559      * @param data Indicates the data to be read.
560      * @param reply Indicates the reply to be sent;
561      * @return Returns ERR_OK if called successfully; returns error code otherwise.
562      */
563     ErrCode HandleGetFormsInfoByModule(MessageParcel &data, MessageParcel &reply);
564     /**
565      * @brief Handles the HandleGetShortcutInfo function called from a IBundleMgr proxy object.
566      * @param data Indicates the data to be read.
567      * @param reply Indicates the reply to be sent;
568      * @return Returns ERR_OK if called successfully; returns error code otherwise.
569      */
570     ErrCode HandleGetShortcutInfos(MessageParcel &data, MessageParcel &reply);
571     /**
572      * @brief Handles the HandleGetShortcutInfo function called from a IBundleMgr proxy object.
573      * @param data Indicates the data to be read.
574      * @param reply Indicates the reply to be sent;
575      * @return Returns err_code of result.
576      */
577     ErrCode HandleGetShortcutInfoV9(MessageParcel &data, MessageParcel &reply);
578     /**
579      * @brief Handles the HandleGetAllCommonEventInfo function called from a IBundleMgr proxy object.
580      * @param data Indicates the data to be read.
581      * @param reply Indicates the reply to be sent;
582      * @return Returns ERR_OK if called successfully; returns error code otherwise.
583      */
584     ErrCode HandleGetAllCommonEventInfo(MessageParcel &data, MessageParcel &reply);
585     /**
586      * @brief Handles the GetDistributedBundleInfo function called from a IBundleMgr proxy object.
587      * @param data Indicates the data to be read.
588      * @param reply Indicates the reply to be sent;
589      * @return Returns ERR_OK if called successfully; returns error code otherwise.
590      */
591     ErrCode HandleGetDistributedBundleInfo(MessageParcel &data, MessageParcel &reply);
592     /**
593      * @brief Handles the HandleGetAppPrivilegeLevel function called from a IBundleMgr proxy object.
594      * @param data Indicates the data to be read.
595      * @param reply Indicates the reply to be sent;
596      * @return Returns ERR_OK if called successfully; returns error code otherwise.
597      */
598     ErrCode HandleGetAppPrivilegeLevel(MessageParcel &data, MessageParcel &reply);
599     /**
600      * @brief Handles the HandleQueryExtAbilityInfosWithoutType function called from a IBundleMgr proxy object.
601      * @param data Indicates the data to be read.
602      * @param reply Indicates the reply to be sent;
603      * @return Returns ERR_OK if called successfully; returns error code otherwise.
604      */
605     ErrCode HandleQueryExtAbilityInfosWithoutType(MessageParcel &data, MessageParcel &reply);
606     /**
607      * @brief Handles the HandleQueryExtAbilityInfosWithoutTypeV9 function called from a IBundleMgr proxy object.
608      * @param data Indicates the data to be read.
609      * @param reply Indicates the reply to be sent;
610      * @return Returns ERR_OK if called successfully; returns error code otherwise.
611      */
612     ErrCode HandleQueryExtAbilityInfosWithoutTypeV9(MessageParcel &data, MessageParcel &reply);
613     /**
614      * @brief Handles the HandleQueryExtensionInfo function called from a IBundleMgr proxy object.
615      * @param data Indicates the data to be read.
616      * @param reply Indicates the reply to be sent;
617      * @return Returns ERR_OK if called successfully; returns error code otherwise.
618      */
619     ErrCode HandleQueryExtAbilityInfos(MessageParcel &data, MessageParcel &reply);
620     /**
621      * @brief Handles the HandleQueryExtAbilityInfosV9 function called from a IBundleMgr proxy object.
622      * @param data Indicates the data to be read.
623      * @param reply Indicates the reply to be sent;
624      * @return Returns ERR_OK if called successfully; returns error code otherwise.
625      */
626     ErrCode HandleQueryExtAbilityInfosV9(MessageParcel &data, MessageParcel &reply);
627 
628     ErrCode HandleQueryExtAbilityInfosByType(MessageParcel &data, MessageParcel &reply);
629 
630     ErrCode HandleVerifyCallingPermission(MessageParcel &data, MessageParcel &reply);
631 
632     ErrCode HandleQueryExtensionAbilityInfoByUri(MessageParcel &data, MessageParcel &reply);
633 
634     ErrCode HandleGetAppIdByBundleName(MessageParcel &data, MessageParcel &reply);
635 
636     ErrCode HandleGetAppType(MessageParcel &data, MessageParcel &reply);
637 
638     ErrCode HandleGetUidByBundleName(MessageParcel &data, MessageParcel &reply);
639 
640     ErrCode HandleGetUidByDebugBundleName(MessageParcel &data, MessageParcel &reply);
641 
642     ErrCode HandleGetAbilityInfo(MessageParcel &data, MessageParcel &reply);
643 
644     ErrCode HandleGetAbilityInfoWithModuleName(MessageParcel &data, MessageParcel &reply);
645 
646     /**
647      * @brief Handles the HandleGetModuleUpgradeFlag function called from a IBundleMgr proxy object.
648      * @param data Indicates the data to be read.
649      * @param reply Indicates the reply to be sent;
650      * @return Returns ERR_OK if called successfully; returns error code otherwise.
651      */
652     ErrCode HandleGetModuleUpgradeFlag(MessageParcel &data, MessageParcel &reply);
653     /**
654      * @brief Handles the HandleSetModuleUpgradeFlag function called from a IBundleMgr proxy object.
655      * @param data Indicates the data to be read.
656      * @param reply Indicates the reply to be sent;
657      * @return Returns ERR_OK if called successfully; returns error code otherwise.
658      */
659     ErrCode HandleSetModuleUpgradeFlag(MessageParcel &data, MessageParcel &reply);
660     /**
661      * @brief Handles the HandleIsModuleRemovable function called from a IBundleMgr proxy object.
662      * @param data Indicates the data to be read.
663      * @param reply Indicates the reply to be sent;
664      * @return Returns ERR_OK if called successfully; returns error code otherwise.
665      */
666     ErrCode HandleIsModuleRemovable(MessageParcel &data, MessageParcel &reply);
667     /**
668      * @brief Handles the HandleSetModuleRemovable function called from a IBundleMgr proxy object.
669      * @param data Indicates the data to be read.
670      * @param reply Indicates the reply to be sent;
671      * @return Returns ERR_OK if called successfully; returns error code otherwise.
672      */
673     ErrCode HandleSetModuleRemovable(MessageParcel &data, MessageParcel &reply);
674 
675     ErrCode HandleImplicitQueryInfoByPriority(MessageParcel &data, MessageParcel &reply);
676 
677     ErrCode HandleImplicitQueryInfos(MessageParcel &data, MessageParcel &reply);
678 
679     ErrCode HandleGetAllDependentModuleNames(MessageParcel &data, MessageParcel &reply);
680 
681     ErrCode HandleGetSandboxBundleInfo(MessageParcel &data, MessageParcel &reply);
682 
683     ErrCode HandleObtainCallingBundleName(MessageParcel &data, MessageParcel &reply);
684 
685     ErrCode HandleGetBundleStats(MessageParcel &data, MessageParcel &reply);
686 
687     ErrCode HandleGetAllBundleStats(MessageParcel &data, MessageParcel &reply);
688 
689     ErrCode HandleGetAllBundleCacheStat(MessageParcel &data, MessageParcel &reply);
690 
691     ErrCode HandleCleanAllBundleCache(MessageParcel &data, MessageParcel &reply);
692 
693     ErrCode HandleGetExtendResourceManager(MessageParcel &data, MessageParcel &reply);
694 
695     ErrCode HandleCheckAbilityEnableInstall(MessageParcel &data, MessageParcel &reply);
696 
697     ErrCode HandleGetSandboxAbilityInfo(MessageParcel &data, MessageParcel &reply);
698 
699     ErrCode HandleGetSandboxExtAbilityInfos(MessageParcel &data, MessageParcel &reply);
700 
701     ErrCode HandleGetSandboxHapModuleInfo(MessageParcel &data, MessageParcel &reply);
702 
703     ErrCode HandleGetMediaData(MessageParcel &data, MessageParcel &reply);
704 
705     ErrCode HandleGetStringById(MessageParcel &data, MessageParcel &reply);
706 
707     ErrCode HandleGetIconById(MessageParcel &data, MessageParcel &reply);
708 
709 #ifdef BUNDLE_FRAMEWORK_DEFAULT_APP
710     ErrCode HandleGetDefaultAppProxy(MessageParcel &data, MessageParcel &reply);
711 #endif
712 
713 #ifdef BUNDLE_FRAMEWORK_APP_CONTROL
714     ErrCode HandleGetAppControlProxy(MessageParcel &data, MessageParcel &reply);
715 #endif
716 
717     ErrCode HandleGetQuickFixManagerProxy(MessageParcel &data, MessageParcel &reply);
718 
719     ErrCode HandleSetDebugMode(MessageParcel &data, MessageParcel &reply);
720 
721     ErrCode HandleVerifySystemApi(MessageParcel &data, MessageParcel &reply);
722 
723     ErrCode HandleGetOverlayManagerProxy(MessageParcel &data, MessageParcel &reply);
724 
725     ErrCode HandleProcessPreload(MessageParcel &data, MessageParcel &reply);
726 
727     ErrCode HandleGetAppProvisionInfo(MessageParcel &data, MessageParcel &reply);
728 
729     ErrCode HandleGetProvisionMetadata(MessageParcel &data, MessageParcel &reply);
730 
731     ErrCode HandleGetBaseSharedBundleInfos(MessageParcel &data, MessageParcel &reply);
732 
733     ErrCode HandleGetAllSharedBundleInfo(MessageParcel &data, MessageParcel &reply);
734 
735     ErrCode HandleGetSharedBundleInfo(MessageParcel &data, MessageParcel &reply);
736 
737     ErrCode HandleGetSharedBundleInfoBySelf(MessageParcel &data, MessageParcel &reply);
738 
739     ErrCode HandleGetSharedDependencies(MessageParcel &data, MessageParcel &reply);
740 
741     ErrCode HandleGetProxyDataInfos(MessageParcel &data, MessageParcel &reply);
742 
743     ErrCode HandleGetAllProxyDataInfos(MessageParcel &data, MessageParcel &reply);
744 
745     ErrCode HandleGetSpecifiedDistributionType(MessageParcel &data, MessageParcel &reply);
746 
747     ErrCode HandleGetAdditionalInfo(MessageParcel &data, MessageParcel &reply);
748 
749     ErrCode HandleSetExtNameOrMIMEToApp(MessageParcel &data, MessageParcel &reply);
750 
751     ErrCode HandleDelExtNameOrMIMEToApp(MessageParcel &data, MessageParcel &reply);
752 
753     ErrCode HandleQueryDataGroupInfos(MessageParcel &data, MessageParcel &reply);
754 
755     ErrCode HandleGetPreferenceDirByGroupId(MessageParcel &data, MessageParcel &reply);
756 
757     ErrCode HandleQueryAppGalleryBundleName(MessageParcel &data, MessageParcel &reply);
758 
759     /**
760      * @brief Handles the HandleQueryExtensionAbilityInfosWithTypeName function called from a IBundleMgr proxy object.
761      * @param data Indicates the data to be read.
762      * @param reply Indicates the reply to be sent;
763      * @return Returns ERR_OK if called successfully; returns error code otherwise.
764      */
765     ErrCode HandleQueryExtensionAbilityInfosWithTypeName(MessageParcel &data, MessageParcel &reply);
766 
767     /**
768      * @brief Handles the HandleQueryExtensionAbilityInfosWithoutWant function called from a IBundleMgr proxy object.
769      * @param data Indicates the data to be read.
770      * @param reply Indicates the reply to be sent;
771      * @return Returns ERR_OK if called successfully; returns error code otherwise.
772      */
773     ErrCode HandleQueryExtensionAbilityInfosOnlyWithTypeName(MessageParcel &data, MessageParcel &reply);
774     ErrCode HandleResetAOTCompileStatus(MessageParcel &data, MessageParcel &reply);
775 
776     ErrCode HandleGetJsonProfile(MessageParcel &data, MessageParcel &reply);
777 
778     ErrCode HandleGetBundleResourceProxy(MessageParcel &data, MessageParcel &reply);
779     ErrCode HandleSetAdditionalInfo(MessageParcel &data, MessageParcel &reply);
780 
781     ErrCode HandleGetRecoverableApplicationInfo(MessageParcel &data, MessageParcel &reply);
782 
783     ErrCode HandleGetUninstalledBundleInfo(MessageParcel &data, MessageParcel &reply);
784 
785     ErrCode HandleCreateBundleDataDir(MessageParcel &data, MessageParcel &reply);
786 
787     ErrCode HandleCreateBundleDataDirWithEl(MessageParcel &data, MessageParcel &reply);
788 
789     /**
790      * @brief Handles the GetAllPreinstalledApplicationInfos function called from a IBundleMgr proxy object.
791      * @param data Indicates the data to be read.
792      * @param reply Indicates the reply to be sent;
793      * @return Returns ERR_OK if called successfully; returns error code otherwise.
794      */
795     ErrCode HandleGetAllPreinstalledApplicationInfos(MessageParcel &data, MessageParcel &reply);
796 
797     /**
798      * @brief Handles the CanOpenLink function called from a IBundleMgr proxy object.
799      * @param data Indicates the data to be read.
800      * @param reply Indicates the reply to be sent;
801      * @return Returns ERR_OK if called successfully; returns error code otherwise.
802      */
803     ErrCode HandleCanOpenLink(MessageParcel &data, MessageParcel &reply);
804 
805     ErrCode HandleGetOdid(MessageParcel &data, MessageParcel &reply);
806 
807     ErrCode HandleGetAllBundleInfoByDeveloperId(MessageParcel &data, MessageParcel &reply);
808 
809     ErrCode HandleGetDeveloperIds(MessageParcel &data, MessageParcel &reply);
810 
811     ErrCode HandleSwitchUninstallState(MessageParcel &data, MessageParcel &reply);
812 
813     ErrCode HandleQueryAbilityInfoByContinueType(MessageParcel &data, MessageParcel &reply);
814 
815     ErrCode HandleQueryCloneAbilityInfo(MessageParcel &data, MessageParcel &reply);
816 
817     ErrCode HandleGetCloneBundleInfo(MessageParcel &data, MessageParcel &reply);
818 
819     ErrCode HandleGetCloneAppIndexes(MessageParcel &data, MessageParcel &reply);
820 
821     ErrCode HandleGetLaunchWant(MessageParcel &data, MessageParcel &reply);
822 
823     ErrCode HandleQueryCloneExtensionAbilityInfoWithAppIndex(MessageParcel &data, MessageParcel &reply);
824 
825     ErrCode HandleGetSignatureInfoByBundleName(MessageParcel &data, MessageParcel &reply);
826 
827     ErrCode HandleAddDesktopShortcutInfo(MessageParcel &data, MessageParcel &reply);
828 
829     ErrCode HandleDeleteDesktopShortcutInfo(MessageParcel &data, MessageParcel &reply);
830 
831     ErrCode HandleGetAllDesktopShortcutInfo(MessageParcel &data, MessageParcel &reply);
832 
833     ErrCode HandleGetCompatibleDeviceTypeNative(MessageParcel &data, MessageParcel &reply);
834 
835     ErrCode HandleGetCompatibleDeviceType(MessageParcel &data, MessageParcel &reply);
836 
837     ErrCode HandleGetOdidByBundleName(MessageParcel &data, MessageParcel &reply);
838 
839     /**
840      * @brief Handles the GetBundleInfosForContinuation function called from a IBundleMgr proxy object.
841      * @param data Indicates the data to be read.
842      * @param reply Indicates the reply to be sent;
843      * @return Returns ERR_OK if called successfully; returns error code otherwise.
844      */
845     ErrCode HandleGetBundleInfosForContinuation(MessageParcel &data, MessageParcel &reply);
846 
847     /**
848      * @brief Handles the GetContinueBundleNames function called from a IBundleMgr proxy object.
849      * @param data Indicates the data to be read.
850      * @param reply Indicates the reply to be sent;
851      * @return Returns ERR_OK if called successfully; returns error code otherwise.
852      */
853     ErrCode HandleGetContinueBundleNames(MessageParcel &data, MessageParcel &reply);
854 
855     ErrCode HandleIsBundleInstalled(MessageParcel &data, MessageParcel &reply);
856 
857     ErrCode HandleGetBundleNameByAppId(MessageParcel &data, MessageParcel &reply);
858 
859     ErrCode HandleGetDirByBundleNameAndAppIndex(MessageParcel &data, MessageParcel &reply);
860     ErrCode HandleGetAllBundleDirs(MessageParcel &data, MessageParcel &reply);
861 
862 private:
863     /**
864      * @brief Write a parcelabe vector objects to the proxy node.
865      * @param parcelableVector Indicates the objects to be write.
866      * @param reply Indicates the reply to be sent;
867      * @return Returns true if objects send successfully; returns false otherwise.
868      */
869     template<typename T>
870     bool WriteParcelableVector(std::vector<T> &parcelableVector, MessageParcel &reply);
871 
872     template<typename T>
873     bool WriteVectorToParcelIntelligent(std::vector<T> &parcelableVector, MessageParcel &reply);
874     /**
875      * @brief Allocat ashmem num.
876      * @return Returns ashmem num.
877      */
878     int32_t AllocatAshmemNum();
879 
880     template<typename T>
881     bool WriteParcelableIntoAshmem(
882         T &parcelable, const char *ashmemName, MessageParcel &reply);
883 
884     template<typename T>
885     ErrCode WriteBigParcelable(
886         T &parcelable, const char *ashmemName, MessageParcel &reply);
887 
888     template<typename T>
889     ErrCode WriteParcelInfo(const T &parcelInfo, MessageParcel &reply) const;
890 
891     template<typename T>
892     ErrCode WriteParcelInfoIntelligent(const T &parcelInfo, MessageParcel &reply) const;
893 
894     ErrCode WriteBigString(const std::string &str, MessageParcel &reply) const;
895 
896     template<typename T>
897     ErrCode ReadParcelInfoIntelligent(MessageParcel &data, T &parcelInfo);
898 
899     ErrCode WriteParcelableIntoAshmem(MessageParcel &tempParcel, MessageParcel &reply);
900 
901     std::mutex bundleAshmemMutex_;
902     int32_t ashmemNum_ = 0;
903     DISALLOW_COPY_AND_MOVE(BundleMgrHost);
904 };
905 }  // namespace AppExecFwk
906 }  // namespace OHOS
907 #endif  // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_HOST_H
908