AMS加载应用慢,添加合适等待时间

Signed-off-by: 韦国庆 <weiguoqing2@huawei.com>
This commit is contained in:
韦国庆 2024-11-22 10:23:12 +08:00
parent ea37dc0646
commit 9a721a0aff
4 changed files with 9 additions and 4 deletions

View File

@ -525,6 +525,10 @@ enum {
* Result(29360237) for not get mgr. * Result(29360237) for not get mgr.
*/ */
DMS_NOT_GET_MANAGER = 29360237, DMS_NOT_GET_MANAGER = 29360237,
/**
* Result(29360238) for get window failed from scb.
*/
DMS_GET_WINDOW_FAILED_FROM_SCB = 29360238,
}; };
} // namespace DistributedSchedule } // namespace DistributedSchedule
} // namespace OHOS } // namespace OHOS

View File

@ -945,15 +945,15 @@ int32_t DSchedContinue::ExecuteContinueData(std::shared_ptr<DSchedContinueDataCm
int32_t persistentId; int32_t persistentId;
if (ContinueSceneSessionHandler::GetInstance().GetPersistentId(persistentId) != ERR_OK) { if (ContinueSceneSessionHandler::GetInstance().GetPersistentId(persistentId) != ERR_OK) {
HILOGE("get persistentId failed, stop start ability"); HILOGE("get persistentId failed, stop start ability");
return OnContinueEnd(ERR_OK); return OnContinueEnd(DMS_GET_WINDOW_FAILED_FROM_SCB);
} }
HILOGI("get persistentId success, persistentId: %{public}d", persistentId); HILOGI("get persistentId success, persistentId: %{public}d", persistentId);
WaitAbilityStateInitial(persistentId); WaitAbilityStateInitial(persistentId);
want.SetParam(DMS_PERSISTENT_ID, persistentId); want.SetParam(DMS_PERSISTENT_ID, persistentId);
if (ContinueSceneSessionHandler::GetInstance().GetPersistentId(persistentId) != ERR_OK) { if (ContinueSceneSessionHandler::GetInstance().GetPersistentId(persistentId) != ERR_OK) {
HILOGE("get persistentId failed, stop start ability"); HILOGE("Second get persistentId failed, stop start ability");
return OnContinueEnd(ERR_OK); return OnContinueEnd(DMS_GET_WINDOW_FAILED_FROM_SCB);
} }
} }

View File

@ -26,7 +26,7 @@ namespace OHOS {
namespace DistributedSchedule { namespace DistributedSchedule {
namespace { namespace {
const std::string TAG = "ContinueSceneSessionHandler"; const std::string TAG = "ContinueSceneSessionHandler";
constexpr int32_t RETRY_TIMES = 2; constexpr int32_t RETRY_TIMES = 60;
constexpr int32_t SLEEP_TIME = 50; constexpr int32_t SLEEP_TIME = 50;
} }

View File

@ -137,6 +137,7 @@ void MultiUserManager::OnUserSwitched(int32_t accountId)
HILOGI("GetSendMgr failed."); HILOGI("GetSendMgr failed.");
return; return;
} }
sendMgr->NotifyDeviceOnline();
recvMgr = GetCurrentRecvMgr(); recvMgr = GetCurrentRecvMgr();
if (recvMgr == nullptr) { if (recvMgr == nullptr) {
HILOGI("GetRecvMgr failed."); HILOGI("GetRecvMgr failed.");