• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2023 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 #include "bundle_user_mgr_host_impl.h"
17 
18 #include "bms_extension_data_mgr.h"
19 #include "bms_key_event_mgr.h"
20 #include "bundle_mgr_service.h"
21 #include "hitrace_meter.h"
22 #include "installd_client.h"
23 #include "ipc_skeleton.h"
24 #ifdef BUNDLE_FRAMEWORK_DEFAULT_APP
25 #include "default_app_mgr.h"
26 #endif
27 #ifdef WINDOW_ENABLE
28 #include "scene_board_judgement.h"
29 #endif
30 #include "status_receiver_host.h"
31 
32 namespace OHOS {
33 namespace AppExecFwk {
34 std::atomic_uint g_installedHapNum = 0;
35 const std::string ARK_PROFILE_PATH = "/data/local/ark-profile/";
36 const uint32_t FACTOR = 8;
37 const uint32_t INTERVAL = 6;
38 constexpr const char* QUICK_FIX_APP_PATH = "/data/update/quickfix/app/temp/cold";
39 constexpr const char* ACCESSTOKEN_PROCESS_NAME = "accesstoken_service";
40 constexpr const char* PRELOAD_APP = "/preload/app/";
41 
42 class UserReceiverImpl : public StatusReceiverHost {
43 public:
UserReceiverImpl(const std::string & bundleName,bool needReInstall)44     UserReceiverImpl(const std::string &bundleName, bool needReInstall)
45         : bundleName_(bundleName), needReInstall_(needReInstall) {};
46     virtual ~UserReceiverImpl() override = default;
47 
SetBundlePromise(const std::shared_ptr<BundlePromise> & bundlePromise)48     void SetBundlePromise(const std::shared_ptr<BundlePromise>& bundlePromise)
49     {
50         bundlePromise_ = bundlePromise;
51     }
52 
SetTotalHapNum(int32_t totalHapNum)53     void SetTotalHapNum(int32_t totalHapNum)
54     {
55         totalHapNum_ = totalHapNum;
56     }
57 
SavePreInstallException(const std::string & bundleName)58     void SavePreInstallException(const std::string &bundleName)
59     {
60         auto preInstallExceptionMgr =
61             DelayedSingleton<BundleMgrService>::GetInstance()->GetPreInstallExceptionMgr();
62         if (preInstallExceptionMgr == nullptr) {
63             APP_LOGE("preInstallExceptionMgr is nullptr");
64             return;
65         }
66 
67         preInstallExceptionMgr->SavePreInstallExceptionBundleName(bundleName);
68     }
69 
OnStatusNotify(const int progress)70     virtual void OnStatusNotify(const int progress) override {}
OnFinished(const int32_t resultCode,const std::string & resultMsg)71     virtual void OnFinished(const int32_t resultCode, const std::string &resultMsg) override
72     {
73         g_installedHapNum++;
74         APP_LOGI("OnFinished, resultCode : %{public}d, resultMsg : %{public}s, count : %{public}u",
75             resultCode, resultMsg.c_str(), g_installedHapNum.load());
76         if (static_cast<int32_t>(g_installedHapNum) >= totalHapNum_ && bundlePromise_ != nullptr) {
77             bundlePromise_->NotifyAllTasksExecuteFinished();
78         }
79 
80         if (resultCode != ERR_OK && resultCode !=
81             ERR_APPEXECFWK_INSTALL_ZERO_USER_WITH_NO_SINGLETON && needReInstall_) {
82             APP_LOGI("needReInstall bundleName: %{public}s", bundleName_.c_str());
83             BmsKeyEventMgr::ProcessMainBundleInstallFailed(bundleName_, resultCode);
84             SavePreInstallException(bundleName_);
85         }
86     }
87 private:
88     std::shared_ptr<BundlePromise> bundlePromise_ = nullptr;
89     int32_t totalHapNum_ = INT32_MAX;
90     std::string bundleName_;
91     bool needReInstall_ = false;
92 };
93 
CreateNewUser(int32_t userId,const std::vector<std::string> & disallowList)94 ErrCode BundleUserMgrHostImpl::CreateNewUser(int32_t userId, const std::vector<std::string> &disallowList)
95 {
96     HITRACE_METER(HITRACE_TAG_APP);
97     EventReport::SendCpuSceneEvent(ACCESSTOKEN_PROCESS_NAME, 1 << 1); // second scene
98     APP_LOGI("CreateNewUser user(%{public}d) start", userId);
99     BmsExtensionDataMgr bmsExtensionDataMgr;
100     bool needToSkipPreBundleInstall = bmsExtensionDataMgr.IsNeedToSkipPreBundleInstall();
101     if (needToSkipPreBundleInstall) {
102         APP_LOGI("need to skip pre bundle install");
103         EventReport::SendUserSysEvent(UserEventType::CREATE_WITH_SKIP_PRE_INSTALL_START, userId);
104     } else {
105         EventReport::SendUserSysEvent(UserEventType::CREATE_START, userId);
106     }
107     std::lock_guard<std::mutex> lock(bundleUserMgrMutex_);
108     if (CheckInitialUser() != ERR_OK) {
109         APP_LOGE("CheckInitialUser failed");
110         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
111     }
112     BeforeCreateNewUser(userId);
113     OnCreateNewUser(userId, needToSkipPreBundleInstall, disallowList);
114     UninstallBackupUninstallList(userId, needToSkipPreBundleInstall);
115     AfterCreateNewUser(userId);
116     if (needToSkipPreBundleInstall) {
117         EventReport::SendUserSysEvent(UserEventType::CREATE_WITH_SKIP_PRE_INSTALL_END, userId);
118     } else {
119         EventReport::SendUserSysEvent(UserEventType::CREATE_END, userId);
120     }
121     APP_LOGI("CreateNewUser end userId: (%{public}d)", userId);
122     return ERR_OK;
123 }
124 
BeforeCreateNewUser(int32_t userId)125 void BundleUserMgrHostImpl::BeforeCreateNewUser(int32_t userId)
126 {
127     ClearBundleEvents();
128 }
129 
OnCreateNewUser(int32_t userId,bool needToSkipPreBundleInstall,const std::vector<std::string> & disallowList)130 void BundleUserMgrHostImpl::OnCreateNewUser(int32_t userId, bool needToSkipPreBundleInstall,
131     const std::vector<std::string> &disallowList)
132 {
133     auto dataMgr = GetDataMgrFromService();
134     if (dataMgr == nullptr) {
135         APP_LOGE("DataMgr is nullptr");
136         return;
137     }
138 
139     auto installer = GetBundleInstaller();
140     if (installer == nullptr) {
141         APP_LOGE("installer is nullptr");
142         return;
143     }
144 
145     if (dataMgr->HasUserId(userId)) {
146         APP_LOGE("Has create user %{public}d", userId);
147         return;
148     }
149 
150     dataMgr->AddUserId(userId);
151     dataMgr->CreateAppInstallDir(userId);
152     std::set<PreInstallBundleInfo> preInstallBundleInfos;
153     if (!GetAllPreInstallBundleInfos(disallowList, userId, needToSkipPreBundleInstall, preInstallBundleInfos)) {
154         APP_LOGE("GetAllPreInstallBundleInfos failed %{public}d", userId);
155         return;
156     }
157 
158     g_installedHapNum = 0;
159     std::shared_ptr<BundlePromise> bundlePromise = std::make_shared<BundlePromise>();
160     int32_t totalHapNum = static_cast<int32_t>(preInstallBundleInfos.size());
161     std::string identity = IPCSkeleton::ResetCallingIdentity();
162     bool needReinstall = userId == Constants::START_USERID;
163     // Read apps installed by other users that are visible to all users
164     for (const auto &info : preInstallBundleInfos) {
165         InstallParam installParam;
166         installParam.userId = userId;
167         installParam.isPreInstallApp = true;
168         installParam.installFlag = InstallFlag::NORMAL;
169         installParam.preinstallSourceFlag = ApplicationInfoFlag::FLAG_BOOT_INSTALLED;
170         sptr<UserReceiverImpl> userReceiverImpl(
171             new (std::nothrow) UserReceiverImpl(info.GetBundleName(), needReinstall));
172         userReceiverImpl->SetBundlePromise(bundlePromise);
173         userReceiverImpl->SetTotalHapNum(totalHapNum);
174         installer->InstallByBundleName(info.GetBundleName(), installParam, userReceiverImpl);
175     }
176     if (static_cast<int32_t>(g_installedHapNum) < totalHapNum) {
177         bundlePromise->WaitForAllTasksExecute();
178         APP_LOGI("OnCreateNewUser wait complete");
179     }
180     // process keep alive bundle
181     if (userId == Constants::START_USERID) {
182         BMSEventHandler::ProcessRebootQuickFixBundleInstall(QUICK_FIX_APP_PATH, false);
183     }
184     IPCSkeleton::SetCallingIdentity(identity);
185 }
186 
GetAllPreInstallBundleInfos(const std::vector<std::string> & disallowList,int32_t userId,bool needToSkipPreBundleInstall,std::set<PreInstallBundleInfo> & preInstallBundleInfos)187 bool BundleUserMgrHostImpl::GetAllPreInstallBundleInfos(
188     const std::vector<std::string> &disallowList,
189     int32_t userId,
190     bool needToSkipPreBundleInstall,
191     std::set<PreInstallBundleInfo> &preInstallBundleInfos)
192 {
193     auto dataMgr = GetDataMgrFromService();
194     if (dataMgr == nullptr) {
195         APP_LOGE("DataMgr is nullptr");
196         return false;
197     }
198 
199     bool isStartUser = userId == Constants::START_USERID;
200     std::vector<PreInstallBundleInfo> allPreInstallBundleInfos = dataMgr->GetAllPreInstallBundleInfos();
201     // Scan preset applications and parse package information.
202     for (auto &preInfo : allPreInstallBundleInfos) {
203         InnerBundleInfo innerBundleInfo;
204         if (dataMgr->FetchInnerBundleInfo(preInfo.GetBundleName(), innerBundleInfo)
205             && innerBundleInfo.IsSingleton()) {
206             APP_LOGI("BundleName is IsSingleton %{public}s", preInfo.GetBundleName().c_str());
207             continue;
208         }
209         if (std::find(disallowList.begin(), disallowList.end(),
210             preInfo.GetBundleName()) != disallowList.end()) {
211             APP_LOGI("BundleName is same as black list %{public}s", preInfo.GetBundleName().c_str());
212             continue;
213         }
214         if (needToSkipPreBundleInstall && !preInfo.GetBundlePaths().empty() &&
215             (preInfo.GetBundlePaths().front().find(PRELOAD_APP) == 0)) {
216             APP_LOGI("-n %{public}s -u %{public}d skip install", preInfo.GetBundleName().c_str(), userId);
217             continue;
218         }
219         if (isStartUser) {
220             preInfo.CalculateHapTotalSize();
221         }
222         preInstallBundleInfos.insert(preInfo);
223     }
224 
225     return !preInstallBundleInfos.empty();
226 }
227 
AfterCreateNewUser(int32_t userId)228 void BundleUserMgrHostImpl::AfterCreateNewUser(int32_t userId)
229 {
230     if (userId == Constants::START_USERID) {
231         DelayedSingleton<BundleMgrService>::GetInstance()->NotifyBundleScanStatus();
232         // need process main bundle status
233         BmsKeyEventMgr::ProcessMainBundleStatusFinally();
234     }
235 
236 #ifdef BUNDLE_FRAMEWORK_DEFAULT_APP
237     DefaultAppMgr::GetInstance().HandleCreateUser(userId);
238 #endif
239     HandleSceneBoard(userId);
240     RdbDataManager::ClearCache();
241 }
242 
RemoveUser(int32_t userId)243 ErrCode BundleUserMgrHostImpl::RemoveUser(int32_t userId)
244 {
245     HITRACE_METER(HITRACE_TAG_APP);
246     EventReport::SendUserSysEvent(UserEventType::REMOVE_START, userId);
247     EventReport::SendCpuSceneEvent(ACCESSTOKEN_PROCESS_NAME, 1 << 1); // second scene
248     APP_LOGI("RemoveUser user(%{public}d) start", userId);
249     std::lock_guard<std::mutex> lock(bundleUserMgrMutex_);
250     auto dataMgr = GetDataMgrFromService();
251     if (dataMgr == nullptr) {
252         APP_LOGE("DataMgr is nullptr");
253         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
254     }
255 
256     auto installer = GetBundleInstaller();
257     if (installer == nullptr) {
258         APP_LOGE("installer is nullptr");
259         return ERR_APPEXECFWK_INSTALL_INTERNAL_ERROR;
260     }
261 
262     if (!dataMgr->HasUserId(userId)) {
263         APP_LOGE("Has remove user %{public}d", userId);
264         return ERR_APPEXECFWK_USER_NOT_EXIST;
265     }
266 
267     std::vector<BundleInfo> bundleInfos;
268     if (!dataMgr->GetBundleInfos(BundleFlag::GET_BUNDLE_DEFAULT, bundleInfos, userId)) {
269         APP_LOGE("get all bundle info failed when userId %{public}d", userId);
270         RemoveArkProfile(userId);
271         RemoveAsanLogDirectory(userId);
272         dataMgr->RemoveUserId(userId);
273         dataMgr->RemoveAppInstallDir(userId);
274         return ERR_OK;
275     }
276 
277     ClearBundleEvents();
278     InnerUninstallBundle(userId, bundleInfos);
279     RemoveArkProfile(userId);
280     RemoveAsanLogDirectory(userId);
281     dataMgr->RemoveUserId(userId);
282     dataMgr->RemoveAppInstallDir(userId);
283 #ifdef BUNDLE_FRAMEWORK_DEFAULT_APP
284     DefaultAppMgr::GetInstance().HandleRemoveUser(userId);
285 #endif
286     EventReport::SendUserSysEvent(UserEventType::REMOVE_END, userId);
287     HandleNotifyBundleEventsAsync();
288     APP_LOGI("RemoveUser end userId: (%{public}d)", userId);
289     return ERR_OK;
290 }
291 
RemoveArkProfile(int32_t userId)292 void BundleUserMgrHostImpl::RemoveArkProfile(int32_t userId)
293 {
294     std::string arkProfilePath;
295     arkProfilePath.append(ARK_PROFILE_PATH).append(std::to_string(userId));
296     APP_LOGI("DeleteArkProfile %{public}s when remove user", arkProfilePath.c_str());
297     InstalldClient::GetInstance()->RemoveDir(arkProfilePath);
298 }
299 
RemoveAsanLogDirectory(int32_t userId)300 void BundleUserMgrHostImpl::RemoveAsanLogDirectory(int32_t userId)
301 {
302     std::string asanLogDir = ServiceConstants::BUNDLE_ASAN_LOG_DIR + ServiceConstants::PATH_SEPARATOR
303         + std::to_string(userId);
304     APP_LOGI("remove asan log directory %{public}s when remove user", asanLogDir.c_str());
305     InstalldClient::GetInstance()->RemoveDir(asanLogDir);
306 }
307 
CheckInitialUser()308 ErrCode BundleUserMgrHostImpl::CheckInitialUser()
309 {
310     auto dataMgr = GetDataMgrFromService();
311     if (dataMgr == nullptr) {
312         APP_LOGE("DataMgr is nullptr");
313         return ERR_BUNDLE_MANAGER_INTERNAL_ERROR;
314     }
315 
316     if (!dataMgr->HasInitialUserCreated()) {
317         APP_LOGI("Bms initial user do not created successfully and wait");
318         std::shared_ptr<BundlePromise> bundlePromise = std::make_shared<BundlePromise>();
319         dataMgr->SetBundlePromise(bundlePromise);
320         bundlePromise->WaitForAllTasksExecute();
321         APP_LOGI("Bms initial user created successfully");
322     }
323     return ERR_OK;
324 }
325 
GetDataMgrFromService()326 const std::shared_ptr<BundleDataMgr> BundleUserMgrHostImpl::GetDataMgrFromService()
327 {
328     return DelayedSingleton<BundleMgrService>::GetInstance()->GetDataMgr();
329 }
330 
GetBundleInstaller()331 const sptr<IBundleInstaller> BundleUserMgrHostImpl::GetBundleInstaller()
332 {
333     return DelayedSingleton<BundleMgrService>::GetInstance()->GetBundleInstaller();
334 }
335 
InnerUninstallBundle(int32_t userId,const std::vector<BundleInfo> & bundleInfos)336 void BundleUserMgrHostImpl::InnerUninstallBundle(
337     int32_t userId,
338     const std::vector<BundleInfo> &bundleInfos)
339 {
340     APP_LOGI("InnerUninstallBundle for userId: %{public}d start", userId);
341     auto installer = GetBundleInstaller();
342     if (installer == nullptr) {
343         APP_LOGE("InnerUninstallBundle installer is nullptr");
344         return;
345     }
346     std::string identity = IPCSkeleton::ResetCallingIdentity();
347     g_installedHapNum = 0;
348     std::shared_ptr<BundlePromise> bundlePromise = std::make_shared<BundlePromise>();
349     int32_t totalHapNum = static_cast<int32_t>(bundleInfos.size());
350     for (const auto &info : bundleInfos) {
351         InstallParam installParam;
352         installParam.userId = userId;
353         installParam.SetForceExecuted(true);
354         installParam.concentrateSendEvent = true;
355         installParam.isPreInstallApp = info.isPreInstallApp;
356         installParam.installFlag = InstallFlag::NORMAL;
357         installParam.isRemoveUser = true;
358         sptr<UserReceiverImpl> userReceiverImpl(
359             new (std::nothrow) UserReceiverImpl(info.name, false));
360         userReceiverImpl->SetBundlePromise(bundlePromise);
361         userReceiverImpl->SetTotalHapNum(totalHapNum);
362         installer->Uninstall(info.name, installParam, userReceiverImpl);
363     }
364     if (static_cast<int32_t>(g_installedHapNum) < totalHapNum) {
365         bundlePromise->WaitForAllTasksExecute();
366     }
367     IPCSkeleton::SetCallingIdentity(identity);
368     APP_LOGI("InnerUninstallBundle for userId: %{public}d end", userId);
369 }
370 
ClearBundleEvents()371 void BundleUserMgrHostImpl::ClearBundleEvents()
372 {
373     std::lock_guard<std::mutex> uninstallEventLock(bundleEventMutex_);
374     bundleEvents_.clear();
375 }
376 
AddNotifyBundleEvents(const NotifyBundleEvents & notifyBundleEvents)377 void BundleUserMgrHostImpl::AddNotifyBundleEvents(const NotifyBundleEvents &notifyBundleEvents)
378 {
379     std::lock_guard<std::mutex> lock(bundleEventMutex_);
380     bundleEvents_.emplace_back(notifyBundleEvents);
381 }
382 
HandleNotifyBundleEventsAsync()383 void BundleUserMgrHostImpl::HandleNotifyBundleEventsAsync()
384 {
385     auto task = [this] {
386         HandleNotifyBundleEvents();
387     };
388     std::thread taskThread(task);
389     taskThread.detach();
390 }
391 
HandleNotifyBundleEvents()392 void BundleUserMgrHostImpl::HandleNotifyBundleEvents()
393 {
394     APP_LOGI("HandleNotifyBundleEvents");
395     std::lock_guard<std::mutex> lock(bundleEventMutex_);
396     auto dataMgr = GetDataMgrFromService();
397     if (dataMgr == nullptr) {
398         APP_LOGE("DataMgr is nullptr");
399         return;
400     }
401 
402     std::shared_ptr<BundleCommonEventMgr> commonEventMgr = std::make_shared<BundleCommonEventMgr>();
403     for (size_t i = 0; i < bundleEvents_.size(); ++i) {
404         commonEventMgr->NotifyBundleStatus(bundleEvents_[i], dataMgr);
405         if ((i != 0) && (i % FACTOR == 0)) {
406             std::this_thread::sleep_for(std::chrono::milliseconds(INTERVAL));
407         }
408     }
409 
410     bundleEvents_.clear();
411 }
412 
HandleSceneBoard(int32_t userId) const413 void BundleUserMgrHostImpl::HandleSceneBoard(int32_t userId) const
414 {
415 #ifdef WINDOW_ENABLE
416     auto dataMgr = DelayedSingleton<BundleMgrService>::GetInstance()->GetDataMgr();
417     if (dataMgr == nullptr) {
418         APP_LOGE("dataMgr is null");
419         return;
420     }
421     bool sceneBoardEnable = Rosen::SceneBoardJudgement::IsSceneBoardEnabled();
422     APP_LOGI("userId : %{public}d, sceneBoardEnable : %{public}d", userId, sceneBoardEnable);
423     dataMgr->SetApplicationEnabled(Constants::SCENE_BOARD_BUNDLE_NAME, 0, sceneBoardEnable,
424         ServiceConstants::CALLER_NAME_BMS, userId);
425     dataMgr->SetApplicationEnabled(ServiceConstants::LAUNCHER_BUNDLE_NAME, 0, !sceneBoardEnable,
426         ServiceConstants::CALLER_NAME_BMS, userId);
427 #endif
428 }
429 
InnerProcessSkipPreInstallBundles(const std::set<std::string> & uninstallList,bool needToSkipPreBundleInstall)430 bool BundleUserMgrHostImpl::InnerProcessSkipPreInstallBundles(
431     const std::set<std::string> &uninstallList, bool needToSkipPreBundleInstall)
432 {
433     if (uninstallList.empty() || !needToSkipPreBundleInstall) {
434         return true;
435     }
436     APP_LOGI("process skip pre bundle install start");
437     auto dataMgr = GetDataMgrFromService();
438     if (dataMgr == nullptr) {
439         APP_LOGE("DataMgr is nullptr");
440         return false;
441     }
442     bool ret = true;
443     for (const auto &name : uninstallList) {
444         PreInstallBundleInfo preInfo;
445         preInfo.SetBundleName(name);
446         if (!dataMgr->GetPreInstallBundleInfo(name, preInfo)) {
447             APP_LOGI("no pre bundleInfo %{public}s in db", name.c_str());
448             continue;
449         }
450         if (!preInfo.GetBundlePaths().empty() && (preInfo.GetBundlePaths().front().find(PRELOAD_APP) == 0)) {
451             preInfo.SetIsUninstalled(true);
452             if (!dataMgr->SavePreInstallBundleInfo(name, preInfo)) {
453                 APP_LOGE("save pre bundle %{public}s failed", name.c_str());
454                 ret = false;
455             }
456         }
457     }
458     APP_LOGI("process skip pre bundle install end");
459     return ret;
460 }
461 
UninstallBackupUninstallList(int32_t userId,bool needToSkipPreBundleInstall)462 void BundleUserMgrHostImpl::UninstallBackupUninstallList(int32_t userId, bool needToSkipPreBundleInstall)
463 {
464     BmsExtensionDataMgr bmsExtensionDataMgr;
465     std::set<std::string> uninstallList;
466     bmsExtensionDataMgr.GetBackupUninstallList(userId, uninstallList);
467     if (uninstallList.empty()) {
468         APP_LOGI("userId : %{public}d, back uninstall list is empty", userId);
469         return;
470     }
471     auto installer = GetBundleInstaller();
472     if (installer == nullptr) {
473         APP_LOGE("installer is nullptr");
474         return;
475     }
476 
477     std::string identity = IPCSkeleton::ResetCallingIdentity();
478     g_installedHapNum = 0;
479     std::shared_ptr<BundlePromise> bundlePromise = std::make_shared<BundlePromise>();
480     int32_t totalHapNum = static_cast<int32_t>(uninstallList.size());
481     for (const auto &bundleName : uninstallList) {
482         InstallParam installParam;
483         installParam.userId = userId;
484         installParam.needSendEvent = false;
485         installParam.isPreInstallApp = true;
486         sptr<UserReceiverImpl> userReceiverImpl(
487             new (std::nothrow) UserReceiverImpl(bundleName, false));
488         userReceiverImpl->SetBundlePromise(bundlePromise);
489         userReceiverImpl->SetTotalHapNum(totalHapNum);
490         installer->Uninstall(bundleName, installParam, userReceiverImpl);
491     }
492     if (static_cast<int32_t>(g_installedHapNum) < totalHapNum) {
493         bundlePromise->WaitForAllTasksExecute();
494     }
495     IPCSkeleton::SetCallingIdentity(identity);
496     bmsExtensionDataMgr.ClearBackupUninstallFile(userId);
497     (void)InnerProcessSkipPreInstallBundles(uninstallList, needToSkipPreBundleInstall);
498 }
499 }  // namespace AppExecFwk
500 }  // namespace OHOS
501