mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-23 07:10:19 +00:00
0719 Signed-off-by: 帝俊 <yexinjie@huawei.com>
This commit is contained in:
parent
87287553cd
commit
879aa77fe2
@ -35,8 +35,6 @@ public:
|
||||
private:
|
||||
int SendInner(MessageParcel &data, MessageParcel &reply);
|
||||
int PerformReceiveInner(MessageParcel &data, MessageParcel &reply);
|
||||
using RequestFuncType = int (WantReceiverStub::*)(MessageParcel &data, MessageParcel &reply);
|
||||
std::map<uint32_t, RequestFuncType> requestFuncMap_;
|
||||
};
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
||||
|
@ -34,8 +34,6 @@ public:
|
||||
|
||||
private:
|
||||
int SendInner(MessageParcel &data, MessageParcel &reply);
|
||||
using RequestFuncType = int (WantSenderStub::*)(MessageParcel &data, MessageParcel &reply);
|
||||
std::map<uint32_t, RequestFuncType> requestFuncMap_;
|
||||
};
|
||||
} // namespace AAFwk
|
||||
} // namespace OHOS
|
||||
|
@ -22,16 +22,9 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace AAFwk {
|
||||
WantReceiverStub::WantReceiverStub()
|
||||
{
|
||||
requestFuncMap_[WANT_RECEIVER_SEND] = &WantReceiverStub::SendInner;
|
||||
requestFuncMap_[WANT_RECEIVER_PERFORM_RECEIVE] = &WantReceiverStub::PerformReceiveInner;
|
||||
}
|
||||
WantReceiverStub::WantReceiverStub() {}
|
||||
|
||||
WantReceiverStub::~WantReceiverStub()
|
||||
{
|
||||
requestFuncMap_.clear();
|
||||
}
|
||||
WantReceiverStub::~WantReceiverStub() {}
|
||||
|
||||
int WantReceiverStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
@ -43,12 +36,11 @@ int WantReceiverStub::OnRemoteRequest(uint32_t code, MessageParcel &data, Messag
|
||||
return ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
auto itFunc = requestFuncMap_.find(code);
|
||||
if (itFunc != requestFuncMap_.end()) {
|
||||
auto requestFunc = itFunc->second;
|
||||
if (requestFunc != nullptr) {
|
||||
return (this->*requestFunc)(data, reply);
|
||||
}
|
||||
switch (code) {
|
||||
case WANT_RECEIVER_SEND:
|
||||
return SendInner(data, reply);
|
||||
case WANT_RECEIVER_PERFORM_RECEIVE:
|
||||
return PerformReceiveInner(data, reply);
|
||||
}
|
||||
TAG_LOGW(AAFwkTag::WANTAGENT, "WantReceiverStub::OnRemoteRequest, default case, need check.");
|
||||
return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
|
||||
|
@ -20,15 +20,9 @@
|
||||
|
||||
namespace OHOS {
|
||||
namespace AAFwk {
|
||||
WantSenderStub::WantSenderStub()
|
||||
{
|
||||
requestFuncMap_[WANT_SENDER_SEND] = &WantSenderStub::SendInner;
|
||||
}
|
||||
WantSenderStub::WantSenderStub() {}
|
||||
|
||||
WantSenderStub::~WantSenderStub()
|
||||
{
|
||||
requestFuncMap_.clear();
|
||||
}
|
||||
WantSenderStub::~WantSenderStub() {}
|
||||
|
||||
int WantSenderStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, MessageOption &option)
|
||||
{
|
||||
@ -40,12 +34,8 @@ int WantSenderStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageP
|
||||
return ERR_INVALID_STATE;
|
||||
}
|
||||
|
||||
auto itFunc = requestFuncMap_.find(code);
|
||||
if (itFunc != requestFuncMap_.end()) {
|
||||
auto requestFunc = itFunc->second;
|
||||
if (requestFunc != nullptr) {
|
||||
return (this->*requestFunc)(data, reply);
|
||||
}
|
||||
if (code == (WANT_SENDER_SEND)) {
|
||||
return SendInner(data, reply);
|
||||
}
|
||||
TAG_LOGW(AAFwkTag::WANTAGENT, "WantSenderStub::OnRemoteRequest, default case, need check.");
|
||||
return IPCObjectStub::OnRemoteRequest(code, data, reply, option);
|
||||
|
Loading…
Reference in New Issue
Block a user