!568 修改接入动态启停框架需求review意见

Merge pull request !568 from zhangmingxiang/0410
This commit is contained in:
openharmony_ci 2023-04-11 13:18:28 +00:00 committed by Gitee
commit 1a0a883c73
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 5 additions and 4 deletions

View File

@ -69,8 +69,8 @@ bool DistributedAbilityManagerDumper::CanDump()
bool DistributedAbilityManagerDumper::DumpDefault(std::string& result)
{
result.append("ContinuationManagerService Dump\n");
result.append("\n");
result.append("ContinuationManagerService Dump\n")
.append("\n");
ShowAppRegisterInfo(result);
return true;
}

View File

@ -32,6 +32,7 @@ using namespace DistributedHardware;
namespace {
constexpr int32_t RETRY_REGISTER_CALLBACK_TIMES = 5;
constexpr int32_t RETRY_REGISTER_CALLBACK_DELAY_TIME = 1000; // 1s
const std::string PKG_NAME = "DBinderBus_Dms_" + std::to_string(getpid());
constexpr int32_t NON_ANONYMIZED_LENGTH = 6;
@ -127,7 +128,7 @@ bool DnetworkAdapter::AddDeviceChangeListener(const std::shared_ptr<DeviceListen
int32_t ret = DeviceManager::GetInstance().InitDeviceManager(PKG_NAME, initCallback_);
if (ret != ERR_OK) {
HILOGE("init device manager failed, ret:%{public}d", ret);
std::this_thread::sleep_for(1s);
std::this_thread::sleep_for(std::chrono::milliseconds(RETRY_REGISTER_CALLBACK_DELAY_TIME));
continue;
}
errCode = DeviceManager::GetInstance().RegisterDevStateCallback(PKG_NAME, "", stateCallback_);
@ -135,7 +136,7 @@ bool DnetworkAdapter::AddDeviceChangeListener(const std::shared_ptr<DeviceListen
HILOGD("AddDeviceChangeListener Reg errCode = %{public}d, retrying...", errCode);
errCode = DeviceManager::GetInstance().UnRegisterDevStateCallback(PKG_NAME);
HILOGD("AddDeviceChangeListener Unreg errCode = %{public}d", errCode);
std::this_thread::sleep_for(1s);
std::this_thread::sleep_for(std::chrono::milliseconds(RETRY_REGISTER_CALLBACK_DELAY_TIME));
continue;
}
if (UpdateDeviceInfoStorage()) {