!806 修复计算器组网成功后无法拉起设备

Merge pull request !806 from 师皓杰/cherry-pick-1708998218
This commit is contained in:
openharmony_ci 2024-02-27 06:07:39 +00:00 committed by Gitee
commit 9a389d63f4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 13 additions and 0 deletions

View File

@ -187,16 +187,25 @@ DmsDumperInfo DmsContinueTime::GetDstInfo()
void DmsContinueTime::SetDurationBegin(const int32_t idx, const int64_t time)
{
if (durationInfo_.empty()) {
return;
}
durationInfo_[idx].SetBeginTime(time);
}
void DmsContinueTime::SetDurationEnd(const int32_t idx, const int64_t time)
{
if (durationInfo_.empty()) {
return;
}
durationInfo_[idx].SetEndTime(time);
}
void DmsContinueTime::SetDurationStrTime(const int32_t idx, const std::string info)
{
if (durationInfo_.empty()) {
return;
}
durationInfo_[idx].SetStrTime(info);
}
@ -372,6 +381,7 @@ void DmsContinueTime::AppendInfo()
}
timeInfoList_.push_back(appendInfo_);
appendInfo_.clear();
durationInfo_.clear();
}
void DmsContinueTime::ShowInfo(std::string& result)

View File

@ -200,6 +200,7 @@ void DistributedSchedService::DeviceOfflineNotify(const std::string& networkId)
bool DistributedSchedService::Init()
{
HILOGD("ready to init.");
DmsContinueTime::GetInstance().Init();
DnetworkAdapter::GetInstance()->Init();
if (!DtbschedmgrDeviceInfoStorage::GetInstance().Init()) {
HILOGW("DtbschedmgrDeviceInfoStorage init failed.");

View File

@ -69,6 +69,7 @@ void DmsContinueTimeTest::TearDown()
void DmsContinueTimeTest::SetUp()
{
DTEST_LOG << "DmsContinueTimeTest::SetUp" << std::endl;
DmsContinueTime::GetInstance().Init();
}
/**
@ -370,6 +371,7 @@ HWTEST_F(DmsContinueTimeTest, AppendInfo_002, TestSize.Level3)
std::string result;
DmsContinueTime::GetInstance().SetSrcBundleName(BUNDLE_NAME);
DmsContinueTime::GetInstance().SetDstBundleName(BUNDLE_NAME);
DmsContinueTime::GetInstance().SetPull(false);
DmsContinueTime::GetInstance().AppendInfo();
DmsContinueTime::GetInstance().ShowInfo(result);
EXPECT_EQ(result.empty(), false);