mirror of
https://github.com/openharmony/security_device_auth.git
synced 2026-08-25 09:19:33 -04:00
add waitting samgr to ensure start-up sequence
Signed-off-by: lvyuanmin <lvyuanmin@huawei.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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",
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user