mirror of
https://gitee.com/openharmony/msdp_device_status
synced 2025-02-21 08:14:07 +00:00
delete userdata
Signed-off-by: mayunteng_1 <mayunteng@huawei.com> Change-Id: I56c48dc3506312d19fe4714a183622d27b212bed
This commit is contained in:
parent
1a82da3682
commit
2eaab65578
@ -61,7 +61,7 @@ public:
|
||||
|
||||
struct CallbackInfo : RefBase {
|
||||
CallbackInfo() = default;
|
||||
~CallbackInfo();
|
||||
~CallbackInfo() = default;
|
||||
napi_env env { nullptr };
|
||||
napi_ref ref { nullptr };
|
||||
napi_deferred deferred { nullptr };
|
||||
|
@ -26,11 +26,6 @@ namespace {
|
||||
constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, MSDP_DOMAIN_ID, "JsUtil" };
|
||||
} // namespace
|
||||
|
||||
JsUtil::CallbackInfo::~CallbackInfo()
|
||||
{
|
||||
CALL_DEBUG_ENTER;
|
||||
}
|
||||
|
||||
napi_value JsUtil::GetEnableInfo(sptr<CallbackInfo> cb)
|
||||
{
|
||||
CHKPP(cb);
|
||||
|
@ -85,11 +85,12 @@ int32_t CoordinationManagerImpl::EnableCoordination(bool enabled, FuncCoordinati
|
||||
FI_HILOGE("userData exceeds the maximum");
|
||||
return RET_ERR;
|
||||
}
|
||||
auto ret = DeviceStatusClient::GetInstance().EnableCoordination(userData_++, enabled);
|
||||
auto ret = DeviceStatusClient::GetInstance().EnableCoordination(userData_, enabled);
|
||||
if (ret != RET_OK) {
|
||||
FI_HILOGE("Get Coordination State failed");
|
||||
} else {
|
||||
devCoordinationEvent_[userData_] = event;
|
||||
userData_++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -106,11 +107,12 @@ int32_t CoordinationManagerImpl::StartCoordination(const std::string &sinkDevice
|
||||
return RET_ERR;
|
||||
}
|
||||
auto ret = DeviceStatusClient::GetInstance().StartCoordination(
|
||||
userData_++, sinkDeviceId, srcDeviceId);
|
||||
userData_, sinkDeviceId, srcDeviceId);
|
||||
if (ret != RET_OK) {
|
||||
FI_HILOGE("Get Coordination State failed");
|
||||
} else {
|
||||
devCoordinationEvent_[userData_] = event;
|
||||
userData_++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -125,11 +127,12 @@ int32_t CoordinationManagerImpl::StopCoordination(FuncCoordinationMessage callba
|
||||
FI_HILOGE("userData exceeds the maximum");
|
||||
return RET_ERR;
|
||||
}
|
||||
auto ret = DeviceStatusClient::GetInstance().StopCoordination(userData_++);
|
||||
auto ret = DeviceStatusClient::GetInstance().StopCoordination(userData_);
|
||||
if (ret != RET_OK) {
|
||||
FI_HILOGE("Get Coordination State failed");
|
||||
} else {
|
||||
devCoordinationEvent_[userData_] = event;
|
||||
userData_++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -145,11 +148,12 @@ int32_t CoordinationManagerImpl::GetCoordinationState(
|
||||
FI_HILOGE("userData exceeds the maximum");
|
||||
return RET_ERR;
|
||||
}
|
||||
auto ret = DeviceStatusClient::GetInstance().GetCoordinationState(userData_++, deviceId);
|
||||
auto ret = DeviceStatusClient::GetInstance().GetCoordinationState(userData_, deviceId);
|
||||
if (ret != RET_OK) {
|
||||
FI_HILOGE("Get Coordination State failed");
|
||||
} else {
|
||||
devCoordinationEvent_[userData_] = event;
|
||||
userData_++;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user