!5 bug fix, can not turn on successful

Merge pull request !5 from ql/sa
This commit is contained in:
openharmony_ci
2021-07-14 08:29:07 +00:00
committed by Gitee
-16
View File
@@ -19,23 +19,9 @@
#include "iservice_registry.h"
#include "sam_log.h"
#include "system_ability_manager.h"
#include <thread>
#include <unistd.h>
using namespace OHOS;
void startDBinderService(OHOS::sptr<OHOS::SystemAbilityManager> manager) {
int time = 15;
while (time-- > 0) {
sleep(1);
}
auto dBinder = manager->GetDBinder();
if (dBinder != nullptr) {
bool ret = dBinder->StartDBinderService();
HILOGI("started dbinder service result is %{public}s", ret ? "ok" : "fail");
}
}
int main(int argc, char *argv[])
{
HILOGI("%{public}s called, enter System Ability Manager ", __func__);
@@ -45,8 +31,6 @@ int main(int argc, char *argv[])
// Tell IPCThreadState we're the service manager
OHOS::sptr<OHOS::IRemoteObject> serv = manager->AsObject();
IPCSkeleton::SetContextObject(serv);
std::thread th(startDBinderService, manager);
th.detach();
// Create IPCThreadPool and join in.
HILOGI("start System Ability Manager Loop");