Signed-off-by: m00512953 <mingxihua@huawei.com>
This commit is contained in:
m00512953 2022-08-08 15:24:23 +08:00
parent 916b7c9181
commit c334ed49b4

View File

@ -430,29 +430,6 @@ bool ConnectionStateItem::HandleDataAbilityDied(const sptr<IRemoteObject> &token
return true;
}
bool ConnectionStateItem::CheckTokenAndConnectionData(const sptr<IRemoteObject> &token,
AbilityRuntime::ConnectionData &data, std::shared_ptr<ConnectedDataAbility> &connectedDataAbility)
{
if (!token) {
HILOG_WARN("invalid data ability token.");
return false;
}
auto it = dataAbilityMap_.find(token);
if (it == dataAbilityMap_.end()) {
HILOG_ERROR("no such connected data ability.");
return false;
}
connectedDataAbility = it->second;
if (!connectedDataAbility) {
HILOG_ERROR("can not find such connectedDataAbility");
return false;
}
return true;
}
bool ConnectionStateItem::IsEmpty() const
{
return connectionMap_.empty() && dataAbilityMap_.empty();