mirror of
https://github.com/openharmony/distributedschedule_samgr.git
synced 2026-07-20 22:47:20 -04:00
!5 bug fix, can not turn on successful
Merge pull request !5 from ql/sa
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user