!76 change connection callback interface token

Merge pull request !76 from Gymee/master
This commit is contained in:
openharmony_ci 2021-09-26 08:00:32 +00:00 committed by Gitee
commit 54e95dfb25
2 changed files with 9 additions and 3 deletions

View File

@ -22,12 +22,16 @@
namespace OHOS {
namespace DistributedSchedule {
namespace {
const std::u16string CONNECTION_CALLBACK_INTERFACE_TOKEN = u"ohos.abilityshell.DistributedConnection";
}
void AbilityConnectionWrapperProxy::OnAbilityConnectDone(const AppExecFwk::ElementName& element,
const sptr<IRemoteObject>& remoteObject, int32_t resultCode)
{
HILOGD("AbilityConnectionWrapperProxy::OnAbilityConnectDone called");
MessageParcel data;
if (!data.WriteInterfaceToken(IAbilityConnection::GetDescriptor())) {
if (!data.WriteInterfaceToken(CONNECTION_CALLBACK_INTERFACE_TOKEN)) {
return;
}
@ -45,7 +49,7 @@ void AbilityConnectionWrapperProxy::OnAbilityDisconnectDone(const AppExecFwk::El
{
HILOGD("AbilityConnectionWrapperProxy::OnAbilityDisconnectDone called");
MessageParcel data;
if (!data.WriteInterfaceToken(IAbilityConnection::GetDescriptor())) {
if (!data.WriteInterfaceToken(CONNECTION_CALLBACK_INTERFACE_TOKEN)) {
return;
}

View File

@ -45,6 +45,8 @@ using namespace AAFwk;
using namespace AppExecFwk;
namespace {
const std::u16string CONNECTION_CALLBACK_INTERFACE_TOKEN = u"ohos.abilityshell.DistributedConnection";
constexpr int32_t BIND_CONNECT_RETRY_TIMES = 3;
constexpr int32_t BIND_CONNECT_TIMEOUT = 500; // 500ms
constexpr int32_t MAX_DISTRIBUTED_CONNECT_NUM = 600;
@ -690,7 +692,7 @@ int32_t DistributedSchedService::NotifyApp(const sptr<IRemoteObject>& connect,
return OBJECT_NULL;
}
MessageParcel data;
if (!data.WriteInterfaceToken(IAbilityConnection::GetDescriptor())) {
if (!data.WriteInterfaceToken(CONNECTION_CALLBACK_INTERFACE_TOKEN)) {
return ERR_FLATTEN_OBJECT;
}
PARCEL_WRITE_HELPER(data, Parcelable, &element);