• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-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 FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_INTERFACE_H
17 #define FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_INTERFACE_H
18 
19 #include "ability_info.h"
20 #include "appexecfwk_errors.h"
21 #include "application_info.h"
22 #include "app_provision_info.h"
23 #include "bundle_additional_info.h"
24 #include "bundle_constants.h"
25 #include "bundle_dir.h"
26 #include "bundle_distribution_type.h"
27 #include "bundle_event_callback_interface.h"
28 #include "bundle_info.h"
29 #include "bundle_pack_info.h"
30 #include "bundle_installer_interface.h"
31 #include "bundle_status_callback_interface.h"
32 #include "bundle_storage_stats.h"
33 #include "bundle_user_mgr_interface.h"
34 #include "clean_cache_callback_interface.h"
35 #include "common_event_info.h"
36 #include "data_group_info.h"
37 #include "app_control_interface.h"
38 #include "bundle_resource_interface.h"
39 #include "default_app_interface.h"
40 #include "extend_resource_manager_interface.h"
41 #include "ibundle_mgr_ext.h"
42 #include "module_test_runner.h"
43 #include "overlay_manager_interface.h"
44 #include "plugin/plugin_bundle_info.h"
45 #include "quick_fix_manager_interface.h"
46 #include "iverify_manager.h"
47 #include "distributed_bundle_info.h"
48 #include "form_info.h"
49 #include "hap_module_info.h"
50 #include "permission_define.h"
51 #include "preinstalled_application_info.h"
52 #include "process_cache_callback_interface.h"
53 #include "recoverable_application_info.h"
54 #include "shared/base_shared_bundle_info.h"
55 #include "shared/shared_bundle_info.h"
56 #include "shortcut_info.h"
57 #include "want.h"
58 
59 namespace OHOS {
60 namespace AppExecFwk {
61 enum class DumpFlag {
62     DUMP_BUNDLE_LIST = 1,   // corresponse to option "-bundle-list"
63     DUMP_BUNDLE_INFO,       // corresponse to option "-bundle [name]"
64     DUMP_SHORTCUT_INFO,     // corresponse to option "-bundle [name] -shortcut-info"
65     DUMP_DEBUG_BUNDLE_LIST, // corresponse to option "-debug-bundle-list"
66     DUMP_BUNDLE_LABEL,      // corresponse to option "-l"
67     DUMP_LABEL_LIST         // corresponse to option "-a -l"
68 };
69 
70 class IBundleMgr : public IRemoteBroker {
71 public:
72     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.appexecfwk.BundleMgr");
73 
74     using Want = OHOS::AAFwk::Want;
75     /**
76      * @brief Obtains the ApplicationInfo based on a given bundle name.
77      * @param appName Indicates the application bundle name to be queried.
78      * @param flag Indicates the flag used to specify information contained
79      *             in the ApplicationInfo object that will be returned.
80      * @param userId Indicates the user ID.
81      * @param appInfo Indicates the obtained ApplicationInfo object.
82      * @return Returns true if the application is successfully obtained; returns false otherwise.
83      */
GetApplicationInfo(const std::string & appName,const ApplicationFlag flag,const int userId,ApplicationInfo & appInfo)84     virtual bool GetApplicationInfo(
85         const std::string &appName, const ApplicationFlag flag, const int userId, ApplicationInfo &appInfo)
86     {
87         return false;
88     }
89     /**
90      * @brief Obtains the ApplicationInfo based on a given bundle name.
91      * @param appName Indicates the application bundle name to be queried.
92      * @param flags Indicates the flag used to specify information contained
93      *             in the ApplicationInfo object that will be returned.
94      * @param userId Indicates the user ID.
95      * @param appInfo Indicates the obtained ApplicationInfo object.
96      * @return Returns true if the application is successfully obtained; returns false otherwise.
97      */
GetApplicationInfo(const std::string & appName,int32_t flags,int32_t userId,ApplicationInfo & appInfo)98     virtual bool GetApplicationInfo(
99         const std::string &appName, int32_t flags, int32_t userId, ApplicationInfo &appInfo)
100     {
101         return false;
102     }
103     /**
104      * @brief Obtains the ApplicationInfo based on a given bundle name.
105      * @param appName Indicates the application bundle name to be queried.
106      * @param flag Indicates the flag used to specify information contained
107      *             in the ApplicationInfo object that will be returned.
108      * @param userId Indicates the user ID.
109      * @param appInfo Indicates the obtained ApplicationInfo object.
110      * @return Returns ERR_OK if the application is successfully obtained; returns error code otherwise.
111      */
GetApplicationInfoV9(const std::string & appName,int32_t flag,int32_t userId,ApplicationInfo & appInfo)112     virtual ErrCode GetApplicationInfoV9(
113         const std::string &appName, int32_t flag, int32_t userId, ApplicationInfo &appInfo)
114     {
115         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
116     }
117     /**
118      * @brief Obtains information about all installed applications of a specified user.
119      * @param flag Indicates the flag used to specify information contained
120      *             in the ApplicationInfo objects that will be returned.
121      * @param userId Indicates the user ID.
122      * @param appInfos Indicates all of the obtained ApplicationInfo objects.
123      * @return Returns true if the application is successfully obtained; returns false otherwise.
124      */
GetApplicationInfos(const ApplicationFlag flag,int userId,std::vector<ApplicationInfo> & appInfos)125     virtual bool GetApplicationInfos(
126         const ApplicationFlag flag, int userId, std::vector<ApplicationInfo> &appInfos)
127     {
128         return false;
129     }
130     /**
131      * @brief Obtains information about all installed applications of a specified user.
132      * @param flags Indicates the flag used to specify information contained
133      *             in the ApplicationInfo objects that will be returned.
134      * @param userId Indicates the user ID.
135      * @param appInfos Indicates all of the obtained ApplicationInfo objects.
136      * @return Returns true if the application is successfully obtained; returns false otherwise.
137      */
GetApplicationInfos(int32_t flags,int32_t userId,std::vector<ApplicationInfo> & appInfos)138     virtual bool GetApplicationInfos(
139         int32_t flags, int32_t userId, std::vector<ApplicationInfo> &appInfos)
140     {
141         return false;
142     }
143     /**
144      * @brief Obtains information about all installed applications of a specified user.
145      * @param flags Indicates the flag used to specify information contained
146      *             in the ApplicationInfo objects that will be returned.
147      * @param userId Indicates the user ID.
148      * @param appInfos Indicates all of the obtained ApplicationInfo objects.
149      * @return Returns ERR_OK if the application is successfully obtained; returns error code otherwise.
150      */
GetApplicationInfosV9(int32_t flags,int32_t userId,std::vector<ApplicationInfo> & appInfos)151     virtual ErrCode GetApplicationInfosV9(
152         int32_t flags, int32_t userId, std::vector<ApplicationInfo> &appInfos)
153     {
154         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
155     }
156     /**
157      * @brief Obtains the BundleInfo based on a given bundle name.
158      * @param bundleName Indicates the application bundle name to be queried.
159      * @param flag Indicates the information contained in the BundleInfo object to be returned.
160      * @param bundleInfo Indicates the obtained BundleInfo object.
161      * @param userId Indicates the user ID.
162      * @return Returns true if the BundleInfo is successfully obtained; returns false otherwise.
163      */
164     virtual bool GetBundleInfo(const std::string &bundleName, const BundleFlag flag,
165         BundleInfo &bundleInfo, int32_t userId = Constants::UNSPECIFIED_USERID)
166     {
167         return false;
168     }
169     /**
170      * @brief Obtains the BundleInfo based on a given bundle name.
171      * @param bundleName Indicates the application bundle name to be queried.
172      * @param flags Indicates the information contained in the BundleInfo object to be returned.
173      * @param bundleInfo Indicates the obtained BundleInfo object.
174      * @param userId Indicates the user ID.
175      * @return Returns true if the BundleInfo is successfully obtained; returns false otherwise.
176      */
177     virtual bool GetBundleInfo(const std::string &bundleName, int32_t flags,
178         BundleInfo &bundleInfo, int32_t userId = Constants::UNSPECIFIED_USERID)
179     {
180         return false;
181     }
182     /**
183      * @brief Obtains the BundleInfo based on a given bundle name.
184      * @param bundleName Indicates the application bundle name to be queried.
185      * @param flags Indicates the information contained in the BundleInfo object to be returned.
186      * @param bundleInfo Indicates the obtained BundleInfo object.
187      * @param userId Indicates the user ID.
188      * @return Returns ERR_OK if the BundleInfo is successfully obtained; returns error code otherwise.
189      */
GetBundleInfoV9(const std::string & bundleName,int32_t flags,BundleInfo & bundleInfo,int32_t userId)190     virtual ErrCode GetBundleInfoV9(const std::string &bundleName, int32_t flags,
191         BundleInfo &bundleInfo, int32_t userId)
192     {
193         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
194     }
195     /**
196      * @brief Obtains the BundleInfos by the given want list through the proxy object.
197      * @param wants Indicates the imformation of the abilities to be queried.
198      * @param flags Indicates the information contained in the BundleInfo object to be returned.
199      * @param bundleInfos Indicates the obtained BundleInfo list object.
200      * @param userId Indicates the user ID.
201      * @return Returns ERR_OK if the BundleInfo is successfully obtained; returns error code otherwise.
202      */
BatchGetBundleInfo(const std::vector<Want> & wants,int32_t flags,std::vector<BundleInfo> & bundleInfos,int32_t userId)203     virtual ErrCode BatchGetBundleInfo(const std::vector<Want> &wants, int32_t flags,
204         std::vector<BundleInfo> &bundleInfos, int32_t userId)
205     {
206         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
207     }
208     /**
209      * @brief Batch obtains the BundleInfos based on a given bundle name list.
210      * @param bundleNames Indicates the application bundle name list to be queried.
211      * @param flags Indicates the information contained in the BundleInfo object to be returned.
212      * @param bundleInfos Indicates the obtained BundleInfo list object.
213      * @param userId Indicates the user ID.
214      * @return Returns ERR_OK if the BundleInfo is successfully obtained; returns error code otherwise.
215      */
BatchGetBundleInfo(const std::vector<std::string> & bundleNames,int32_t flags,std::vector<BundleInfo> & bundleInfos,int32_t userId)216     virtual ErrCode BatchGetBundleInfo(const std::vector<std::string> &bundleNames, int32_t flags,
217         std::vector<BundleInfo> &bundleInfos, int32_t userId)
218     {
219         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
220     }
221     /**
222      * @brief Obtains the BundleInfo for the calling app.
223      * @param flags Indicates the information contained in the BundleInfo object to be returned.
224      * @param bundleInfo Indicates the obtained BundleInfo object.
225      * @return Returns ERR_OK if the BundleInfo is successfully obtained; returns error code otherwise.
226      */
GetBundleInfoForSelf(int32_t flags,BundleInfo & bundleInfo)227     virtual ErrCode GetBundleInfoForSelf(int32_t flags, BundleInfo &bundleInfo)
228     {
229         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
230     }
231     /**
232      * @brief Obtains the BundleInfo for the calling app.
233      * @param flags Indicates the information contained in the BundleInfo object to be returned.
234      * @param bundleInfo Indicates the obtained BundleInfo object.
235      * @return Returns ERR_OK if the BundleInfo is successfully obtained; returns error code otherwise.
236      */
GetBundleInfoForSelfWithCache(int32_t flags,BundleInfo & bundleInfo)237      virtual ErrCode GetBundleInfoForSelfWithCache(int32_t flags, BundleInfo &bundleInfo)
238      {
239          return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
240      }
241     /**
242      * @brief Obtains the BundleInfo for the calling app.
243      * @param flags Indicates the information contained in the BundleInfo object to be returned.
244      * @param bundleInfo Indicates the obtained BundleInfo object.
245      * @return Returns ERR_OK if the BundleInfo is successfully obtained; returns error code otherwise.
246      */
GetBundleInfoForSelfWithOutCache(int32_t flags,BundleInfo & bundleInfo)247      virtual ErrCode GetBundleInfoForSelfWithOutCache(int32_t flags, BundleInfo &bundleInfo)
248      {
249          return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
250      }
251     /**
252      * @brief Obtains the BundleInfo based on a given bundle name, which the calling app depends on.
253      * @param sharedBundleName Indicates the bundle name to be queried.
254      * @param sharedBundleInfo Indicates the obtained BundleInfo object.
255      * @param flag Indicates the flag, GetDependentBundleInfoFlag.
256      * @return Returns ERR_OK if the BundleInfo is successfully obtained; returns error code otherwise.
257      */
258     virtual ErrCode GetDependentBundleInfo(const std::string &sharedBundleName, BundleInfo &sharedBundleInfo,
259         GetDependentBundleInfoFlag flag = GetDependentBundleInfoFlag::GET_APP_CROSS_HSP_BUNDLE_INFO)
260     {
261         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
262     }
263     /**
264      * @brief Obtains the BundlePackInfo based on a given bundle name.
265      * @param bundleName Indicates the application bundle name to be queried.
266      * @param flags Indicates the information contained in the BundleInfo object to be returned.
267      * @param BundlePackInfo Indicates the obtained BundlePackInfo object.
268      * @param userId Indicates the user ID.
269      * @return Returns ERR_OK if the BundlePackInfo is successfully obtained; returns other ErrCode otherwise.
270      */
271     virtual ErrCode GetBundlePackInfo(const std::string &bundleName, const BundlePackFlag flag,
272         BundlePackInfo &bundlePackInfo, int32_t userId = Constants::UNSPECIFIED_USERID)
273     {
274         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
275     }
276 
277     /**
278      * @brief Obtains the BundlePackInfo based on a given bundle name.
279      * @param bundleName Indicates the application bundle name to be queried.
280      * @param flags Indicates the information contained in the BundleInfo object to be returned.
281      * @param BundlePackInfo Indicates the obtained BundlePackInfo object.
282      * @param userId Indicates the user ID.
283      * @return Returns ERR_OK if the BundlePackInfo is successfully obtained; returns other ErrCode otherwise.
284      */
285     virtual ErrCode GetBundlePackInfo(const std::string &bundleName, int32_t flags,
286         BundlePackInfo &bundlePackInfo, int32_t userId = Constants::UNSPECIFIED_USERID)
287     {
288         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
289     }
290 
291     /**
292      * @brief Obtains BundleInfo of all bundles available in the system.
293      * @param flag Indicates the flag used to specify information contained in the BundleInfo that will be returned.
294      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
295      * @param userId Indicates the user ID.
296      * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise.
297      */
298     virtual bool GetBundleInfos(const BundleFlag flag,
299         std::vector<BundleInfo> &bundleInfos, int32_t userId = Constants::UNSPECIFIED_USERID)
300     {
301         return false;
302     }
303     /**
304      * @brief Obtains BundleInfo of all bundles available in the system.
305      * @param flags Indicates the flag used to specify information contained in the BundleInfo that will be returned.
306      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
307      * @param userId Indicates the user ID.
308      * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise.
309      */
310     virtual bool GetBundleInfos(int32_t flags,
311         std::vector<BundleInfo> &bundleInfos, int32_t userId = Constants::UNSPECIFIED_USERID)
312     {
313         return false;
314     }
315     /**
316      * @brief Obtains BundleInfo of all bundles available in the system.
317      * @param flags Indicates the flag used to specify information contained in the BundleInfo that will be returned.
318      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
319      * @param userId Indicates the user ID.
320      * @return Returns ERR_OK if the BundleInfos is successfully obtained; returns error code otherwise.
321      */
GetBundleInfosV9(int32_t flags,std::vector<BundleInfo> & bundleInfos,int32_t userId)322     virtual ErrCode GetBundleInfosV9(int32_t flags, std::vector<BundleInfo> &bundleInfos, int32_t userId)
323     {
324         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
325     }
326     /**
327      * @brief Obtains the application UID based on the given bundle name and user ID.
328      * @param bundleName Indicates the bundle name of the application.
329      * @param userId Indicates the user ID.
330      * @return Returns the uid if successfully obtained; returns -1 otherwise.
331      */
GetUidByBundleName(const std::string & bundleName,const int userId)332     virtual int GetUidByBundleName(const std::string &bundleName, const int userId)
333     {
334         return Constants::INVALID_UID;
335     }
336     /**
337      * @brief Obtains the application UID based on the given bundle name and user ID.
338      * @param bundleName Indicates the bundle name of the application.
339      * @param userId Indicates the user ID.
340      * @param userId Indicates the app Index.
341      * @return Returns the uid if successfully obtained; returns -1 otherwise.
342      */
GetUidByBundleName(const std::string & bundleName,const int32_t userId,int32_t appIndex)343     virtual int32_t GetUidByBundleName(const std::string &bundleName, const int32_t userId, int32_t appIndex)
344     {
345         return Constants::INVALID_UID;
346     }
347     /**
348      * @brief Obtains the debug application UID based on the given bundle name and user ID.
349      * @param bundleName Indicates the bundle name of the application.
350      * @param userId Indicates the user ID.
351      * @return Returns the uid if successfully obtained; returns -1 otherwise.
352      */
GetUidByDebugBundleName(const std::string & bundleName,const int userId)353     virtual int GetUidByDebugBundleName(const std::string &bundleName, const int userId)
354     {
355         return Constants::INVALID_UID;
356     }
357     /**
358      * @brief Obtains the application ID based on the given bundle name and user ID.
359      * @param bundleName Indicates the bundle name of the application.
360      * @param userId Indicates the user ID.
361      * @return Returns the application ID if successfully obtained; returns empty string otherwise.
362      */
GetAppIdByBundleName(const std::string & bundleName,const int userId)363     virtual std::string GetAppIdByBundleName(const std::string &bundleName, const int userId)
364     {
365         return Constants::EMPTY_STRING;
366     }
367     /**
368      * @brief Obtains the bundle name of a specified application based on the given UID.
369      * @param uid Indicates the uid.
370      * @param bundleName Indicates the obtained bundle name.
371      * @return Returns true if the bundle name is successfully obtained; returns false otherwise.
372      */
GetBundleNameForUid(const int uid,std::string & bundleName)373     virtual bool GetBundleNameForUid(const int uid, std::string &bundleName)
374     {
375         return false;
376     }
377     /**
378      * @brief Obtains all bundle names of a specified application based on the given application UID.
379      * @param uid Indicates the uid.
380      * @param bundleNames Indicates the obtained bundle names.
381      * @return Returns true if the bundle names is successfully obtained; returns false otherwise.
382      */
GetBundlesForUid(const int uid,std::vector<std::string> & bundleNames)383     virtual bool GetBundlesForUid(const int uid, std::vector<std::string> &bundleNames)
384     {
385         return false;
386     }
387     /**
388      * @brief Obtains the formal name associated with the given UID.
389      * @param uid Indicates the uid.
390      * @param name Indicates the obtained formal name.
391      * @return Returns ERR_OK if execute success; returns errCode otherwise.
392      */
GetNameForUid(const int uid,std::string & name)393     virtual ErrCode GetNameForUid(const int uid, std::string &name)
394     {
395         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
396     }
397     /**
398      * @brief Obtains the formal name associated with the given UID.
399      * @param uid Indicates the uid.
400      * @param bundleName Indicates the obtained formal bundleName.
401      * @param name Indicates the obtained appIndex.
402      * @return Returns ERR_OK if execute success; returns errCode otherwise.
403      */
GetNameAndIndexForUid(const int32_t uid,std::string & bundleName,int32_t & appIndex)404     virtual ErrCode GetNameAndIndexForUid(const int32_t uid, std::string &bundleName, int32_t &appIndex)
405     {
406         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
407     }
408     /**
409      * @brief Obtains the appIdentifier and appIndex with the given access tokenId.
410      * @param accessTokenId Indicates the access tokenId of the application.
411      * @param appIdentifier Indicates the app identifier of the application.
412      * @param appIndex Indicates the app index of the application.
413      * @return Returns ERR_OK if execute success; returns errCode otherwise.
414      */
GetAppIdentifierAndAppIndex(const uint32_t accessTokenId,std::string & appIdentifier,int32_t & appIndex)415     virtual ErrCode GetAppIdentifierAndAppIndex(const uint32_t accessTokenId,
416         std::string &appIdentifier, int32_t &appIndex)
417     {
418         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
419     }
420     /**
421      * @brief Obtains the formal name associated with the given UID list.
422      * @param uids Indicates the uid list.
423      * @param simpleAppInfo Indicates all of the obtained SimpleAppInfo objects.
424      * @return Returns ERR_OK if execute success; returns errCode otherwise.
425      */
GetSimpleAppInfoForUid(const std::vector<std::int32_t> & uids,std::vector<SimpleAppInfo> & simpleAppInfo)426     virtual ErrCode GetSimpleAppInfoForUid(
427         const std::vector<std::int32_t> &uids, std::vector<SimpleAppInfo> &simpleAppInfo)
428     {
429         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
430     }
431     /**
432      * @brief Obtains an array of all group IDs associated with a specified bundle.
433      * @param bundleName Indicates the bundle name.
434      * @param gids Indicates the group IDs associated with the specified bundle.
435      * @return Returns true if the gids is successfully obtained; returns false otherwise.
436      */
GetBundleGids(const std::string & bundleName,std::vector<int> & gids)437     virtual bool GetBundleGids(const std::string &bundleName, std::vector<int> &gids)
438     {
439         return false;
440     }
441     /**
442      * @brief Obtains an array of all group IDs associated with the given bundle name and UID.
443      * @param bundleName Indicates the bundle name.
444      * @param uid Indicates the uid.
445      * @param gids Indicates the group IDs associated with the specified bundle.
446      * @return Returns true if the gids is successfully obtained; returns false otherwise.
447      */
GetBundleGidsByUid(const std::string & bundleName,const int & uid,std::vector<int> & gids)448     virtual bool GetBundleGidsByUid(const std::string &bundleName, const int &uid, std::vector<int> &gids)
449     {
450         return false;
451     }
452     /**
453      * @brief Obtains the type of a specified application based on the given bundle name.
454      * @param bundleName Indicates the bundle name.
455      * @return Returns "system" if the bundle is a system application; returns "third-party" otherwise.
456      */
GetAppType(const std::string & bundleName)457     virtual std::string GetAppType(const std::string &bundleName)
458     {
459         return Constants::EMPTY_STRING;
460     }
461     /**
462      * @brief Check whether the app is system app by it's UID.
463      * @param uid Indicates the uid.
464      * @return Returns true if the bundle is a system application; returns false otherwise.
465      */
CheckIsSystemAppByUid(const int uid)466     virtual bool CheckIsSystemAppByUid(const int uid)
467     {
468         return false;
469     }
470     /**
471      * @brief Obtains the BundleInfo of application bundles based on the specified metaData.
472      * @param metaData Indicates the metadata to get in the bundle.
473      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
474      * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise.
475      */
GetBundleInfosByMetaData(const std::string & metaData,std::vector<BundleInfo> & bundleInfos)476     virtual bool GetBundleInfosByMetaData(const std::string &metaData, std::vector<BundleInfo> &bundleInfos)
477     {
478         return false;
479     }
480     /**
481      * @brief Query the AbilityInfo by the given Want.
482      * @param want Indicates the information of the ability.
483      * @param abilityInfo Indicates the obtained AbilityInfo object.
484      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
485      */
QueryAbilityInfo(const Want & want,AbilityInfo & abilityInfo)486     virtual bool QueryAbilityInfo(const Want &want, AbilityInfo &abilityInfo)
487     {
488         return false;
489     }
490     /**
491      * @brief Query the AbilityInfo by the given Want.
492      * @param want Indicates the information of the ability.
493      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
494      * @param userId Indicates the user ID.
495      * @param abilityInfo Indicates the obtained AbilityInfo object.
496      * @param callBack Indicates the callback to be invoked for return ability manager service the operation result.
497      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
498      */
QueryAbilityInfo(const Want & want,int32_t flags,int32_t userId,AbilityInfo & abilityInfo,const sptr<IRemoteObject> & callBack)499     virtual bool QueryAbilityInfo(const Want &want, int32_t flags, int32_t userId, AbilityInfo &abilityInfo,
500         const sptr<IRemoteObject> &callBack)
501     {
502         return false;
503     }
504     /**
505      * @brief Silent install by the given Want.
506      * @param want Indicates the information of the want.
507      * @param userId Indicates the user ID.
508      * @param callBack Indicates the callback to be invoked for return the operation result.
509      * @return Returns true if silent install successfully; returns false otherwise.
510      */
SilentInstall(const Want & want,int32_t userId,const sptr<IRemoteObject> & callBack)511     virtual bool SilentInstall(const Want &want, int32_t userId, const sptr<IRemoteObject> &callBack)
512     {
513         return false;
514     }
515     /**
516      * @brief Upgrade atomic service
517      * @param want Indicates the information of the ability.
518      * @param userId Indicates the user ID.
519      */
UpgradeAtomicService(const Want & want,int32_t userId)520     virtual void UpgradeAtomicService(const Want &want, int32_t userId)
521     {
522         return;
523     }
524     /**
525      * @brief Query the AbilityInfo by the given Want.
526      * @param want Indicates the information of the ability.
527      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
528      * @param userId Indicates the user ID.
529      * @param abilityInfo Indicates the obtained AbilityInfo object.
530      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
531      */
QueryAbilityInfo(const Want & want,int32_t flags,int32_t userId,AbilityInfo & abilityInfo)532     virtual bool QueryAbilityInfo(const Want &want, int32_t flags, int32_t userId, AbilityInfo &abilityInfo)
533     {
534         return false;
535     }
536     /**
537      * @brief Query the AbilityInfo of list by the given Want.
538      * @param want Indicates the information of the ability.
539      * @param abilityInfos Indicates the obtained AbilityInfos object.
540      * @return Returns true if the AbilityInfos is successfully obtained; returns false otherwise.
541      */
QueryAbilityInfos(const Want & want,std::vector<AbilityInfo> & abilityInfos)542     virtual bool QueryAbilityInfos(const Want &want, std::vector<AbilityInfo> &abilityInfos)
543     {
544         return false;
545     }
546     /**
547      * @brief Query the AbilityInfo of list by the given Want.
548      * @param want Indicates the information of the ability.
549      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
550      * @param userId Indicates the user ID.
551      * @param abilityInfos Indicates the obtained AbilityInfos object.
552      * @return Returns true if the AbilityInfos is successfully obtained; returns false otherwise.
553      */
QueryAbilityInfos(const Want & want,int32_t flags,int32_t userId,std::vector<AbilityInfo> & abilityInfos)554     virtual bool QueryAbilityInfos(
555         const Want &want, int32_t flags, int32_t userId, std::vector<AbilityInfo> &abilityInfos)
556     {
557         return false;
558     }
559     /**
560      * @brief Query the AbilityInfo of list by the given Want.
561      * @param want Indicates the information of the ability.
562      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
563      * @param userId Indicates the user ID.
564      * @param abilityInfos Indicates the obtained AbilityInfos object.
565      * @return Returns ERR_OK if the AbilityInfos is successfully obtained; returns errCode otherwise.
566      */
QueryAbilityInfosV9(const Want & want,int32_t flags,int32_t userId,std::vector<AbilityInfo> & abilityInfos)567     virtual ErrCode QueryAbilityInfosV9(
568         const Want &want, int32_t flags, int32_t userId, std::vector<AbilityInfo> &abilityInfos)
569     {
570         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
571     }
572     /**
573      * @brief Get AbilityInfo by the given uri.
574      * @param uri Indicates the uri used for matching ability.
575      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
576      * @param abilityInfos Indicates the obtained AbilityInfos object.
577      * @return Returns ERR_OK if the AbilityInfos is successfully obtained; returns errCode otherwise.
578      */
GetAbilityInfos(const std::string & uri,uint32_t flags,std::vector<AbilityInfo> & abilityInfos)579     virtual ErrCode GetAbilityInfos(
580         const std::string &uri, uint32_t flags, std::vector<AbilityInfo> &abilityInfos)
581     {
582         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
583     }
584     /**
585      * @brief Query the AbilityInfo of list by the given Wants.
586      * @param want Indicates the information of the ability.
587      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
588      * @param userId Indicates the user ID.
589      * @param abilityInfos Indicates the obtained AbilityInfos object.
590      * @return Returns ERR_OK if the AbilityInfos is successfully obtained; returns errCode otherwise.
591      */
BatchQueryAbilityInfos(const std::vector<Want> & wants,int32_t flags,int32_t userId,std::vector<AbilityInfo> & abilityInfos)592     virtual ErrCode BatchQueryAbilityInfos(
593         const std::vector<Want> &wants, int32_t flags, int32_t userId, std::vector<AbilityInfo> &abilityInfos)
594     {
595         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
596     }
597 
QueryLauncherAbilityInfos(const Want & want,int32_t userId,std::vector<AbilityInfo> & abilityInfo)598     virtual ErrCode QueryLauncherAbilityInfos(
599         const Want &want, int32_t userId, std::vector<AbilityInfo> &abilityInfo)
600     {
601         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
602     }
603     /**
604      * @brief Public interface query the AbilityInfo of list by the given Wants.
605      * @param bundleName Indicates the bundle name.
606      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
607      * @param userId Indicates the user ID.
608      * @param abilityInfos Indicates the obtained AbilityInfos object.
609      * @return Returns ERR_OK if the AbilityInfos is successfully obtained; returns errCode otherwise.
610      */
GetLauncherAbilityInfoSync(const std::string & bundleName,int32_t userId,std::vector<AbilityInfo> & abilityInfo)611     virtual ErrCode GetLauncherAbilityInfoSync(
612         const std::string &bundleName, int32_t userId, std::vector<AbilityInfo> &abilityInfo)
613     {
614         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
615     }
616     /**
617      * @brief Query the AllAbilityInfos of list by the given userId.
618      * @param userId Indicates the information of the user.
619      * @param abilityInfos Indicates the obtained AbilityInfos object.
620      * @return Returns true if the AbilityInfos is successfully obtained; returns false otherwise.
621      */
QueryAllAbilityInfos(const Want & want,int32_t userId,std::vector<AbilityInfo> & abilityInfos)622     virtual bool QueryAllAbilityInfos(const Want &want, int32_t userId, std::vector<AbilityInfo> &abilityInfos)
623     {
624         return false;
625     }
626     /**
627      * @brief Query the AbilityInfo by ability.uri in config.json.
628      * @param abilityUri Indicates the uri of the ability.
629      * @param abilityInfo Indicates the obtained AbilityInfo object.
630      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
631      */
QueryAbilityInfoByUri(const std::string & abilityUri,AbilityInfo & abilityInfo)632     virtual bool QueryAbilityInfoByUri(const std::string &abilityUri, AbilityInfo &abilityInfo)
633     {
634         return false;
635     }
636     /**
637      * @brief Query the AbilityInfo by ability.uri in config.json.
638      * @param abilityUri Indicates the uri of the ability.
639      * @param userId Indicates the user ID.
640      * @param abilityInfo Indicates the obtained AbilityInfo object.
641      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
642      */
QueryAbilityInfoByUri(const std::string & abilityUri,int32_t userId,AbilityInfo & abilityInfo)643     virtual bool QueryAbilityInfoByUri(const std::string &abilityUri, int32_t userId, AbilityInfo &abilityInfo)
644     {
645         return true;
646     };
647     /**
648      * @brief Query the AbilityInfo by ability.uri in config.json.
649      * @param abilityUri Indicates the uri of the ability.
650      * @param abilityInfos Indicates the obtained AbilityInfos object.
651      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
652      */
QueryAbilityInfosByUri(const std::string & abilityUri,std::vector<AbilityInfo> & abilityInfos)653     virtual bool QueryAbilityInfosByUri(const std::string &abilityUri, std::vector<AbilityInfo> &abilityInfos)
654     {
655         return false;
656     }
657     /**
658      * @brief Obtains the BundleInfo of all keep-alive applications in the system.
659      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
660      * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise.
661      */
QueryKeepAliveBundleInfos(std::vector<BundleInfo> & bundleInfos)662     virtual bool QueryKeepAliveBundleInfos(std::vector<BundleInfo> &bundleInfos)
663     {
664         return false;
665     }
666     /**
667      * @brief Obtains the label of a specified ability.
668      * @param bundleName Indicates the bundle name.
669      * @param abilityName Indicates the ability name.
670      * @return Returns the label of the ability if exist; returns empty string otherwise.
671      */
GetAbilityLabel(const std::string & bundleName,const std::string & abilityName)672     virtual std::string GetAbilityLabel(const std::string &bundleName, const std::string &abilityName)
673     {
674         return Constants::EMPTY_STRING;
675     }
676     /**
677      * @brief Obtains the label of a specified ability.
678      * @param bundleName Indicates the bundle name.
679      * @param moduleName Indicates the module name.
680      * @param abilityName Indicates the ability name.
681      * @param label Indicates the obtained label.
682      * @return Returns ERR_OK if called successfully; returns error code otherwise.
683      */
GetAbilityLabel(const std::string & bundleName,const std::string & moduleName,const std::string & abilityName,std::string & label)684     virtual ErrCode GetAbilityLabel(const std::string &bundleName, const std::string &moduleName,
685         const std::string &abilityName, std::string &label)
686     {
687         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
688     }
689     /**
690      * @brief Obtains information about an application bundle contained in an ohos Ability Package (HAP).
691      * @param hapFilePath Indicates the absolute file path of the HAP.
692      * @param flag Indicates the information contained in the BundleInfo object to be returned.
693      * @param bundleInfo Indicates the obtained BundleInfo object.
694      * @return Returns true if the BundleInfo is successfully obtained; returns false otherwise.
695      */
GetBundleArchiveInfo(const std::string & hapFilePath,const BundleFlag flag,BundleInfo & bundleInfo)696     virtual bool GetBundleArchiveInfo(
697         const std::string &hapFilePath, const BundleFlag flag, BundleInfo &bundleInfo)
698     {
699         return false;
700     }
701     /**
702      * @brief Obtains information about an application bundle contained in an ohos Ability Package (HAP).
703      * @param hapFilePath Indicates the absolute file path of the HAP.
704      * @param flags Indicates the information contained in the BundleInfo object to be returned.
705      * @param bundleInfo Indicates the obtained BundleInfo object.
706      * @return Returns true if the BundleInfo is successfully obtained; returns false otherwise.
707      */
GetBundleArchiveInfo(const std::string & hapFilePath,int32_t flags,BundleInfo & bundleInfo)708     virtual bool GetBundleArchiveInfo(
709         const std::string &hapFilePath, int32_t flags, BundleInfo &bundleInfo)
710     {
711         return false;
712     }
713     /**
714      * @brief Obtains information about an application bundle contained in an ohos Ability Package (HAP).
715      * @param hapFilePath Indicates the absolute file path of the HAP.
716      * @param flags Indicates the information contained in the BundleInfo object to be returned.
717      * @param bundleInfo Indicates the obtained BundleInfo object.
718      * @return Returns ERR_OK if this function is successfully called; returns errCode otherwise.
719      */
GetBundleArchiveInfoV9(const std::string & hapFilePath,int32_t flags,BundleInfo & bundleInfo)720     virtual ErrCode GetBundleArchiveInfoV9(
721         const std::string &hapFilePath, int32_t flags, BundleInfo &bundleInfo)
722     {
723         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
724     }
725     /**
726      * @brief Obtain the HAP module info of a specific ability.
727      * @param abilityInfo Indicates the ability.
728      * @param hapModuleInfo Indicates the obtained HapModuleInfo object.
729      * @return Returns true if the HapModuleInfo is successfully obtained; returns false otherwise.
730      */
GetHapModuleInfo(const AbilityInfo & abilityInfo,HapModuleInfo & hapModuleInfo)731     virtual bool GetHapModuleInfo(const AbilityInfo &abilityInfo, HapModuleInfo &hapModuleInfo)
732     {
733         return false;
734     }
735     /**
736      * @brief Obtain the HAP module info of a specific ability.
737      * @param abilityInfo Indicates the ability.
738      * @param userId Indicates the userId.
739      * @param hapModuleInfo Indicates the obtained HapModuleInfo object.
740      * @return Returns true if the HapModuleInfo is successfully obtained; returns false otherwise.
741      */
GetHapModuleInfo(const AbilityInfo & abilityInfo,int32_t userId,HapModuleInfo & hapModuleInfo)742     virtual bool GetHapModuleInfo(const AbilityInfo &abilityInfo, int32_t userId, HapModuleInfo &hapModuleInfo)
743     {
744         return false;
745     }
746     /**
747      * @brief Obtains the Want for starting the main ability of an application based on the given bundle name.
748      * @param bundleName Indicates the bundle name.
749      * @param want Indicates the obtained launch Want object.
750      * @param userId Indicates the userId.
751      * @return Returns ERR_OK if this function is successfully called; returns errCode otherwise.
752      */
753     virtual ErrCode GetLaunchWantForBundle(
754         const std::string &bundleName, Want &want, int32_t userId = Constants::UNSPECIFIED_USERID)
755     {
756         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
757     }
758     /**
759      * @brief Obtains detailed information about a specified permission.
760      * @param permissionName Indicates the name of the ohos permission.
761      * @param permissionDef Indicates the object containing detailed information about the given ohos permission.
762      * @return Returns ERR_OK if the PermissionDef object is successfully obtained; returns other ErrCode otherwise.
763      */
GetPermissionDef(const std::string & permissionName,PermissionDef & permissionDef)764     virtual ErrCode GetPermissionDef(const std::string &permissionName, PermissionDef &permissionDef)
765     {
766         return ERR_OK;
767     }
768     /**
769      * @brief Clears cache data of a specified application.
770      * @param bundleName Indicates the bundle name of the application whose cache data is to be cleared.
771      * @param cleanCacheCallback Indicates the callback to be invoked for returning the operation result.
772      * @param userId description the user id.
773      * @param appIndex Indicates the app index.
774      * @return Returns ERR_OK if this function is successfully called; returns other ErrCode otherwise.
775      */
776     virtual ErrCode CleanBundleCacheFiles(
777         const std::string &bundleName, const sptr<ICleanCacheCallback> cleanCacheCallback,
778         int32_t userId = Constants::UNSPECIFIED_USERID, int32_t appIndex = 0)
779     {
780         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
781     }
782     /**
783      * @brief Clears cache data of a specified size.
784      * @param cacheSize Indicates the size of the cache data is to be cleared.
785      * @return Returns ERR_OK if this function is successfully called; returns other ErrCode otherwise.
786      */
CleanBundleCacheFilesAutomatic(uint64_t cacheSize)787     virtual ErrCode CleanBundleCacheFilesAutomatic(uint64_t cacheSize)
788     {
789         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
790     }
791     /**
792      * @brief Clears application running data of a specified application.
793      * @param bundleName Indicates the bundle name of the application whose data is to be cleared.
794      * @param userId Indicates the user id.
795      * @param appIndex Indicates the app index.
796      * @return Returns true if the data cleared successfully; returns false otherwise.
797      */
798     virtual bool CleanBundleDataFiles(const std::string &bundleName,
799         const int userId = 0, const int appIndex = 0, const int callerUid = -1)
800     {
801         return false;
802     }
803     /**
804      * @brief Register the specific bundle status callback.
805      * @param bundleStatusCallback Indicates the callback to be invoked for returning the bundle status changed result.
806      * @return Returns true if this function is successfully called; returns false otherwise.
807      */
RegisterBundleStatusCallback(const sptr<IBundleStatusCallback> & bundleStatusCallback)808     virtual bool RegisterBundleStatusCallback(const sptr<IBundleStatusCallback> &bundleStatusCallback)
809     {
810         return false;
811     }
812 
RegisterBundleEventCallback(const sptr<IBundleEventCallback> & bundleEventCallback)813     virtual bool RegisterBundleEventCallback(const sptr<IBundleEventCallback> &bundleEventCallback)
814     {
815         return false;
816     }
817 
UnregisterBundleEventCallback(const sptr<IBundleEventCallback> & bundleEventCallback)818     virtual bool UnregisterBundleEventCallback(const sptr<IBundleEventCallback> &bundleEventCallback)
819     {
820         return false;
821     }
822     /**
823      * @brief Clear the specific bundle status callback.
824      * @param bundleStatusCallback Indicates the callback to be cleared.
825      * @return Returns true if this function is successfully called; returns false otherwise.
826      */
ClearBundleStatusCallback(const sptr<IBundleStatusCallback> & bundleStatusCallback)827     virtual bool ClearBundleStatusCallback(const sptr<IBundleStatusCallback> &bundleStatusCallback)
828     {
829         return false;
830     }
831     /**
832      * @brief Unregister all the callbacks of status changed.
833      * @return Returns true if this function is successfully called; returns false otherwise.
834      */
UnregisterBundleStatusCallback()835     virtual bool UnregisterBundleStatusCallback()
836     {
837         return false;
838     }
839 
840     /**
841      * @brief Obtains the value of isRemovable based on a given bundle name and module name.
842      * @param bundleName Indicates the bundle name to be queried.
843      * @param moduleName Indicates the module name to be queried.
844      * @param isRemovable Indicates the module whether is removable.
845      * @return Returns ERR_OK if the isRemovable is successfully obtained; returns other ErrCode otherwise.
846      */
IsModuleRemovable(const std::string & bundleName,const std::string & moduleName,bool & isRemovable)847     virtual ErrCode IsModuleRemovable(const std::string &bundleName, const std::string &moduleName, bool &isRemovable)
848     {
849         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
850     }
851     /**
852      * @brief Sets whether to enable isRemovable based on a given bundle name and module name.
853      * @param bundleName Indicates the bundle name to be queried.
854      * @param moduleName Indicates the module name to be queried.
855      * @param isEnable Specifies whether to enable the isRemovable of InnerModuleInfo.
856      *                 The value true means to enable it, and the value false means to disable it
857      * @return Returns true if the isRemovable is successfully obtained; returns false otherwise.
858      */
SetModuleRemovable(const std::string & bundleName,const std::string & moduleName,bool isEnable)859     virtual bool SetModuleRemovable(
860         const std::string &bundleName, const std::string &moduleName, bool isEnable)
861     {
862         return false;
863     }
864 
865     /**
866      * @brief Dump the bundle informations with specific flags.
867      * @param flag Indicates the information contained in the dump result.
868      * @param bundleName Indicates the bundle name if needed.
869      * @param userId Indicates the user ID.
870      * @param result Indicates the dump information result.
871      * @return Returns true if the dump result is successfully obtained; returns false otherwise.
872      */
DumpInfos(const DumpFlag flag,const std::string & bundleName,int32_t userId,std::string & result)873     virtual bool DumpInfos(
874         const DumpFlag flag, const std::string &bundleName, int32_t userId, std::string &result)
875     {
876         return false;
877     }
878     /**
879      * @brief Compile the bundle informations with specific flags.
880      * @param bundleName Indicates the bundle name if needed.
881      * @param compileMode Indicates the mode name.
882      * @param isAllBundle Does it represent all bundlenames.
883      * @return Returns true if the compile result is successfully obtained; returns false otherwise.
884      */
CompileProcessAOT(const std::string & bundleName,const std::string & compileMode,bool isAllBundle,std::vector<std::string> & compileResults)885     virtual ErrCode CompileProcessAOT(const std::string &bundleName, const std::string &compileMode,
886         bool isAllBundle, std::vector<std::string> &compileResults)
887     {
888         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
889     }
890     /**
891      * @brief Reset the bundle informations with specific flags.
892      * @param bundleName Indicates the bundle name if needed.
893      * @param isAllBundle Does it represent all bundlenames.
894      * @return Returns true if the reset result is successfully obtained; returns false otherwise.
895      */
CompileReset(const std::string & bundleName,bool isAllBundle)896     virtual ErrCode CompileReset(const std::string &bundleName, bool isAllBundle)
897     {
898         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
899     }
900     /**
901      * @brief Reset the bundle informations.
902      * @return Returns true if the reset result is successfully obtained; returns false otherwise.
903      */
ResetAllAOT()904     virtual ErrCode ResetAllAOT()
905     {
906         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
907     }
908     /**
909      * @brief copy ap file to /data/local/pgo
910      * @param bundleName Indicates the bundle name if needed.
911      * @param isAllBundle Does it represent all bundlenames.
912      * @param results Indicates the copy ap information result.
913      * @return Returns ERR_OK if called successfully; returns error code otherwise.
914      */
CopyAp(const std::string & bundleName,bool isAllBundle,std::vector<std::string> & results)915     virtual ErrCode CopyAp(const std::string &bundleName, bool isAllBundle, std::vector<std::string> &results)
916     {
917         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
918     }
919     /**
920      * @brief Checks whether a specified application is enabled.
921      * @param bundleName Indicates the bundle name of the application.
922      * @param isEnable Indicates the application status is enabled.
923      * @return Returns result of the operation.
924      */
IsApplicationEnabled(const std::string & bundleName,bool & isEnable)925     virtual ErrCode IsApplicationEnabled(const std::string &bundleName, bool &isEnable)
926     {
927         return ERR_OK;
928     }
929     /**
930      * @brief Checks whether a specified clone application is enabled.
931      * @param bundleName Indicates the bundle name of the application.
932      * @param appIndex Indicates the app index of clone applications.
933      * @param isEnable Indicates the application status is enabled.
934      * @return Returns result of the operation.
935      */
IsCloneApplicationEnabled(const std::string & bundleName,int32_t appIndex,bool & isEnable)936     virtual ErrCode IsCloneApplicationEnabled(const std::string &bundleName, int32_t appIndex, bool &isEnable)
937     {
938         return ERR_OK;
939     }
940     /**
941      * @brief Sets whether to enable a specified application.
942      * @param bundleName Indicates the bundle name of the application.
943      * @param isEnable Specifies whether to enable the application.
944      *                 The value true means to enable it, and the value false means to disable it.
945      * @param userId description the user id.
946      * @return Returns result of the operation.
947      */
948     virtual ErrCode SetApplicationEnabled(const std::string &bundleName, bool isEnable,
949         int32_t userId = Constants::UNSPECIFIED_USERID)
950     {
951         return ERR_OK;
952     }
953     /**
954      * @brief Sets whether to enable a specified clone application.
955      * @param bundleName Indicates the bundle name of the application.
956      * @param appIndex Indicates the app index of clone applications.
957      * @param isEnable Specifies whether to enable the application.
958      *                 The value true means to enable it, and the value false means to disable it.
959      * @param userId description the user id.
960      * @return Returns result of the operation.
961      */
962     virtual ErrCode SetCloneApplicationEnabled(const std::string &bundleName, int32_t appIndex, bool isEnable,
963         int32_t userId = Constants::UNSPECIFIED_USERID)
964     {
965         return ERR_OK;
966     }
967     /**
968      * @brief Sets whether to enable a specified ability.
969      * @param abilityInfo Indicates information about the ability to check.
970      * @param isEnable Indicates the ability status is enabled.
971      * @return Returns result of the operation.
972      */
IsAbilityEnabled(const AbilityInfo & abilityInfo,bool & isEnable)973     virtual ErrCode IsAbilityEnabled(const AbilityInfo &abilityInfo, bool &isEnable)
974     {
975         return ERR_OK;
976     }
977     /**
978      * @brief Sets whether to enable a specified ability.
979      * @param abilityInfo Indicates information about the ability to check.
980      * @param appIndex Indicates the app index of clone applications.
981      * @param isEnable Indicates the ability status is enabled.
982      * @return Returns result of the operation.
983      */
IsCloneAbilityEnabled(const AbilityInfo & abilityInfo,int32_t appIndex,bool & isEnable)984     virtual ErrCode IsCloneAbilityEnabled(const AbilityInfo &abilityInfo, int32_t appIndex, bool &isEnable)
985     {
986         return ERR_OK;
987     }
988     /**
989      * @brief Sets whether to enable a specified ability.
990      * @param abilityInfo Indicates information about the ability.
991      * @param isEnabled Specifies whether to enable the ability.
992      *                 The value true means to enable it, and the value false means to disable it.
993      * @param userId description the user id.
994      * @return Returns result of the operation.
995      */
996     virtual ErrCode SetAbilityEnabled(const AbilityInfo &abilityInfo, bool isEnabled,
997         int32_t userId = Constants::UNSPECIFIED_USERID)
998     {
999         return ERR_OK;
1000     }
1001     /**
1002      * @brief Sets whether to enable a specified ability.
1003      * @param abilityInfo Indicates information about the ability.
1004      * @param appIndex Indicates the app index of clone applications.
1005      * @param isEnabled Specifies whether to enable the ability.
1006      *                 The value true means to enable it, and the value false means to disable it.
1007      * @param userId description the user id.
1008      * @return Returns result of the operation.
1009      */
1010     virtual ErrCode SetCloneAbilityEnabled(const AbilityInfo &abilityInfo, int32_t appIndex, bool isEnabled,
1011         int32_t userId = Constants::UNSPECIFIED_USERID)
1012     {
1013         return ERR_OK;
1014     }
1015     /**
1016      * @brief Obtains the FormInfo objects provided by all applications on the device.
1017      * @param formInfo list of FormInfo objects if obtained; returns an empty List if no FormInfo is available on the
1018      * device.
1019      * @return Returns true if this function is successfully called; returns false otherwise.
1020      */
GetAllFormsInfo(std::vector<FormInfo> & formInfos)1021     virtual bool GetAllFormsInfo(std::vector<FormInfo> &formInfos)
1022     {
1023         return false;
1024     }
1025     /**
1026      * @brief Obtains the FormInfo objects provided by a specified application on the device.
1027      * @param bundleName Indicates the bundle name of the application.
1028      * @param formInfo list of FormInfo objects if obtained; returns an empty List if no FormInfo is available on the
1029      * device.
1030      * @return Returns true if this function is successfully called; returns false otherwise.
1031      */
GetFormsInfoByApp(const std::string & bundleName,std::vector<FormInfo> & formInfos)1032     virtual bool GetFormsInfoByApp(const std::string &bundleName, std::vector<FormInfo> &formInfos)
1033     {
1034         return false;
1035     }
1036     /**
1037      * @brief Obtains the FormInfo objects provided by a specified.
1038      * @param formInfo list of FormInfo objects if obtained; returns an empty List if no FormInfo is available on the
1039      * device.
1040      * @param moduleName Indicates the module name of the application.
1041      * @param bundleName Indicates the bundle name of the application.
1042      * @return Returns true if this function is successfully called; returns false otherwise.
1043      */
GetFormsInfoByModule(const std::string & bundleName,const std::string & moduleName,std::vector<FormInfo> & formInfos)1044     virtual bool GetFormsInfoByModule(
1045         const std::string &bundleName, const std::string &moduleName, std::vector<FormInfo> &formInfos)
1046     {
1047         return false;
1048     }
1049     /**
1050      * @brief Obtains the ShortcutInfo objects provided by a specified application on the device.
1051      * @param bundleName Indicates the bundle name of the application.
1052      * @param shortcutInfos List of ShortcutInfo objects if obtained.
1053      * @return Returns true if this function is successfully called; returns false otherwise.
1054      */
GetShortcutInfos(const std::string & bundleName,std::vector<ShortcutInfo> & shortcutInfos)1055     virtual bool GetShortcutInfos(const std::string &bundleName, std::vector<ShortcutInfo> &shortcutInfos)
1056     {
1057         return false;
1058     }
1059 
1060     virtual ErrCode GetShortcutInfoV9(const std::string &bundleName,
1061         std::vector<ShortcutInfo> &shortcutInfos, int32_t userId = Constants::UNSPECIFIED_USERID)
1062     {
1063         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1064     }
1065 
GetShortcutInfoByAppIndex(const std::string & bundleName,const int32_t appIndex,std::vector<ShortcutInfo> & shortcutInfos)1066     virtual ErrCode GetShortcutInfoByAppIndex(const std::string &bundleName, const int32_t appIndex,
1067         std::vector<ShortcutInfo> &shortcutInfos)
1068     {
1069         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1070     }
1071 
1072     /**
1073      * @brief Obtains the CommonEventInfo objects provided by an event key on the device.
1074      * @param eventKey Indicates the event of the subscribe.
1075      * @param commonEventInfos List of CommonEventInfo objects if obtained.
1076      * @return Returns true if this function is successfully called; returns false otherwise.
1077      */
GetAllCommonEventInfo(const std::string & eventKey,std::vector<CommonEventInfo> & commonEventInfos)1078     virtual bool GetAllCommonEventInfo(const std::string &eventKey, std::vector<CommonEventInfo> &commonEventInfos)
1079     {
1080         return false;
1081     }
1082     /**
1083      * @brief Obtains the interface used to install and uninstall bundles.
1084      * @return Returns a pointer to IBundleInstaller class if exist; returns nullptr otherwise.
1085      */
GetBundleInstaller()1086     virtual sptr<IBundleInstaller> GetBundleInstaller()
1087     {
1088         return nullptr;
1089     }
1090     /**
1091      * @brief Obtains the interface used to create or delete user.
1092      * @return Returns a pointer to IBundleUserMgr class if exist; returns nullptr otherwise.
1093      */
GetBundleUserMgr()1094     virtual sptr<IBundleUserMgr> GetBundleUserMgr()
1095     {
1096         return nullptr;
1097     }
1098     /**
1099      * @brief Obtains the VerifyManager.
1100      * @return Returns a pointer to VerifyManager class if exist; returns nullptr otherwise.
1101      */
GetVerifyManager()1102     virtual sptr<IVerifyManager> GetVerifyManager()
1103     {
1104         return nullptr;
1105     }
1106     /**
1107      * @brief Obtains the DistributedBundleInfo based on a given bundle name and networkId.
1108      * @param networkId Indicates the networkId of remote device.
1109      * @param bundleName Indicates the application bundle name to be queried.
1110      * @param distributedBundleInfo Indicates the obtained DistributedBundleInfo object.
1111      * @return Returns true if the DistributedBundleInfo is successfully obtained; returns false otherwise.
1112      */
GetDistributedBundleInfo(const std::string & networkId,const std::string & bundleName,DistributedBundleInfo & distributedBundleInfo)1113     virtual bool GetDistributedBundleInfo(const std::string &networkId, const std::string &bundleName,
1114         DistributedBundleInfo &distributedBundleInfo)
1115     {
1116         return false;
1117     }
1118     /**
1119      * @brief Get app privilege level.
1120      * @param bundleName Indicates the bundle name of the app privilege level.
1121      * @param userId Indicates the user id.
1122      * @return Returns app privilege level.
1123      */
1124     virtual std::string GetAppPrivilegeLevel(
1125         const std::string &bundleName, int32_t userId = Constants::UNSPECIFIED_USERID)
1126     {
1127         return Constants::EMPTY_STRING;
1128     }
1129     /**
1130      * @brief Query extension info.
1131      * @param Want Indicates the information of extension info.
1132      * @param flag Indicates the query flag which will fliter any specified stuff in the extension info.
1133      * @param userId Indicates the userId in the system.
1134      * @param extensionInfos Indicates the obtained extensions.
1135      * @return Returns true if this function is successfully called; returns false otherwise.
1136      */
QueryExtensionAbilityInfos(const Want & want,const int32_t & flag,const int32_t & userId,std::vector<ExtensionAbilityInfo> & extensionInfos)1137     virtual bool QueryExtensionAbilityInfos(const Want &want, const int32_t &flag, const int32_t &userId,
1138         std::vector<ExtensionAbilityInfo> &extensionInfos)
1139     {
1140         return true;
1141     }
1142     /**
1143      * @brief Query extension info.
1144      * @param Want Indicates the information of extension info.
1145      * @param flags Indicates the query flag which will filter any specified stuff in the extension info.
1146      * @param userId Indicates the userId in the system.
1147      * @param extensionInfos Indicates the obtained extensions.
1148      * @return Returns ERR_OK if this function is successfully called; returns errCode otherwise.
1149      */
QueryExtensionAbilityInfosV9(const Want & want,int32_t flags,int32_t userId,std::vector<ExtensionAbilityInfo> & extensionInfos)1150     virtual ErrCode QueryExtensionAbilityInfosV9(const Want &want, int32_t flags, int32_t userId,
1151         std::vector<ExtensionAbilityInfo> &extensionInfos)
1152     {
1153         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
1154     }
1155     /**
1156      * @brief Query extension info.
1157      * @param Want Indicates the information of extension info.
1158      * @param extensionType Indicates the type of the extension.
1159      * @param flag Indicates the query flag which will fliter any specified stuff in the extension info.
1160      * @param userId Indicates the userId in the system.
1161      * @param extensionInfos Indicates the obtained extensions.
1162      * @return Returns true if this function is successfully called; returns false otherwise.
1163      */
QueryExtensionAbilityInfos(const Want & want,const ExtensionAbilityType & extensionType,const int32_t & flag,const int32_t & userId,std::vector<ExtensionAbilityInfo> & extensionInfos)1164     virtual bool QueryExtensionAbilityInfos(const Want &want, const ExtensionAbilityType &extensionType,
1165         const int32_t &flag, const int32_t &userId, std::vector<ExtensionAbilityInfo> &extensionInfos)
1166     {
1167         return true;
1168     }
1169     /**
1170      * @brief Query extension info.
1171      * @param Want Indicates the information of extension info.
1172      * @param extensionType Indicates the type of the extension.
1173      * @param flags Indicates the query flag which will filter any specified stuff in the extension info.
1174      * @param userId Indicates the userId in the system.
1175      * @param extensionInfos Indicates the obtained extensions.
1176      * @return Returns ERR_OK if this function is successfully called; returns errCode otherwise.
1177      */
QueryExtensionAbilityInfosV9(const Want & want,const ExtensionAbilityType & extensionType,int32_t flags,int32_t userId,std::vector<ExtensionAbilityInfo> & extensionInfos)1178     virtual ErrCode QueryExtensionAbilityInfosV9(const Want &want, const ExtensionAbilityType &extensionType,
1179         int32_t flags, int32_t userId, std::vector<ExtensionAbilityInfo> &extensionInfos)
1180     {
1181         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
1182     }
QueryExtensionAbilityInfos(const ExtensionAbilityType & extensionType,const int32_t & userId,std::vector<ExtensionAbilityInfo> & extensionInfos)1183     virtual bool QueryExtensionAbilityInfos(const ExtensionAbilityType &extensionType, const int32_t &userId,
1184         std::vector<ExtensionAbilityInfo> &extensionInfos)
1185     {
1186         return true;
1187     }
1188 
VerifyCallingPermission(const std::string & permission)1189     virtual bool VerifyCallingPermission(const std::string &permission)
1190     {
1191         return true;
1192     }
1193 
1194     /**
1195      * @brief Verify whether the calling app is system app. Only for BMS usage.
1196      *
1197      * @param beginApiVersion Indicates version since this api became to be system api.
1198      * @param bundleName Indicates bundle name of the calling hap.
1199      * @return Returns true if the hap passes the verification; returns false otherwise.
1200      */
1201     virtual bool VerifySystemApi(int32_t beginApiVersion = Constants::INVALID_API_VERSION)
1202     {
1203         return true;
1204     }
1205 
1206     /**
1207      * @brief Obtains the dependent module names.
1208      *
1209      * @param bundleName Indicates the bundle name to be queried.
1210      * @param moduleName Indicates the module name to be queried.
1211      * @param dependentModuleNames Indicates the obtained dependent module names.
1212      * @return Returns true if this function is successfully called; returns false otherwise.
1213      */
GetAllDependentModuleNames(const std::string & bundleName,const std::string & moduleName,std::vector<std::string> & dependentModuleNames)1214     virtual bool GetAllDependentModuleNames(const std::string &bundleName, const std::string &moduleName,
1215         std::vector<std::string> &dependentModuleNames)
1216     {
1217         return false;
1218     }
1219 
QueryExtensionAbilityInfoByUri(const std::string & uri,int32_t userId,ExtensionAbilityInfo & extensionAbilityInfo)1220     virtual bool QueryExtensionAbilityInfoByUri(const std::string &uri, int32_t userId,
1221         ExtensionAbilityInfo &extensionAbilityInfo)
1222     {
1223         return false;
1224     }
1225 
ImplicitQueryInfoByPriority(const Want & want,int32_t flags,int32_t userId,AbilityInfo & abilityInfo,ExtensionAbilityInfo & extensionInfo)1226     virtual bool ImplicitQueryInfoByPriority(const Want &want, int32_t flags, int32_t userId,
1227         AbilityInfo &abilityInfo, ExtensionAbilityInfo &extensionInfo)
1228     {
1229         return false;
1230     }
1231 
ImplicitQueryInfos(const Want & want,int32_t flags,int32_t userId,bool withDefault,std::vector<AbilityInfo> & abilityInfos,std::vector<ExtensionAbilityInfo> & extensionInfos,bool & findDefaultApp)1232     virtual bool ImplicitQueryInfos(const Want &want, int32_t flags, int32_t userId, bool withDefault,
1233         std::vector<AbilityInfo> &abilityInfos, std::vector<ExtensionAbilityInfo> &extensionInfos,
1234         bool &findDefaultApp)
1235     {
1236         return false;
1237     }
1238 
1239     /**
1240      * @brief Obtains the AbilityInfo based on a given bundle name.
1241      * @param bundleName Indicates the bundle name to be queried.
1242      * @param abilityName Indicates the ability name to be queried.
1243      * @param abilityInfo Indicates the obtained AbilityInfo object.
1244      * @return Returns true if the abilityInfo is successfully obtained; returns false otherwise.
1245      */
GetAbilityInfo(const std::string & bundleName,const std::string & abilityName,AbilityInfo & abilityInfo)1246     virtual bool GetAbilityInfo(
1247         const std::string &bundleName, const std::string &abilityName, AbilityInfo &abilityInfo)
1248     {
1249         return false;
1250     }
1251     /**
1252      * @brief Obtains the AbilityInfo based on a given bundle name.
1253      * @param bundleName Indicates the bundle name to be queried.
1254      * @param moduleName Indicates the module name to be queried.
1255      * @param abilityName Indicates the ability name to be queried.
1256      * @param abilityInfo Indicates the obtained AbilityInfo object.
1257      * @return Returns true if the abilityInfo is successfully obtained; returns false otherwise.
1258      */
GetAbilityInfo(const std::string & bundleName,const std::string & moduleName,const std::string & abilityName,AbilityInfo & abilityInfo)1259     virtual bool GetAbilityInfo(
1260         const std::string &bundleName, const std::string &moduleName,
1261         const std::string &abilityName, AbilityInfo &abilityInfo)
1262     {
1263         return false;
1264     }
1265     /**
1266      * @brief Obtain sandbox application bundleInfo.
1267      * @param bundleName Indicates the bundle name of the sandbox application to be install.
1268      * @param appIndex Indicates application index of the sandbox application.
1269      * @param userId Indicates the sandbox application is installed under which user id.
1270      * @return Returns ERR_OK if the get sandbox application budnelInfo successfully; returns errcode otherwise.
1271      */
GetSandboxBundleInfo(const std::string & bundleName,int32_t appIndex,int32_t userId,BundleInfo & info)1272     virtual ErrCode GetSandboxBundleInfo(
1273         const std::string &bundleName, int32_t appIndex, int32_t userId, BundleInfo &info)
1274     {
1275         return ERR_APPEXECFWK_SANDBOX_INSTALL_INTERNAL_ERROR;
1276     }
1277 
1278     /**
1279      * @brief Obtains sandbox data directory by bundleName and appIndex.
1280      * @param bundleName Indicates the bundle name of the sandbox application to be install.
1281      * @param appIndex Indicates application index of the sandbox application.
1282      * @return Returns ERR_OK if the get sandbox data dir successfully; returns errcode otherwise.
1283      */
GetSandboxDataDir(const std::string & bundleName,int32_t appIndex,std::string & sandboxDataDir)1284     virtual ErrCode GetSandboxDataDir(const std::string &bundleName, int32_t appIndex, std::string &sandboxDataDir)
1285     {
1286         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
1287     }
1288 
1289     /**
1290      * @brief Obtains the value of upgradeFlag based on a given bundle name and module name.
1291      * @param bundleName Indicates the bundle name to be queried.
1292      * @param moduleName Indicates the module name to be queried.
1293      * @return Returns true if the isRemovable is successfully obtained; returns false otherwise.
1294      */
GetModuleUpgradeFlag(const std::string & bundleName,const std::string & moduleName)1295     virtual bool GetModuleUpgradeFlag(const std::string &bundleName, const std::string &moduleName)
1296     {
1297         return false;
1298     }
1299     /**
1300      * @brief Sets whether to enable upgradeFlag based on a given bundle name and module name.
1301      * @param bundleName Indicates the bundle name to be queried.
1302      * @param moduleName Indicates the module name to be queried.
1303      * @param isEnable Specifies whether to enable the isRemovable of InnerModuleInfo.
1304      *                 The value true means to enable it, and the value false means to disable it
1305      * @return Returns ERR_OK if the isRemovable is successfully obtained; returns ErrCode otherwise.
1306      */
SetModuleUpgradeFlag(const std::string & bundleName,const std::string & moduleName,int32_t upgradeFlag)1307     virtual ErrCode SetModuleUpgradeFlag(
1308         const std::string &bundleName, const std::string &moduleName, int32_t upgradeFlag)
1309     {
1310         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1311     }
1312 
CheckAbilityEnableInstall(const Want & want,int32_t missionId,int32_t userId,const sptr<IRemoteObject> & callback)1313     virtual bool CheckAbilityEnableInstall(
1314         const Want &want, int32_t missionId, int32_t userId, const sptr<IRemoteObject> &callback)
1315     {
1316         return false;
1317     }
1318 
ObtainCallingBundleName(std::string & bundleName)1319     virtual bool ObtainCallingBundleName(std::string &bundleName)
1320     {
1321         return false;
1322     }
1323 
GetDefaultAppProxy()1324     virtual sptr<IDefaultApp> GetDefaultAppProxy()
1325     {
1326         return nullptr;
1327     }
1328 
GetAppControlProxy()1329     virtual sptr<IAppControlMgr> GetAppControlProxy()
1330     {
1331         return nullptr;
1332     }
1333 
GetBundleMgrExtProxy()1334     virtual sptr<IBundleMgrExt> GetBundleMgrExtProxy()
1335     {
1336         return nullptr;
1337     }
1338 
1339     virtual bool GetBundleStats(const std::string &bundleName, int32_t userId, std::vector<int64_t> &bundleStats,
1340         int32_t appIndex = 0, uint32_t statFlag = 0)
1341     {
1342         return false;
1343     }
1344 
BatchGetBundleStats(const std::vector<std::string> & bundleNames,int32_t userId,std::vector<BundleStorageStats> & bundleStats)1345     virtual ErrCode BatchGetBundleStats(const std::vector<std::string> &bundleNames, int32_t userId,
1346         std::vector<BundleStorageStats> &bundleStats)
1347     {
1348         return ERR_OK;
1349     }
1350 
GetAllBundleStats(int32_t userId,std::vector<int64_t> & bundleStats)1351     virtual bool GetAllBundleStats(int32_t userId, std::vector<int64_t> &bundleStats)
1352     {
1353         return false;
1354     }
1355 
GetAllBundleCacheStat(const sptr<IProcessCacheCallback> processCacheCallback)1356     virtual ErrCode GetAllBundleCacheStat(const sptr<IProcessCacheCallback> processCacheCallback)
1357     {
1358         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1359     }
1360 
CleanAllBundleCache(const sptr<IProcessCacheCallback> processCacheCallback)1361     virtual ErrCode CleanAllBundleCache(const sptr<IProcessCacheCallback> processCacheCallback)
1362     {
1363         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1364     }
1365 
GetExtendResourceManager()1366     virtual sptr<IExtendResourceManager> GetExtendResourceManager()
1367     {
1368         return nullptr;
1369     }
1370 
GetSandboxAbilityInfo(const Want & want,int32_t appIndex,int32_t flags,int32_t userId,AbilityInfo & info)1371     virtual ErrCode GetSandboxAbilityInfo(const Want &want, int32_t appIndex, int32_t flags, int32_t userId,
1372         AbilityInfo &info)
1373     {
1374         return ERR_APPEXECFWK_SANDBOX_QUERY_PARAM_ERROR;
1375     }
1376 
GetSandboxExtAbilityInfos(const Want & want,int32_t appIndex,int32_t flags,int32_t userId,std::vector<ExtensionAbilityInfo> & einfos)1377     virtual ErrCode GetSandboxExtAbilityInfos(const Want &want, int32_t appIndex, int32_t flags, int32_t userId,
1378         std::vector<ExtensionAbilityInfo> &einfos)
1379     {
1380         return ERR_APPEXECFWK_SANDBOX_QUERY_PARAM_ERROR;
1381     }
1382 
GetSandboxHapModuleInfo(const AbilityInfo & abilityInfo,int32_t appIndex,int32_t userId,HapModuleInfo & info)1383     virtual ErrCode GetSandboxHapModuleInfo(const AbilityInfo &abilityInfo, int32_t appIndex, int32_t userId,
1384         HapModuleInfo &info)
1385     {
1386         return ERR_APPEXECFWK_SANDBOX_QUERY_PARAM_ERROR;
1387     }
1388 
1389     virtual ErrCode GetMediaData(const std::string &bundleName, const std::string &moduleName,
1390         const std::string &abilityName, std::unique_ptr<uint8_t[]> &mediaDataPtr, size_t &len,
1391         int32_t userId = Constants::UNSPECIFIED_USERID)
1392     {
1393         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1394     }
1395 
GetQuickFixManagerProxy()1396     virtual sptr<IQuickFixManager> GetQuickFixManagerProxy()
1397     {
1398         return nullptr;
1399     }
1400 
1401     virtual std::string GetStringById(const std::string &bundleName, const std::string &moduleName, uint32_t resId,
1402         int32_t userId, const std::string &localeInfo = Constants::EMPTY_STRING)
1403     {
1404         return Constants::EMPTY_STRING;
1405     }
1406 
GetIconById(const std::string & bundleName,const std::string & moduleName,uint32_t resId,uint32_t density,int32_t userId)1407     virtual std::string GetIconById(
1408         const std::string &bundleName, const std::string &moduleName, uint32_t resId, uint32_t density, int32_t userId)
1409     {
1410         return Constants::EMPTY_STRING;
1411     }
1412 
SetDebugMode(bool isDebug)1413     virtual ErrCode SetDebugMode(bool isDebug)
1414     {
1415         return ERR_BUNDLEMANAGER_SET_DEBUG_MODE_INTERNAL_ERROR;
1416     }
1417 
GetOverlayManagerProxy()1418     virtual sptr<IOverlayManager> GetOverlayManagerProxy()
1419     {
1420         return nullptr;
1421     }
1422 
ProcessPreload(const Want & want)1423     virtual bool ProcessPreload(const Want &want)
1424     {
1425         return false;
1426     }
1427 
GetAppProvisionInfo(const std::string & bundleName,int32_t userId,AppProvisionInfo & appProvisionInfo)1428     virtual ErrCode GetAppProvisionInfo(const std::string &bundleName, int32_t userId,
1429         AppProvisionInfo &appProvisionInfo)
1430     {
1431         return ERR_OK;
1432     }
1433 
GetProvisionMetadata(const std::string & bundleName,int32_t userId,std::vector<Metadata> & provisionMetadatas)1434     virtual ErrCode GetProvisionMetadata(const std::string &bundleName, int32_t userId,
1435         std::vector<Metadata> &provisionMetadatas)
1436     {
1437         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1438     }
1439 
1440     virtual ErrCode GetBaseSharedBundleInfos(const std::string &bundleName,
1441         std::vector<BaseSharedBundleInfo> &baseSharedBundleInfos,
1442         GetDependentBundleInfoFlag flag = GetDependentBundleInfoFlag::GET_APP_CROSS_HSP_BUNDLE_INFO)
1443     {
1444         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1445     }
1446 
GetAllSharedBundleInfo(std::vector<SharedBundleInfo> & sharedBundles)1447     virtual ErrCode GetAllSharedBundleInfo(std::vector<SharedBundleInfo> &sharedBundles)
1448     {
1449         return ERR_OK;
1450     }
1451 
GetSharedBundleInfo(const std::string & bundleName,const std::string & moduleName,std::vector<SharedBundleInfo> & sharedBundles)1452     virtual ErrCode GetSharedBundleInfo(const std::string &bundleName, const std::string &moduleName,
1453         std::vector<SharedBundleInfo> &sharedBundles)
1454     {
1455         return ERR_OK;
1456     }
1457 
GetSharedBundleInfoBySelf(const std::string & bundleName,SharedBundleInfo & sharedBundleInfo)1458     virtual ErrCode GetSharedBundleInfoBySelf(const std::string &bundleName, SharedBundleInfo &sharedBundleInfo)
1459     {
1460         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1461     }
1462 
GetSharedDependencies(const std::string & bundleName,const std::string & moduleName,std::vector<Dependency> & dependencies)1463     virtual ErrCode GetSharedDependencies(const std::string &bundleName, const std::string &moduleName,
1464         std::vector<Dependency> &dependencies)
1465     {
1466         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1467     }
1468 
1469     virtual ErrCode GetAllProxyDataInfos(
1470         std::vector<ProxyData> &proxyDatas, int32_t userId = Constants::UNSPECIFIED_USERID)
1471     {
1472         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1473     }
1474 
1475     virtual ErrCode GetProxyDataInfos(const std::string &bundleName, const std::string &moduleName,
1476         std::vector<ProxyData> &proxyDatas, int32_t userId = Constants::UNSPECIFIED_USERID)
1477     {
1478         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1479     }
1480 
GetSpecifiedDistributionType(const std::string & bundleName,std::string & specifiedDistributionType)1481     virtual ErrCode GetSpecifiedDistributionType(const std::string &bundleName, std::string &specifiedDistributionType)
1482     {
1483         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1484     }
1485 
BatchGetSpecifiedDistributionType(const std::vector<std::string> & bundleNames,std::vector<BundleDistributionType> & specifiedDistributionTypes)1486     virtual ErrCode BatchGetSpecifiedDistributionType(const std::vector<std::string> &bundleNames,
1487         std::vector<BundleDistributionType> &specifiedDistributionTypes)
1488     {
1489         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1490     }
1491 
GetAdditionalInfo(const std::string & bundleName,std::string & additionalInfo)1492     virtual ErrCode GetAdditionalInfo(const std::string &bundleName, std::string &additionalInfo)
1493     {
1494         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1495     }
1496 
BatchGetAdditionalInfo(const std::vector<std::string> & bundleNames,std::vector<BundleAdditionalInfo> & additionalInfos)1497     virtual ErrCode BatchGetAdditionalInfo(const std::vector<std::string> &bundleNames,
1498         std::vector<BundleAdditionalInfo> &additionalInfos)
1499     {
1500         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1501     }
1502 
GetAdditionalInfoForAllUser(const std::string & bundleName,std::string & additionalInfo)1503     virtual ErrCode GetAdditionalInfoForAllUser(const std::string &bundleName, std::string &additionalInfo)
1504     {
1505         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1506     }
1507 
SetExtNameOrMIMEToApp(const std::string & bundleName,const std::string & moduleName,const std::string & abilityName,const std::string & extName,const std::string & mimeType)1508     virtual ErrCode SetExtNameOrMIMEToApp(const std::string &bundleName, const std::string &moduleName,
1509         const std::string &abilityName, const std::string &extName, const std::string &mimeType)
1510     {
1511         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1512     }
1513 
DelExtNameOrMIMEToApp(const std::string & bundleName,const std::string & moduleName,const std::string & abilityName,const std::string & extName,const std::string & mimeType)1514     virtual ErrCode DelExtNameOrMIMEToApp(const std::string &bundleName, const std::string &moduleName,
1515         const std::string &abilityName, const std::string &extName, const std::string &mimeType)
1516     {
1517         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1518     }
1519 
QueryDataGroupInfos(const std::string & bundleName,int32_t userId,std::vector<DataGroupInfo> & infos)1520     virtual bool QueryDataGroupInfos(const std::string &bundleName, int32_t userId, std::vector<DataGroupInfo> &infos)
1521     {
1522         return false;
1523     }
1524 
GetGroupDir(const std::string & dataGroupId,std::string & dir)1525     virtual bool GetGroupDir(const std::string &dataGroupId, std::string &dir)
1526     {
1527         return false;
1528     }
1529 
QueryAppGalleryBundleName(std::string & bundleName)1530     virtual bool QueryAppGalleryBundleName(std::string &bundleName)
1531     {
1532         return false;
1533     }
1534 
1535     /**
1536      * @brief Query extension info with type name.
1537      * @param Want Indicates the information of extension info.
1538      * @param extensionTypeName Indicates the type of the extension.
1539      * @param flag Indicates the query flag which will fliter any specified stuff in the extension info.
1540      * @param userId Indicates the userId in the system.
1541      * @param extensionInfos Indicates the obtained extensions.
1542      * @return Returns ERR_OK if this function is successfully called; returns other ErrCode otherwise.
1543      */
QueryExtensionAbilityInfosWithTypeName(const Want & want,const std::string & extensionTypeName,const int32_t flag,const int32_t userId,std::vector<ExtensionAbilityInfo> & extensionInfos)1544     virtual ErrCode QueryExtensionAbilityInfosWithTypeName(const Want &want, const std::string &extensionTypeName,
1545         const int32_t flag, const int32_t userId, std::vector<ExtensionAbilityInfo> &extensionInfos)
1546     {
1547         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1548     }
1549 
1550     /**
1551      * @brief Query extension info only with type name.
1552      * @param extensionTypeName Indicates the type of the extension.
1553      * @param flag Indicates the query flag which will fliter any specified stuff in the extension info.
1554      * @param userId Indicates the userId in the system.
1555      * @param extensionInfos Indicates the obtained extensions.
1556      * @return Returns ERR_OK if this function is successfully called; returns other ErrCode otherwise.
1557      */
QueryExtensionAbilityInfosOnlyWithTypeName(const std::string & extensionTypeName,const uint32_t flag,const int32_t userId,std::vector<ExtensionAbilityInfo> & extensionInfos)1558     virtual ErrCode QueryExtensionAbilityInfosOnlyWithTypeName(const std::string &extensionTypeName,
1559         const uint32_t flag, const int32_t userId, std::vector<ExtensionAbilityInfo> &extensionInfos)
1560     {
1561         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1562     }
1563 
ResetAOTCompileStatus(const std::string & bundleName,const std::string & moduleName,int32_t triggerMode)1564     virtual ErrCode ResetAOTCompileStatus(const std::string &bundleName, const std::string &moduleName,
1565         int32_t triggerMode)
1566     {
1567         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1568     }
1569 
1570     virtual ErrCode GetJsonProfile(ProfileType profileType, const std::string &bundleName,
1571         const std::string &moduleName, std::string &profile, int32_t userId = Constants::UNSPECIFIED_USERID)
1572     {
1573         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1574     }
1575 
GetBundleResourceProxy()1576     virtual sptr<IBundleResource> GetBundleResourceProxy()
1577     {
1578         return nullptr;
1579     }
1580 
GetRecoverableApplicationInfo(std::vector<RecoverableApplicationInfo> & recoverableApplications)1581     virtual ErrCode GetRecoverableApplicationInfo(std::vector<RecoverableApplicationInfo> &recoverableApplications)
1582     {
1583         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1584     }
1585 
GetUninstalledBundleInfo(const std::string bundleName,BundleInfo & bundleInfo)1586     virtual ErrCode GetUninstalledBundleInfo(const std::string bundleName, BundleInfo &bundleInfo)
1587     {
1588         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1589     }
1590 
SetAdditionalInfo(const std::string & bundleName,const std::string & additionalInfo)1591     virtual ErrCode SetAdditionalInfo(const std::string &bundleName, const std::string &additionalInfo)
1592     {
1593         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1594     }
1595 
CreateBundleDataDir(int32_t userId)1596     virtual ErrCode CreateBundleDataDir(int32_t userId)
1597     {
1598         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1599     }
1600 
CreateBundleDataDirWithEl(int32_t userId,DataDirEl dirEl)1601     virtual ErrCode CreateBundleDataDirWithEl(int32_t userId, DataDirEl dirEl)
1602     {
1603         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1604     }
1605 
MigrateData(const std::vector<std::string> & sourcePaths,const std::string & destinationPath)1606     virtual ErrCode MigrateData(const std::vector<std::string> &sourcePaths, const std::string &destinationPath)
1607     {
1608         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1609     }
1610 
1611     /**
1612      * @brief Get preinstalled application infos.
1613      * @param preinstalledApplicationInfos Indicates all of the obtained PreinstalledApplicationInfo objects.
1614      * @return Returns ERR_OK if this function is successfully called; returns other ErrCode otherwise.
1615      */
GetAllPreinstalledApplicationInfos(std::vector<PreinstalledApplicationInfo> & preinstalledApplicationInfos)1616     virtual ErrCode GetAllPreinstalledApplicationInfos(
1617         std::vector<PreinstalledApplicationInfo> &preinstalledApplicationInfos)
1618     {
1619         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1620     }
1621 
1622     /**
1623      * @brief Check whether the link can be opened.
1624      * @param link link Indicates the link to be opened.
1625      * @param canOpen Indicates whether the link can be opened.
1626      * @return Returns result of the operation.
1627      */
CanOpenLink(const std::string & link,bool & canOpen)1628     virtual ErrCode CanOpenLink(
1629         const std::string &link, bool &canOpen)
1630     {
1631         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
1632     }
1633 
GetOdid(std::string & odid)1634     virtual ErrCode GetOdid(std::string &odid)
1635     {
1636         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1637     }
1638 
1639     virtual ErrCode GetAllBundleInfoByDeveloperId(const std::string &developerId,
1640         std::vector<BundleInfo> &bundleInfos, int32_t userId = Constants::UNSPECIFIED_USERID)
1641     {
1642         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1643     }
1644 
1645     virtual ErrCode GetDeveloperIds(const std::string &appDistributionType,
1646         std::vector<std::string> &developerIdList, int32_t userId = Constants::UNSPECIFIED_USERID)
1647     {
1648         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1649     }
1650 
1651     virtual ErrCode SwitchUninstallState(const std::string &bundleName, const bool &state,
1652         bool isNeedSendNotify = true)
1653     {
1654         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1655     }
1656 
1657     virtual ErrCode QueryAbilityInfoByContinueType(const std::string &bundleName, const std::string &continueType,
1658         AbilityInfo &abilityInfo, int32_t userId = Constants::UNSPECIFIED_USERID)
1659     {
1660         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1661     }
1662 
QueryCloneAbilityInfo(const ElementName & element,int32_t flags,int32_t appIndex,AbilityInfo & abilityInfo,int32_t userId)1663     virtual ErrCode QueryCloneAbilityInfo(const ElementName &element,
1664         int32_t flags, int32_t appIndex, AbilityInfo &abilityInfo, int32_t userId)
1665     {
1666         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
1667     }
1668 
1669     virtual ErrCode GetCloneBundleInfo(const std::string &bundleName, int32_t flag, int32_t appIndex,
1670         BundleInfo &bundleInfo, int32_t userId = Constants::UNSPECIFIED_USERID)
1671     {
1672         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1673     }
1674 
GetCloneBundleInfoExt(const std::string & bundleName,uint32_t flag,int32_t appIndex,int32_t userId,BundleInfo & bundleInfo)1675     virtual ErrCode GetCloneBundleInfoExt(const std::string &bundleName, uint32_t flag, int32_t appIndex,
1676         int32_t userId, BundleInfo &bundleInfo)
1677     {
1678         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1679     }
1680 
1681     virtual ErrCode GetCloneAppIndexes(const std::string &bundleName, std::vector<int32_t> &appIndexes,
1682         int32_t userId = Constants::UNSPECIFIED_USERID)
1683     {
1684         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1685     }
1686 
GetLaunchWant(Want & want)1687     virtual ErrCode GetLaunchWant(Want &want)
1688     {
1689         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1690     }
1691 
1692     virtual ErrCode QueryCloneExtensionAbilityInfoWithAppIndex(const ElementName &elementName, int32_t flags,
1693         int32_t appIndex, ExtensionAbilityInfo &extensionAbilityInfo,
1694         int32_t userId = Constants::UNSPECIFIED_USERID)
1695     {
1696         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1697     }
1698 
GetSignatureInfoByBundleName(const std::string & bundleName,SignatureInfo & signatureInfo)1699     virtual ErrCode GetSignatureInfoByBundleName(const std::string &bundleName, SignatureInfo &signatureInfo)
1700     {
1701         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1702     }
1703 
1704     virtual ErrCode UpdateAppEncryptedStatus(const std::string &bundleName, bool isExisted, int32_t appIndex = 0)
1705     {
1706         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1707     }
1708 
AddDesktopShortcutInfo(const ShortcutInfo & shortcutInfo,int32_t userId)1709     virtual ErrCode AddDesktopShortcutInfo(const ShortcutInfo &shortcutInfo, int32_t userId)
1710     {
1711         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1712     }
1713 
DeleteDesktopShortcutInfo(const ShortcutInfo & shortcutInfo,int32_t userId)1714     virtual ErrCode DeleteDesktopShortcutInfo(const ShortcutInfo &shortcutInfo, int32_t userId)
1715     {
1716         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1717     }
1718 
GetAllDesktopShortcutInfo(int32_t userId,std::vector<ShortcutInfo> & shortcutInfos)1719     virtual ErrCode GetAllDesktopShortcutInfo(int32_t userId, std::vector<ShortcutInfo> &shortcutInfos)
1720     {
1721         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1722     }
1723 
GetOdidByBundleName(const std::string & bundleName,std::string & odid)1724     virtual ErrCode GetOdidByBundleName(const std::string &bundleName, std::string &odid)
1725     {
1726         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1727     }
1728 
GetSignatureInfoByUid(const int32_t uid,SignatureInfo & signatureInfo)1729     virtual ErrCode GetSignatureInfoByUid(const int32_t uid, SignatureInfo &signatureInfo)
1730     {
1731         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1732     }
1733 
1734     /**
1735      * @brief Obtains BundleInfo of all continuable bundles available in the system.
1736      * @param flags Indicates the flag used to specify information contained in the BundleInfo that will be returned.
1737      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
1738      * @param userId Indicates the user ID.
1739      * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise.
1740      */
1741     virtual bool GetBundleInfosForContinuation(int32_t flags,
1742         std::vector<BundleInfo> &bundleInfos, int32_t userId = Constants::UNSPECIFIED_USERID)
1743     {
1744         return false;
1745     }
1746 
1747     /**
1748      * @brief Get a list of application package names that continue the specified package name.
1749      * @param continueBundleName The package name that is being continued.
1750      * @param bundleNames Continue the list of specified package names.
1751      * @param userId Indicates the user ID.
1752      * @return Returns ERR_OK if successfully obtained; returns error code otherwise.
1753      */
1754     virtual ErrCode GetContinueBundleNames(const std::string &continueBundleName, std::vector<std::string> &bundleNames,
1755         int32_t userId = Constants::UNSPECIFIED_USERID)
1756     {
1757         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1758     }
1759 
IsBundleInstalled(const std::string & bundleName,int32_t userId,int32_t appIndex,bool & isInstalled)1760     virtual ErrCode IsBundleInstalled(const std::string &bundleName, int32_t userId,
1761         int32_t appIndex, bool &isInstalled)
1762     {
1763         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1764     }
1765 
GetCompatibleDeviceTypeNative(std::string & deviceType)1766     virtual ErrCode GetCompatibleDeviceTypeNative(std::string &deviceType)
1767     {
1768         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1769     }
1770 
GetCompatibleDeviceType(const std::string & bundleName,std::string & deviceType)1771     virtual ErrCode GetCompatibleDeviceType(const std::string &bundleName, std::string &deviceType)
1772     {
1773         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1774     }
1775 
GetBundleNameByAppId(const std::string & appId,std::string & bundleName)1776     virtual ErrCode GetBundleNameByAppId(const std::string &appId, std::string &bundleName)
1777     {
1778         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1779     }
1780 
GetAllPluginInfo(const std::string & hostBundleName,int32_t userId,std::vector<PluginBundleInfo> & pluginBundleInfos)1781     virtual ErrCode GetAllPluginInfo(const std::string &hostBundleName, int32_t userId,
1782         std::vector<PluginBundleInfo> &pluginBundleInfos)
1783     {
1784         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1785     }
1786 
GetPluginInfosForSelf(std::vector<PluginBundleInfo> & pluginBundleInfos)1787     virtual ErrCode GetPluginInfosForSelf(std::vector<PluginBundleInfo> &pluginBundleInfos)
1788     {
1789         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1790     }
1791 
GetDirByBundleNameAndAppIndex(const std::string & bundleName,const int32_t appIndex,std::string & dataDir)1792     virtual ErrCode GetDirByBundleNameAndAppIndex(const std::string &bundleName, const int32_t appIndex,
1793         std::string &dataDir)
1794     {
1795         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1796     }
1797 
GetAllBundleDirs(int32_t userId,std::vector<BundleDir> & bundleDirs)1798     virtual ErrCode GetAllBundleDirs(int32_t userId, std::vector<BundleDir> &bundleDirs)
1799     {
1800         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1801     }
1802 
SetAppDistributionTypes(std::set<AppDistributionTypeEnum> & appDistributionTypeEnums)1803     virtual ErrCode SetAppDistributionTypes(std::set<AppDistributionTypeEnum> &appDistributionTypeEnums)
1804     {
1805         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1806     }
1807 
GetPluginAbilityInfo(const std::string & hostBundleName,const std::string & pluginBundleName,const std::string & pluginModuleName,const std::string & pluginAbilityName,const int32_t userId,AbilityInfo & abilityInfo)1808     virtual ErrCode GetPluginAbilityInfo(const std::string &hostBundleName, const std::string &pluginBundleName,
1809         const std::string &pluginModuleName, const std::string &pluginAbilityName,
1810         const int32_t userId, AbilityInfo &abilityInfo)
1811     {
1812         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1813     }
1814 
GetPluginHapModuleInfo(const std::string & hostBundleName,const std::string & pluginBundleName,const std::string & pluginModuleName,const int32_t userId,HapModuleInfo & hapModuleInfo)1815     virtual ErrCode GetPluginHapModuleInfo(const std::string &hostBundleName, const std::string &pluginBundleName,
1816         const std::string &pluginModuleName, const int32_t userId, HapModuleInfo &hapModuleInfo)
1817     {
1818         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1819     }
1820 
RegisterPluginEventCallback(const sptr<IBundleEventCallback> & pluginEventCallback)1821     virtual ErrCode RegisterPluginEventCallback(const sptr<IBundleEventCallback> &pluginEventCallback)
1822     {
1823         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1824     }
1825 
UnregisterPluginEventCallback(const sptr<IBundleEventCallback> & pluginEventCallback)1826     virtual ErrCode UnregisterPluginEventCallback(const sptr<IBundleEventCallback> &pluginEventCallback)
1827     {
1828         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1829     }
1830 
GreatOrEqualTargetAPIVersion(const int32_t platformVersion,const int32_t minorVersion,const int32_t patchVersion)1831     virtual bool GreatOrEqualTargetAPIVersion(const int32_t platformVersion,
1832         const int32_t minorVersion, const int32_t patchVersion)
1833     {
1834         return false;
1835     }
1836 
SetShortcutVisibleForSelf(const std::string & shortcutId,bool visible)1837     virtual ErrCode SetShortcutVisibleForSelf(const std::string &shortcutId, bool visible)
1838     {
1839         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1840     }
1841 
GetAllShortcutInfoForSelf(std::vector<ShortcutInfo> & shortcutInfos)1842     virtual ErrCode GetAllShortcutInfoForSelf(std::vector<ShortcutInfo> &shortcutInfos)
1843     {
1844         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1845     }
1846 
GetPluginInfo(const std::string & hostBundleName,const std::string & pluginBundleName,const int32_t userId,PluginBundleInfo & pluginBundleInfo)1847     virtual ErrCode GetPluginInfo(const std::string &hostBundleName, const std::string &pluginBundleName,
1848         const int32_t userId, PluginBundleInfo &pluginBundleInfo)
1849     {
1850         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1851     }
1852 
GetTestRunner(const std::string & bundleName,const std::string & moduleName,ModuleTestRunner & testRunner)1853     virtual ErrCode GetTestRunner(const std::string &bundleName, const std::string &moduleName,
1854         ModuleTestRunner &testRunner)
1855     {
1856         return ERR_APPEXECFWK_SERVICE_INTERNAL_ERROR;
1857     }
1858 };
1859 
1860 #define WRITE_PARCEL(func)                                             \
1861     do {                                                               \
1862         if (!(func)) {                                                 \
1863             APP_LOGE("write parcel failed, func : %{public}s", #func); \
1864             return ERR_APPEXECFWK_PARCEL_ERROR;                        \
1865         }                                                              \
1866     } while (0)
1867 }  // namespace AppExecFwk
1868 }  // namespace OHOS
1869 #endif  // FOUNDATION_APPEXECFWK_INTERFACES_INNERKITS_APPEXECFWK_CORE_INCLUDE_BUNDLEMGR_BUNDLE_MGR_INTERFACE_H
1870