add waitting samgr to ensure start-up sequence

Signed-off-by: lvyuanmin <lvyuanmin@huawei.com>
This commit is contained in:
lvyuanmin
2022-08-09 17:16:56 +08:00
parent e71a261ce0
commit 9ef08eb9d9
2 changed files with 6 additions and 0 deletions
+4
View File
@@ -26,6 +26,7 @@
#include "iservice_registry.h"
#include "securec.h"
#include "system_ability_definition.h"
#include "parameter.h"
using namespace std;
using namespace OHOS;
@@ -1331,6 +1332,9 @@ int32_t AddDevAuthServiceToManager(uintptr_t *serviceCtx)
int32_t ret = ERR_OK;
ServiceDevAuth *sPtr = nullptr;
// Wait samgr ready for up to 1 second to ensure adding service to samgr.
WaitParameter("bootevent.samgr.ready", "true", 1);
sptr<ISystemAbilityManager> sysMgr = SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
if (sysMgr == nullptr) {
return HC_ERR_IPC_GET_SERVICE;
+2
View File
@@ -229,6 +229,7 @@ if (os_level == "mini" || os_level == "small") {
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
"init:libbegetutil",
"ipc:ipc_core",
"safwk:system_ability_fwk",
"samgr:samgr_proxy",
@@ -273,6 +274,7 @@ if (os_level == "mini" || os_level == "small") {
"hisysevent_native:libhisysevent",
"hitrace_native:hitrace_meter",
"hiviewdfx_hilog_native:libhilog",
"init:libbegetutil",
"ipc:ipc_core",
"samgr:samgr_proxy",
]