• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_DATA_MGR_H
17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_DATA_MGR_H
18 
19 #include <atomic>
20 #include <map>
21 #include <memory>
22 #include <mutex>
23 #include <set>
24 #include <shared_mutex>
25 #include <string>
26 
27 #include "want.h"
28 
29 #include "ability_info.h"
30 #include "application_info.h"
31 #include "bundle_data_storage_interface.h"
32 #include "bundle_event_callback_interface.h"
33 #include "bundle_promise.h"
34 #include "bundle_sandbox_app_helper.h"
35 #include "bundle_state_storage.h"
36 #include "bundle_status_callback_interface.h"
37 #include "common_event_data.h"
38 #include "inner_bundle_info.h"
39 #include "inner_bundle_user_info.h"
40 #include "module_usage_record.h"
41 #include "preinstall_data_storage_interface.h"
42 #ifdef GLOBAL_RESMGR_ENABLE
43 #include "resource_manager.h"
44 #endif
45 #ifdef BUNDLE_FRAMEWORK_DEFAULT_APP
46 #include "element.h"
47 #endif
48 
49 namespace OHOS {
50 namespace AppExecFwk {
51 enum class InstallState {
52     INSTALL_START = 1,
53     INSTALL_SUCCESS,
54     INSTALL_FAIL,
55     UNINSTALL_START,
56     UNINSTALL_SUCCESS,
57     UNINSTALL_FAIL,
58     UPDATING_START,
59     UPDATING_SUCCESS,
60     UPDATING_FAIL,
61     ROLL_BACK,
62     USER_CHANGE,
63 };
64 
65 class BundleDataMgr {
66 public:
67     using Want = OHOS::AAFwk::Want;
68 
69     // init state transfer map data.
70     BundleDataMgr();
71     virtual ~BundleDataMgr();
72 
73     /**
74      * @brief Boot query persistent storage.
75      * @return Returns true if this function is successfully called; returns false otherwise.
76      */
77     bool LoadDataFromPersistentStorage();
78     /**
79      * @brief Update internal state for whole bundle.
80      * @param bundleName Indicates the bundle name.
81      * @param state Indicates the install state to be set.
82      * @return Returns true if this function is successfully called; returns false otherwise.
83      */
84     bool UpdateBundleInstallState(const std::string &bundleName, const InstallState state);
85     /**
86      * @brief Add new InnerBundleInfo.
87      * @param bundleName Indicates the bundle name.
88      * @param info Indicates the InnerBundleInfo object to be save.
89      * @return Returns true if this function is successfully called; returns false otherwise.
90      */
91     bool AddInnerBundleInfo(const std::string &bundleName, InnerBundleInfo &info);
92     /**
93      * @brief Add new module info to an exist InnerBundleInfo.
94      * @param bundleName Indicates the bundle name.
95      * @param newInfo Indicates the new InnerBundleInfo object.
96      * @param oldInfo Indicates the old InnerBundleInfo object.
97      * @return Returns true if this function is successfully called; returns false otherwise.
98      */
99     bool AddNewModuleInfo(const std::string &bundleName, const InnerBundleInfo &newInfo, InnerBundleInfo &oldInfo);
100     /**
101      * @brief Remove module info from an exist InnerBundleInfo.
102      * @param bundleName Indicates the bundle name.
103      * @param modulePackage Indicates the module Package.
104      * @param oldInfo Indicates the old InnerBundleInfo object.
105      * @return Returns true if this function is successfully called; returns false otherwise.
106      */
107     bool RemoveModuleInfo(const std::string &bundleName, const std::string &modulePackage, InnerBundleInfo &oldInfo);
108     /**
109      * @brief Update module info of an exist module.
110      * @param bundleName Indicates the bundle name.
111      * @param newInfo Indicates the new InnerBundleInfo object.
112      * @param oldInfo Indicates the old InnerBundleInfo object.
113      * @return Returns true if this function is successfully called; returns false otherwise.
114      */
115     bool UpdateInnerBundleInfo(const std::string &bundleName, const InnerBundleInfo &newInfo, InnerBundleInfo &oldInfo);
116     /**
117      * @brief Get an InnerBundleInfo if exist (will change the status to DISABLED).
118      * @param bundleName Indicates the bundle name.
119      * @param info Indicates the obtained InnerBundleInfo object.
120      * @return Returns true if this function is successfully called; returns false otherwise.
121      */
122     bool GetInnerBundleInfo(const std::string &bundleName, InnerBundleInfo &info);
123     /**
124      * @brief Generate UID and GID for a bundle.
125      * @param innerBundleUserInfo Indicates the InnerBundleUserInfo object.
126      * @return Returns true if this function is successfully called; returns false otherwise.
127      */
128     bool GenerateUidAndGid(InnerBundleUserInfo &innerBundleUserInfo);
129     /**
130      * @brief Recycle uid and gid .
131      * @param info Indicates the InnerBundleInfo object.
132      */
133     void RecycleUidAndGid(const InnerBundleInfo &info);
134     /**
135      * @brief Query the AbilityInfo by the given Want.
136      * @param want Indicates the information of the ability.
137      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
138      * @param userId Indicates the user ID.
139      * @param abilityInfo Indicates the obtained AbilityInfo object.
140      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
141      */
142     bool QueryAbilityInfo(const Want &want, int32_t flags, int32_t userId, AbilityInfo &abilityInfo,
143         int32_t appIndex = 0) const;
144     /**
145      * @brief Query a AbilityInfo of list by the given Want.
146      * @param want Indicates the information of the ability.
147      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
148      * @param userId Indicates the user ID.
149      * @param abilityInfos Indicates the obtained AbilityInfo of list.
150      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
151      */
152     bool QueryAbilityInfos(
153         const Want &want, int32_t flags, int32_t userId, std::vector<AbilityInfo> &abilityInfos) const;
154     /**
155      * @brief Query a AbilityInfo of list by the given Want.
156      * @param want Indicates the information of the ability.
157      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
158      * @param userId Indicates the user ID.
159      * @param abilityInfos Indicates the obtained AbilityInfo of list.
160      * @return Returns ERR_OK if the AbilityInfo is successfully obtained; returns errCode otherwise.
161      */
162     ErrCode QueryAbilityInfosV9(
163         const Want &want, int32_t flags, int32_t userId, std::vector<AbilityInfo> &abilityInfos) const;
164     /**
165      * @brief Query all match launcher ability infos by given wants.
166      * @param want Indicates the match infomation for abilities.
167      * @param info Indicates the bundleInfo.
168      * @param abilityInfo Indicates the obtained AbilityInfo of list.
169      * @param userId Indicates the user ID.
170      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
171      */
172     void GetMatchLauncherAbilityInfos(const Want& want, const InnerBundleInfo& info,
173         std::vector<AbilityInfo>& abilityInfos, int32_t userId = Constants::UNSPECIFIED_USERID) const;
174     /**
175      * @brief Query a AbilityInfo of list by the given userId.
176      * @param want Indicates the match infomation for abilities.
177      * @param flags Indicates weather to get application Info.
178      * @param userId Indicates the id of the user.
179      * @param abilityInfo Indicates the obtained AbilityInfo of list.
180      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
181      */
182     bool QueryLauncherAbilityInfos(
183         const Want& want, uint32_t userId, std::vector<AbilityInfo>& abilityInfos) const;
184     /**
185      * @brief Query the AbilityInfo by ability.uri in config.json.
186      * @param abilityUri Indicates the uri of the ability.
187      * @param abilityInfos Indicates the obtained AbilityInfos object.
188      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
189      */
190     bool QueryAbilityInfosByUri(const std::string &abilityUri, std::vector<AbilityInfo> &abilityInfos);
191     /**
192      * @brief Query the AbilityInfo by ability.uri in config.json.
193      * @param abilityUri Indicates the uri of the ability.
194      * @param userId Indicates the user ID.
195      * @param abilityInfo Indicates the obtained AbilityInfo object.
196      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
197      */
198     bool QueryAbilityInfoByUri(
199         const std::string &abilityUri, int32_t userId, AbilityInfo &abilityInfo) const;
200     /**
201      * @brief Obtains the ApplicationInfo based on a given bundle name.
202      * @param appName Indicates the application bundle name to be queried.
203      * @param flags Indicates the flag used to specify information contained
204      *             in the ApplicationInfo object that will be returned.
205      * @param userId Indicates the user ID.
206      * @param appInfo Indicates the obtained ApplicationInfo object.
207      * @return Returns true if the application is successfully obtained; returns false otherwise.
208      */
209     bool GetApplicationInfo(
210         const std::string &appName, int32_t flags, const int userId, ApplicationInfo &appInfo) const;
211     /**
212      * @brief Obtains the ApplicationInfo based on a given bundle name.
213      * @param appName Indicates the application bundle name to be queried.
214      * @param flags Indicates the flag used to specify information contained
215      *             in the ApplicationInfo object that will be returned.
216      * @param userId Indicates the user ID.
217      * @param appInfo Indicates the obtained ApplicationInfo object.
218      * @return Returns ERR_OK if the application is successfully obtained; returns error code otherwise.
219      */
220     ErrCode GetApplicationInfoV9(
221         const std::string &appName, int32_t flags, int32_t userId, ApplicationInfo &appInfo) const;
222     /**
223      * @brief Obtains information about all installed applications of a specified user.
224      * @param flags Indicates the flag used to specify information contained
225      *             in the ApplicationInfo objects that will be returned.
226      * @param userId Indicates the user ID.
227      * @param appInfos Indicates all of the obtained ApplicationInfo objects.
228      * @return Returns true if the application is successfully obtained; returns false otherwise.
229      */
230     bool GetApplicationInfos(
231         int32_t flags, const int userId, std::vector<ApplicationInfo> &appInfos) const;
232     /**
233      * @brief Obtains information about all installed applications of a specified user.
234      * @param flags Indicates the flag used to specify information contained
235      *             in the ApplicationInfo objects that will be returned.
236      * @param userId Indicates the user ID.
237      * @param appInfos Indicates all of the obtained ApplicationInfo objects.
238      * @return Returns ERR_OK if the application is successfully obtained; returns error code otherwise.
239      */
240     ErrCode GetApplicationInfosV9(
241         int32_t flags, int32_t userId, std::vector<ApplicationInfo> &appInfos) const;
242     /**
243      * @brief Obtains BundleInfo of all bundles available in the system.
244      * @param flags Indicates the flag used to specify information contained in the BundleInfo that will be returned.
245      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
246      * @param userId Indicates the user ID.
247      * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise.
248      */
249     bool GetBundleInfos(int32_t flags,
250         std::vector<BundleInfo> &bundleInfos, int32_t userId = Constants::UNSPECIFIED_USERID) const;
251     /**
252      * @brief Obtains BundleInfo of all bundles available in the system.
253      * @param flags Indicates the flag used to specify information contained in the BundleInfo that will be returned.
254      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
255      * @param userId Indicates the user ID.
256      * @return Returns ERR_OK if the BundleInfos is successfully obtained; returns error code otherwise.
257      */
258     ErrCode GetBundleInfosV9(int32_t flags, std::vector<BundleInfo> &bundleInfos, int32_t userId) const;
259     /**
260      * @brief Obtains the BundleInfo based on a given bundle name.
261      * @param bundleName Indicates the application bundle name to be queried.
262      * @param flags Indicates the information contained in the BundleInfo object to be returned.
263      * @param bundleInfo Indicates the obtained BundleInfo object.
264      * @param userId Indicates the user ID.
265      * @return Returns true if the BundleInfo is successfully obtained; returns false otherwise.
266      */
267     bool GetBundleInfo(const std::string &bundleName, int32_t flags, BundleInfo &bundleInfo,
268         int32_t userId = Constants::UNSPECIFIED_USERID) const;
269     /**
270      * @brief Obtains the BundleInfo based on a given bundle name.
271      * @param bundleName Indicates the application bundle name to be queried.
272      * @param flags Indicates the information contained in the BundleInfo object to be returned.
273      * @param bundleInfo Indicates the obtained BundleInfo object.
274      * @param userId Indicates the user ID.
275      * @return Returns ERR_OK if the BundleInfo is successfully obtained; returns error code otherwise.
276      */
277     ErrCode GetBundleInfoV9(const std::string &bundleName, int32_t flags, BundleInfo &bundleInfo,
278         int32_t userId = Constants::UNSPECIFIED_USERID) const;
279     /**
280      * @brief Obtains the BundlePackInfo based on a given bundle name.
281      * @param bundleName Indicates the application bundle name to be queried.
282      * @param flags Indicates the information contained in the BundleInfo object to be returned.
283      * @param BundlePackInfo Indicates the obtained BundlePackInfo object.
284      * @return Returns ERR_OK if the BundlePackInfo is successfully obtained; returns other ErrCode otherwise.
285      */
286     ErrCode GetBundlePackInfo(const std::string &bundleName, int32_t flags, BundlePackInfo &bundleInfo,
287         int32_t userId = Constants::UNSPECIFIED_USERID) const;
288     /**
289      * @brief Obtains the BundleInfo of application bundles based on the specified metaData.
290      * @param metaData Indicates the metadata to get in the bundle.
291      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
292      * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise.
293      */
294     bool GetBundleInfosByMetaData(const std::string &metaData, std::vector<BundleInfo> &bundleInfos) const;
295     /**
296      * @brief Obtains the bundle name of a specified application based on the given UID.
297      * @param uid Indicates the uid.
298      * @param bundleName Indicates the obtained bundle name.
299      * @return Returns true if the bundle name is successfully obtained; returns false otherwise.
300      */
301     bool GetBundleNameForUid(const int uid, std::string &bundleName) const;
302     /**
303      * @brief Obtains all bundle names of a specified application based on the given application UID.
304      * @param uid Indicates the uid.
305      * @param bundleNames Indicates the obtained bundle names.
306      * @return Returns true if the bundle names is successfully obtained; returns false otherwise.
307      */
308     bool GetBundlesForUid(const int uid, std::vector<std::string> &bundleNames) const;
309     /**
310      * @brief Obtains the formal name associated with the given UID.
311      * @param uid Indicates the uid.
312      * @param name Indicates the obtained formal name.
313      * @return Returns ERR_OK if called successfully; returns error code otherwise.
314      */
315     ErrCode GetNameForUid(const int uid, std::string &name) const;
316     /**
317      * @brief Obtains an array of all group IDs associated with a specified bundle.
318      * @param bundleName Indicates the bundle name.
319      * @param gids Indicates the group IDs associated with the specified bundle.
320      * @return Returns true if the gids is successfully obtained; returns false otherwise.
321      */
322     bool GetBundleGids(const std::string &bundleName, std::vector<int> &gids) const;
323     /**
324      * @brief Obtains an array of all group IDs associated with the given bundle name and UID.
325      * @param bundleName Indicates the bundle name.
326      * @param uid Indicates the uid.
327      * @param gids Indicates the group IDs associated with the specified bundle.
328      * @return Returns true if the gids is successfully obtained; returns false otherwise.
329      */
330     virtual bool GetBundleGidsByUid(const std::string &bundleName, const int &uid, std::vector<int> &gids) const;
331     /**
332      * @brief Obtains the BundleInfo of all keep-alive applications in the system.
333      * @param bundleInfos Indicates all of the obtained BundleInfo objects.
334      * @return Returns true if the BundleInfos is successfully obtained; returns false otherwise.
335      */
336     bool QueryKeepAliveBundleInfos(std::vector<BundleInfo> &bundleInfos) const;
337     /**
338      * @brief Obtains the label of a specified ability.
339      * @param bundleName Indicates the bundle name.
340      * @param moduleName Indicates the module name.
341      * @param abilityName Indicates the ability name.
342      * @param label Indicates the obtained label.
343      * @return Returns ERR_OK if the ability label is successfully obtained; returns errCode otherwise.
344      */
345     ErrCode GetAbilityLabel(const std::string &bundleName, const std::string &moduleName,
346         const std::string &abilityName, std::string &label) const;
347     /**
348      * @brief Obtains the Want for starting the main ability of an application based on the given bundle name.
349      * @param bundleName Indicates the bundle name.
350      * @param want Indicates the obtained launch Want object.
351      * @param userId Indicates the user ID.
352      * @return Returns ERR_OK if this function is successfully called; returns errCode otherwise.
353      */
354     ErrCode GetLaunchWantForBundle(
355         const std::string &bundleName, Want &want, int32_t userId = Constants::UNSPECIFIED_USERID) const;
356     /**
357      * @brief Obtain the HAP module info of a specific ability.
358      * @param abilityInfo Indicates the ability.
359      * @param userId Indicates the user ID.
360      * @param hapModuleInfo Indicates the obtained HapModuleInfo object.
361      * @return Returns true if the HapModuleInfo is successfully obtained; returns false otherwise.
362      */
363     bool GetHapModuleInfo(const AbilityInfo &abilityInfo,
364         HapModuleInfo &hapModuleInfo, int32_t userId = Constants::UNSPECIFIED_USERID) const;
365     /**
366      * @brief Check whether the app is system app by it's UID.
367      * @param uid Indicates the uid.
368      * @return Returns true if the bundle is a system application; returns false otherwise.
369      */
370     bool CheckIsSystemAppByUid(const int uid) const;
371     /**
372      * @brief Obtains all bundle names installed.
373      * @param bundleNames Indicates the bundle Names.
374      * @param userId Indicates the user ID.
375      * @return Returns true if have bundle installed; returns false otherwise.
376      */
377     bool GetBundleList(
378         std::vector<std::string> &bundleNames, int32_t userId = Constants::UNSPECIFIED_USERID) const;
379     /**
380      * @brief Set the bundle status disable.
381      * @param bundleName Indicates the bundle name.
382      * @return Returns true if the bundle status successfully set; returns false otherwise.
383      */
384     bool DisableBundle(const std::string &bundleName);
385     /**
386      * @brief Set the bundle status enable.
387      * @param bundleName Indicates the bundle name.
388      * @return Returns true if the bundle status successfully set; returns false otherwise.
389      */
390     bool EnableBundle(const std::string &bundleName);
391     /**
392      * @brief Get whether the application status is enabled.
393      * @param bundleName Indicates the bundle name.
394      * @param isEnable Indicates the application status is enabled.
395      * @return Returns result of the operation.
396      */
397     ErrCode IsApplicationEnabled(const std::string &bundleName, bool &isEnable) const;
398     /**
399      * @brief Set the application status.
400      * @param bundleName Indicates the bundle name.
401      * @param isEnable Indicates the status to set.
402      * @param userId Indicates the user id.
403      * @return Returns result of the operation.
404      */
405     ErrCode SetApplicationEnabled(const std::string &bundleName, bool isEnable,
406         int32_t userId = Constants::UNSPECIFIED_USERID);
407     /**
408      * @brief Sets whether to enable a specified ability through the proxy object.
409      * @param abilityInfo Indicates information about the ability to check.
410      * @param isEnable Indicates the ability status is enabled.
411      * @return Returns result of the operation.
412      */
413     ErrCode IsAbilityEnabled(const AbilityInfo &abilityInfo, bool &isEnable) const;
414     /**
415      * @brief Sets whether to enable a specified ability through the proxy object.
416      * @param abilityInfo Indicates information about the ability.
417      * @param isEnabled Specifies whether to enable the ability.
418      *                 The value true means to enable it, and the value false means to disable it.
419      * @param userId Indicates the user id.
420      * @return Returns result of the operation.
421      */
422     ErrCode SetAbilityEnabled(const AbilityInfo &abilityInfo, bool isEnabled,
423         int32_t userId = Constants::UNSPECIFIED_USERID);
424     /**
425      * @brief Register the bundle status callback function.
426      * @param bundleStatusCallback Indicates the callback object that using for notifing the bundle status.
427      * @return Returns true if this function is successfully called; returns false otherwise.
428      */
429     bool RegisterBundleStatusCallback(const sptr<IBundleStatusCallback> &bundleStatusCallback);
430 
431     bool RegisterBundleEventCallback(const sptr<IBundleEventCallback> &bundleEventCallback);
432 
433     bool UnregisterBundleEventCallback(const sptr<IBundleEventCallback> &bundleEventCallback);
434     /**
435      * @brief Clear the specific bundle status callback.
436      * @param bundleStatusCallback Indicates the callback to be cleared.
437      * @return Returns true if this function is successfully called; returns false otherwise.
438      */
439     bool ClearBundleStatusCallback(const sptr<IBundleStatusCallback> &bundleStatusCallback);
440     /**
441      * @brief Unregister all the callbacks of status changed.
442      * @return Returns true if this function is successfully called; returns false otherwise.
443      */
444     bool UnregisterBundleStatusCallback();
445     /**
446      * @brief Get a mutex for locking by bundle name.
447      * @param bundleName Indicates the bundle name.
448      * @return Returns a reference of mutex that for locing by bundle name.
449      */
450     std::mutex &GetBundleMutex(const std::string &bundleName);
451     /**
452      * @brief Obtains the provision Id based on a given bundle name.
453      * @param bundleName Indicates the application bundle name to be queried.
454      * @param provisionId Indicates the provision Id to be returned.
455      * @return Returns true if the provision Id is successfully obtained; returns false otherwise.
456      */
457     bool GetProvisionId(const std::string &bundleName, std::string &provisionId) const;
458     /**
459      * @brief Obtains the app feature based on a given bundle name.
460      * @param bundleName Indicates the application bundle name to be queried.
461      * @param provisionId Indicates the app feature to be returned.
462      * @return Returns true if the app feature is successfully obtained; returns false otherwise.
463      */
464     bool GetAppFeature(const std::string &bundleName, std::string &appFeature) const;
465     /**
466      * @brief Set the flag that indicates whether initial user create successfully.
467      * @param flag Indicates the flag to be set.
468      * @return
469      */
470     void SetInitialUserFlag(bool flag);
471     /**
472      * @brief Checks whether the publickeys of two bundles are the same.
473      * @param firstBundleName Indicates the first bundle name.
474      * @param secondBundleName Indicates the second bundle name.
475      * @return Returns SIGNATURE_UNKNOWN_BUNDLE if at least one of the given bundles is not found;
476      *         returns SIGNATURE_NOT_MATCHED if their publickeys are different;
477      *         returns SIGNATURE_MATCHED if their publickeys are the same.
478      */
479     int CheckPublicKeys(const std::string &firstBundleName, const std::string &secondBundleName) const;
480     /**
481      * @brief Get a shared pointer to the IBundleDataStorage object.
482      * @return Returns the pointer of IBundleDataStorage object.
483      */
484     std::shared_ptr<IBundleDataStorage> GetDataStorage() const;
485     /**
486      * @brief Obtains the FormInfo objects provided by all applications on the device.
487      * @param formInfos List of FormInfo objects if obtained;
488      * @return Returns true if this function is successfully called; returns false otherwise.
489      */
490     bool GetAllFormsInfo(std::vector<FormInfo> &formInfos) const;
491     /**
492      * @brief Obtains the FormInfo objects provided by a specified application on the device.
493      * @param bundleName Indicates the bundle name of the  application.
494      * @param formInfos List of FormInfo objects if obtained;
495      * @return Returns true if this function is successfully called; returns false otherwise.
496      */
497     bool GetFormsInfoByApp(const std::string &bundleName, std::vector<FormInfo> &formInfos) const;
498     /**
499      * @brief Obtains the FormInfo objects provided by a specified module name.
500      * @param formInfos List of FormInfo objects if obtained;
501      * @param moduleName Indicates the module name of the application.
502      * @param bundleName Indicates the bundle name of the application.
503      * @return Returns true if this function is successfully called; returns false otherwise.
504      */
505     bool GetFormsInfoByModule(
506         const std::string &bundleName, const std::string &moduleName, std::vector<FormInfo> &formInfos) const;
507     /**
508      * @brief Obtains the ShortcutInfo objects provided by a specified application on the device.
509      * @param bundleName Indicates the bundle name of the application.
510      * @param userId Indicates the user ID.
511      * @param shortcutInfos List of ShortcutInfo objects if obtained.
512      * @return Returns true if this function is successfully called; returns false otherwise.
513      */
514     bool GetShortcutInfos(
515         const std::string &bundleName, int32_t userId, std::vector<ShortcutInfo> &shortcutInfos) const;
516     /**
517      * @brief Obtains the ShortcutInfo objects provided by a specified application on the device.
518      * @param bundleName Indicates the bundle name of the application.
519      * @param userId Indicates the user ID.
520      * @param shortcutInfos List of ShortcutInfo objects if obtained.
521      * @return Returns errcode of the result.
522      */
523     ErrCode GetShortcutInfoV9(
524         const std::string &bundleName, int32_t userId, std::vector<ShortcutInfo> &shortcutInfos) const;
525     /**
526      * @brief Obtains the CommonEventInfo objects provided by an event key on the device.
527      * @param eventKey Indicates the event of the subscribe.
528      * @param commonEventInfos List of CommonEventInfo objects if obtained.
529      * @return Returns true if this function is successfully called; returns false otherwise.
530      */
531     bool GetAllCommonEventInfo(const std::string &eventKey, std::vector<CommonEventInfo> &commonEventInfos) const;
532     /**
533      * @brief Update bundle usage record on module removed.
534      * @param keepUsage Indicates the flag record is remove on module removed.
535      * @param userId Indicates the user Id of the application.
536      * @param bundleName Indicates the bundle name of the application.
537      * @param moduleName Indicates the module name of the  application.
538      * @return Returns true if this function is successfully called; returns false otherwise.
539      */
540     bool UpdateUsageRecordOnModuleRemoved(
541         bool keepUsage, const int userId, const std::string &bundleName, const std::string &moduleName) const;
542     /**
543      * @brief Obtains the PreInstallBundleInfo objects provided by bundleName.
544      * @param bundleName Indicates the bundle name of the application.
545      * @param preInstallBundleInfo Indicates information about the PreInstallBundleInfo.
546      * @return Returns true if this function is successfully called; returns false otherwise.
547      */
548     bool GetPreInstallBundleInfo(const std::string &bundleName, PreInstallBundleInfo &preInstallBundleInfo);
549     /**
550      * @brief Save new PreInstallBundleInfo.
551      * @param bundleName Indicates the bundle name.
552      * @param preInstallBundleInfo Indicates the PreInstallBundleInfo object to be save.
553      * @return Returns true if this function is successfully called; returns false otherwise.
554      */
555     bool SavePreInstallBundleInfo(const std::string &bundleName, const PreInstallBundleInfo &preInstallBundleInfo);
556     /**
557      * @brief Obtains the PreInstallBundleInfo objects provided by bundleName.
558      * @param preInstallBundleInfo Indicates information about the PreInstallBundleInfo.
559      * @return Returns true if this function is successfully called; returns false otherwise.
560      */
561     bool LoadAllPreInstallBundleInfos(std::vector<PreInstallBundleInfo> &preInstallBundleInfos);
562     /**
563      * @brief Save new PreInstallBundleInfo.
564      * @param bundleName Indicates the bundle name.
565      * @param preInstallBundleInfo Indicates the PreInstallBundleInfo object to be save.
566      * @return Returns true if this function is successfully called; returns false otherwise.
567      */
568     bool DeletePreInstallBundleInfo(
569         const std::string &bundleName, const PreInstallBundleInfo &preInstallBundleInfo);
570     /**
571      * @brief Save installation mark to datebase storage.
572      * @param info Indicates the innerBundleInfo of the bundle which needs to save installation mark.
573      * @param isAppExisted Indicates whether the application exists in the database storage or not.
574      * @return Returns true if this function is successfully called; returns false otherwise.
575      */
576     bool SaveInnerBundleInfo(const InnerBundleInfo &info) const;
577     /**
578      * @brief GetInnerBundleUserInfoByUserId.
579      * @param bundleName Indicates the application bundle name to be queried.
580      * @param userId Indicates the user ID.
581      * @param innerBundleUserInfo Indicates the obtained InnerBundleUserInfo object.
582      * @return Returns true if the application is successfully obtained; returns false otherwise.
583      */
584     bool GetInnerBundleUserInfoByUserId(
585         const std::string &bundleName, int32_t userId, InnerBundleUserInfo &innerBundleUserInfo) const;
586     /**
587      * @brief save all created users.
588      * @param userId Indicates the user ID.
589      */
590     void AddUserId(int32_t userId);
591     /**
592      * @brief remove userId.
593      * @param userId Indicates the user ID.
594      */
595     void RemoveUserId(int32_t userId);
596     /**
597      * @brief query users.
598      * @param userId Indicates the user ID.
599      * @return Returns true when query user success; returns false otherwise.
600      */
601     bool HasUserId(int32_t userId) const;
602     /**
603      * @brief Get userId by calling uid.
604      * @return Returns userId.
605      */
606     int32_t GetUserIdByCallingUid() const;
607     /**
608      * @brief Get all user.
609      * @return Returns all userId.
610      */
611     std::set<int32_t> GetAllUser() const;
612     /**
613      * @brief Has initial user created.
614      * @return Returns initial user flag.
615      */
HasInitialUserCreated()616     bool HasInitialUserCreated() const
617     {
618         return initialUserFlag_;
619     }
620     /**
621      * @brief Set bundlePromise.
622      * @param bundlePromise Indicates the bundlePromise.
623      */
SetBundlePromise(const std::shared_ptr<BundlePromise> & bundlePromise)624     void SetBundlePromise(const std::shared_ptr<BundlePromise>& bundlePromise)
625     {
626         bundlePromise_ = bundlePromise;
627     }
628     /**
629      * @brief Get bundleUserInfos by bundleName.
630      * @param bundleName Indicates the application bundle name to be queried.
631      * @param innerBundleUserInfo Indicates the obtained InnerBundleUserInfo object.
632      * @return Returns true if the application is successfully obtained; returns false otherwise.
633      */
634     bool GetInnerBundleUserInfos(
635         const std::string &bundleName, std::vector<InnerBundleUserInfo> &innerBundleUserInfos) const;
636     /**
637      * @brief Get app privilege level.
638      * @param bundleName Indicates the bundle name of the app privilege level.
639      * @param userId Indicates the user id.
640      * @return Returns app privilege level.
641      */
642     std::string GetAppPrivilegeLevel(
643         const std::string &bundleName, int32_t userId = Constants::UNSPECIFIED_USERID);
644     /**
645      * @brief Query a ExtensionAbilityInfo of list by the given Want.
646      * @param want Indicates the information of the ability.
647      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
648      * @param userId Indicates the user ID.
649      * @param extensionInfos Indicates the obtained ExtensionAbilityInfo of list.
650      * @return Returns true if the ExtensionAbilityInfo is successfully obtained; returns false otherwise.
651      */
652     bool QueryExtensionAbilityInfos(const Want &want, int32_t flags, int32_t userId,
653         std::vector<ExtensionAbilityInfo> &extensionInfos, int32_t appIndex = 0) const;
654     /**
655      * @brief Query a ExtensionAbilityInfo of list by the given Want.
656      * @param want Indicates the information of the ability.
657      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
658      * @param userId Indicates the user ID.
659      * @param extensionInfos Indicates the obtained ExtensionAbilityInfo of list.
660      * @return Returns ERR_OK if the ExtensionAbilityInfo is successfully obtained; returns errCode otherwise.
661      */
662     ErrCode QueryExtensionAbilityInfosV9(const Want &want, int32_t flags, int32_t userId,
663         std::vector<ExtensionAbilityInfo> &extensionInfos, int32_t appIndex = 0) const;
664     /**
665      * @brief Obtains the PreInstallBundleInfo objects in Cache.
666      * @return Returns PreInstallBundleInfos.
667      */
668     const std::vector<PreInstallBundleInfo>& GetAllPreInstallBundleInfos();
669     /**
670      * @brief Restore uid and gid .
671      * @return Returns true if this function is successfully called; returns false otherwise.
672      */
673     bool RestoreUidAndGid();
674     /**
675      * @brief Load all bundle state data from jsonDb .
676      * @return
677      */
678     void LoadAllBundleStateDataFromJsonDb();
679 
680     bool QueryExtensionAbilityInfos(const ExtensionAbilityType &extensionType, const int32_t &userId,
681         std::vector<ExtensionAbilityInfo> &extensionInfos) const;
682 
683     std::vector<std::string> GetAccessibleAppCodePaths(int32_t userId) const;
684 
685     bool QueryExtensionAbilityInfoByUri(const std::string &uri, int32_t userId,
686         ExtensionAbilityInfo &extensionAbilityInfo) const;
687 
688     bool QueryAllDeviceIds(std::vector<std::string> &deviceIds);
689 
690     void GetAllUriPrefix(std::vector<std::string> &uriPrefixList, int32_t userId,
691         const std::string &excludeModule = "") const;
692 
693     bool AddInnerBundleUserInfo(const std::string &bundleName, const InnerBundleUserInfo& newUserInfo);
694 
695     bool RemoveInnerBundleUserInfo(const std::string &bundleName, int32_t userId);
696 
697 #ifdef BUNDLE_FRAMEWORK_FREE_INSTALL
698     bool GetRemovableBundleNameVec(std::map<std::string, int>& bundlenameAndUids);
699 #endif
700     bool ImplicitQueryInfoByPriority(const Want &want, int32_t flags, int32_t userId,
701         AbilityInfo &abilityInfo, ExtensionAbilityInfo &extensionInfo);
702 
703     bool ImplicitQueryInfos(const Want &want, int32_t flags, int32_t userId,
704         std::vector<AbilityInfo> &abilityInfos, std::vector<ExtensionAbilityInfo> &extensionInfos);
705 
706     /**
707      * @brief Sets whether to enable isRemovable based on given bundle name, module name and isEnable.
708      * @param bundleName Indicates the bundleName.
709      * @param moduleName Indicates the moduleName.
710      * @param isEnable Set module isRemovable is enable.
711      * @return Returns true if the module isRemovable is set success; returns false otherwise.
712      */
713     bool SetModuleRemovable(const std::string &bundleName, const std::string &moduleName, bool isEnable);
714     /**
715      * @brief Get Module isRemovable by bundleName and moduleName.
716      * @param bundleName Indicates the application bundle name to be queried.
717      * @param moduleName Indicates the moduleName.
718      * @param isRemovable Indicates the module whether is removable.
719      * @return Returns ERR_OK if the module isRemovable is successfully obtained; returns other ErrCode otherwise.
720      */
721     ErrCode IsModuleRemovable(const std::string &bundleName, const std::string &moduleName, bool &isRemovable) const;
722 
723 #ifdef BUNDLE_FRAMEWORK_FREE_INSTALL
724     /**
725      * @brief Get bundle space size (Bytes) by bundleName.
726      * @param bundleName Indicates the application bundle name to be queried.
727      * @return Returns the space size of a bundle by bundleName.
728      */
729     int64_t GetBundleSpaceSize(const std::string &bundleName) const;
730     /**
731      * @brief Get all free install bundle space size (Bytes).
732      * @return Returns the space size of all free install bundles.
733      */
734     int64_t GetAllFreeInstallBundleSpaceSize() const;
735 #endif
736 
737     bool GetBundleStats(
738         const std::string &bundleName, const int32_t userId, std::vector<int64_t> &bundleStats) const;
739     bool GetAllDependentModuleNames(const std::string &bundleName, const std::string &moduleName,
740         std::vector<std::string> &dependentModuleNames);
741     ErrCode SetModuleUpgradeFlag(const std::string &bundleName, const std::string &moduleName, int32_t upgradeFlag);
742     int32_t GetModuleUpgradeFlag(const std::string &bundleName, const std::string &moduleName) const;
743     /**
744      * @brief Get the Inner Bundle Info With Flags object
745      * @param bundleName Indicates the application bundle name to be queried.
746      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
747      * @param info Indicates the innerBundleInfo of the bundle.
748      * @param userId Indicates the user ID.
749      * @return Returns true if get inner bundle info is successfully obtained; returns false otherwise.
750      */
751     bool GetInnerBundleInfoWithFlags(const std::string &bundleName, const int32_t flags,
752         InnerBundleInfo &info, int32_t userId = Constants::UNSPECIFIED_USERID) const;
753     ErrCode GetInnerBundleInfoWithFlagsV9(const std::string &bundleName, int32_t flags,
754         InnerBundleInfo &info, int32_t userId = Constants::UNSPECIFIED_USERID) const;
755     ErrCode GetInnerBundleInfoWithBundleFlagsV9(const std::string &bundleName, int32_t flags,
756         InnerBundleInfo &info, int32_t userId = Constants::UNSPECIFIED_USERID) const;
757     std::shared_ptr<BundleSandboxAppHelper> GetSandboxAppHelper() const;
758     void StoreSandboxPersistentInfo(const std::string &bundleName, const SandboxAppPersistentInfo &info);
759     void DeleteSandboxPersistentInfo(const std::string &bundleName, const SandboxAppPersistentInfo &info);
760 
761     bool SetDisposedStatus(const std::string &bundleName, int32_t status);
762 
763     int32_t GetDisposedStatus(const std::string &bundleName);
764 
765 #ifdef BUNDLE_FRAMEWORK_DEFAULT_APP
766     bool QueryInfoAndSkillsByElement(int32_t userId, const Element& element,
767         AbilityInfo& abilityInfo, ExtensionAbilityInfo& extensionInfo, std::vector<Skill>& skills) const;
768 
769     bool GetElement(int32_t userId, const ElementName& elementName, Element& element) const;
770 #endif
771 
772     int32_t GetUserId(int32_t userId = Constants::UNSPECIFIED_USERID) const;
773 
774     ErrCode GetMediaData(const std::string &bundleName, const std::string &moduleName, const std::string &abilityName,
775         std::unique_ptr<uint8_t[]> &mediaDataPtr, size_t &len, int32_t userId) const;
776 
777     std::shared_mutex &GetStatusCallbackMutex();
778 
779     std::vector<sptr<IBundleStatusCallback>> GetCallBackList() const;
780 
781     std::string GetStringById(const std::string &bundleName, const std::string &moduleName,
782         uint32_t resId, int32_t userId, const std::string &localeInfo);
783 
784     std::string GetIconById(
785         const std::string &bundleName, const std::string &moduleName, uint32_t resId, uint32_t density, int32_t userId);
786     void UpdateRemovable(const std::string &bundleName, bool removable);
787     void UpdatePrivilegeCapability(
788         const std::string &bundleName, const ApplicationInfo &appInfo);
789     bool FetchInnerBundleInfo(
790         const std::string &bundleName, InnerBundleInfo &innerBundleInfo);
791 
792     bool UpdateQuickFixInnerBundleInfo(const std::string &bundleName, const InnerBundleInfo &innerBundleInfo);
793 
794     void NotifyBundleEventCallback(const EventFwk::CommonEventData &eventData) const;
795 
796     virtual ErrCode GetProvisionMetadata(const std::string &bundleName, int32_t userId,
797         std::vector<Metadata> &provisionMetadatas) const;
798 
799 private:
800     /**
801      * @brief Init transferStates.
802      * @return
803      */
804     void InitStateTransferMap();
805     /**
806      * @brief Determine whether to delete the data status.
807      * @param state Indicates the InstallState object.
808      * @return Returns true if state is INSTALL_FAIL,UNINSTALL_FAIL,UNINSTALL_SUCCESS,or UPDATING_FAIL; returns false
809      * otherwise.
810      */
811     bool IsDeleteDataState(const InstallState state) const;
812     /**
813      * @brief Determine whether it is disable.
814      * @param state Indicates the InstallState object.
815      * @return Returns true if install state is UPDATING_START or UNINSTALL_START; returns false otherwise.
816      */
817     bool IsDisableState(const InstallState state) const;
818     /**
819      * @brief Delete bundle info if InstallState is not INSTALL_FAIL.
820      * @param bundleName Indicates the bundle Names.
821      * @param state Indicates the InstallState object.
822      * @return Returns true if install state is UPDATING_START or UNINSTALL_START; returns false otherwise.
823      */
824     void DeleteBundleInfo(const std::string &bundleName, const InstallState state);
825     /**
826      * @brief Determine whether app is installed.
827      * @param bundleName Indicates the bundle Names.
828      * @return Returns true if install state is INSTALL_SUCCESS; returns false otherwise.
829      */
830     bool IsAppOrAbilityInstalled(const std::string &bundleName) const;
831     /**
832      * @brief Implicit query abilityInfos by the given Want.
833      * @param want Indicates the information of the ability.
834      * @param flags Indicates the information contained in the AbilityInfo object to be returned.
835      * @param userId Indicates the user ID.
836      * @param abilityInfos Indicates the obtained AbilityInfo of list.
837      * @return Returns true if the AbilityInfo is successfully obtained; returns false otherwise.
838      */
839     bool ImplicitQueryAbilityInfos(const Want &want, int32_t flags, int32_t userId,
840         std::vector<AbilityInfo> &abilityInfos, int32_t appIndex = 0) const;
841     ErrCode ImplicitQueryAbilityInfosV9(const Want &want, int32_t flags, int32_t userId,
842         std::vector<AbilityInfo> &abilityInfos, int32_t appIndex = 0) const;
843     void GetMatchAbilityInfos(const Want &want, int32_t flags,
844         const InnerBundleInfo &info, int32_t userId, std::vector<AbilityInfo> &abilityInfos) const;
845     void GetMatchAbilityInfosV9(const Want &want, int32_t flags,
846         const InnerBundleInfo &info, int32_t userId, std::vector<AbilityInfo> &abilityInfos) const;
847     bool ExplicitQueryAbilityInfo(const Want &want, int32_t flags, int32_t userId, AbilityInfo &abilityInfo,
848         int32_t appIndex = 0) const;
849     ErrCode ExplicitQueryAbilityInfoV9(const Want &want, int32_t flags, int32_t userId, AbilityInfo &abilityInfo,
850         int32_t appIndex = 0) const;
851     bool GenerateBundleId(const std::string &bundleName, int32_t &bundleId);
852     int32_t GetUserIdByUid(int32_t uid) const;
853     ErrCode GetInnerBundleInfoByUid(const int uid, InnerBundleInfo &innerBundleInfo) const;
854     bool GetAllBundleInfos(int32_t flags, std::vector<BundleInfo> &bundleInfos) const;
855     ErrCode GetAllBundleInfosV9(int32_t flags, std::vector<BundleInfo> &bundleInfos) const;
856     bool ExplicitQueryExtensionInfo(const Want &want, int32_t flags, int32_t userId,
857         ExtensionAbilityInfo &extensionInfo, int32_t appIndex = 0) const;
858     ErrCode ExplicitQueryExtensionInfoV9(const Want &want, int32_t flags, int32_t userId,
859         ExtensionAbilityInfo &extensionInfo, int32_t appIndex = 0) const;
860     bool ImplicitQueryExtensionInfos(const Want &want, int32_t flags, int32_t userId,
861         std::vector<ExtensionAbilityInfo> &extensionInfos, int32_t appIndex = 0) const;
862     ErrCode ImplicitQueryExtensionInfosV9(const Want &want, int32_t flags, int32_t userId,
863         std::vector<ExtensionAbilityInfo> &extensionInfos, int32_t appIndex = 0) const;
864     void GetMatchExtensionInfos(const Want &want, int32_t flags, const int32_t &userId, const InnerBundleInfo &info,
865         std::vector<ExtensionAbilityInfo> &einfos) const;
866     void GetMatchExtensionInfosV9(const Want &want, int32_t flags, int32_t userId, const InnerBundleInfo &info,
867         std::vector<ExtensionAbilityInfo> &infos) const;
868 #ifdef GLOBAL_RESMGR_ENABLE
869     std::shared_ptr<Global::Resource::ResourceManager> GetResourceManager(const std::string &bundleName,
870         const std::string &moduleName, int32_t userId, const std::string &localeInfo = Constants::EMPTY_STRING) const;
871 #endif
872 
873     void FilterAbilityInfosByModuleName(const std::string &moduleName, std::vector<AbilityInfo> &abilityInfos) const;
874 
875     void FilterExtensionAbilityInfosByModuleName(const std::string &moduleName,
876         std::vector<ExtensionAbilityInfo> &extensionInfos) const;
877     void CompatibleOldBundleStateInKvDb();
878     void ResetBundleStateData();
879     bool QueryAbilityInfoWithFlags(const std::optional<AbilityInfo> &option, int32_t flags, int32_t userId,
880         const InnerBundleInfo &innerBundleInfo, AbilityInfo &info) const;
881     ErrCode QueryAbilityInfoWithFlagsV9(const std::optional<AbilityInfo> &option, int32_t flags, int32_t userId,
882         const InnerBundleInfo &innerBundleInfo, AbilityInfo &info) const;
883     bool ImplicitQueryCurAbilityInfos(const Want &want, int32_t flags, int32_t userId,
884         std::vector<AbilityInfo> &abilityInfos, int32_t appIndex) const;
885     ErrCode ImplicitQueryCurAbilityInfosV9(const Want &want, int32_t flags, int32_t userId,
886         std::vector<AbilityInfo> &abilityInfos, int32_t appIndex) const;
887     void ImplicitQueryAllAbilityInfos(const Want &want, int32_t flags, int32_t userId,
888         std::vector<AbilityInfo> &abilityInfos, int32_t appIndex) const;
889     void ImplicitQueryAllAbilityInfosV9(const Want &want, int32_t flags, int32_t userId,
890         std::vector<AbilityInfo> &abilityInfos, int32_t appIndex) const;
891     bool ImplicitQueryCurExtensionInfos(const Want &want, int32_t flags, int32_t userId,
892         std::vector<ExtensionAbilityInfo> &infos, int32_t appIndex) const;
893     ErrCode ImplicitQueryCurExtensionInfosV9(const Want &want, int32_t flags, int32_t userId,
894         std::vector<ExtensionAbilityInfo> &infos, int32_t appIndex) const;
895     void ImplicitQueryAllExtensionInfos(const Want &want, int32_t flags, int32_t userId,
896         std::vector<ExtensionAbilityInfo> &infos, int32_t appIndex) const;
897     void ImplicitQueryAllExtensionInfosV9(const Want &want, int32_t flags, int32_t userId,
898         std::vector<ExtensionAbilityInfo> &infos, int32_t appIndex) const;
899     ErrCode CheckInnerBundleInfoWithFlags(
900         const InnerBundleInfo &innerBundleInfo, int32_t flags, int32_t userId) const;
901     void AddAppDetailAbilityInfo(InnerBundleInfo &info) const;
902 
903 private:
904     mutable std::mutex bundleInfoMutex_;
905     mutable std::mutex stateMutex_;
906     mutable std::mutex bundleIdMapMutex_;
907     mutable std::shared_mutex callbackMutex_;
908     mutable std::mutex eventCallbackMutex_;
909     mutable std::shared_mutex bundleMutex_;
910     mutable std::mutex multiUserIdSetMutex_;
911     mutable std::mutex preInstallInfoMutex_;
912     bool initialUserFlag_ = false;
913     int32_t baseAppUid_ = Constants::BASE_APP_UID;
914     // using for locking by bundleName
915     std::unordered_map<std::string, std::mutex> bundleMutexMap_;
916     // using for generating bundleId
917     // key:bundleId
918     // value:bundleName
919     std::map<int32_t, std::string> bundleIdMap_;
920     // save all created users.
921     std::set<int32_t> multiUserIdsSet_;
922     // use vector because these functions using for IPC, the bundleName may duplicate
923     std::vector<sptr<IBundleStatusCallback>> callbackList_;
924     // common event callback
925     std::vector<sptr<IBundleEventCallback>> eventCallbackList_;
926     // all installed bundles
927     // key:bundleName
928     // value:innerbundleInfo
929     std::map<std::string, InnerBundleInfo> bundleInfos_;
930     // key:bundle name
931     std::map<std::string, InstallState> installStates_;
932     // current-status:previous-statue pair
933     std::multimap<InstallState, InstallState> transferStates_;
934     std::shared_ptr<IBundleDataStorage> dataStorage_;
935     std::shared_ptr<IPreInstallDataStorage> preInstallDataStorage_;
936     std::shared_ptr<BundleStateStorage> bundleStateStorage_;
937     std::vector<PreInstallBundleInfo> preInstallBundleInfos_;
938     std::shared_ptr<BundlePromise> bundlePromise_ = nullptr;
939     std::shared_ptr<BundleSandboxAppHelper> sandboxAppHelper_;
940 };
941 }  // namespace AppExecFwk
942 }  // namespace OHOS
943 #endif  // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_DATA_MGR_H
944