From 8acc54545c015896470a4540dac84569e4d249ab Mon Sep 17 00:00:00 2001 From: anyueling Date: Tue, 27 Jun 2023 16:59:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E9=9C=80=E6=B1=82=E3=80=91=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=9C=8D=E5=8A=A1=E6=8E=A5=E5=8F=A3=E7=AE=A1=E6=8E=A7?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: anyueling --- CODEOWNERS | 18 ++++ frameworks/js/napi/src/notify_stub.cpp | 17 ++-- .../download_server_ipc_interface_code.h | 46 ++++++++++ frameworks/native/include/notify_interface.h | 5 - .../include/request_service_interface.h | 17 ---- .../native/src/request_service_proxy.cpp | 30 +++--- services/service/rust/BUILD.gn | 1 + .../src/download_server_ipc_interface_code.rs | 55 +++++++++++ services/service/rust/src/lib.rs | 92 +++++++------------ .../rust/src/request_service_ability.rs | 6 +- 10 files changed, 178 insertions(+), 109 deletions(-) create mode 100644 CODEOWNERS create mode 100644 frameworks/native/include/download_server_ipc_interface_code.h create mode 100644 services/service/rust/src/download_server_ipc_interface_code.rs diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..9bcf156b --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,18 @@ +# Copyright (c) 2023 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# any change to frameworks/native/include/download_server_ipc_interface_code.h needs to be reviewed by @leonchan5 +frameworks/native/include/download_server_ipc_interface_code.h @leonchan5 + +# any change to services/service/rust/src/download_server_ipc_interface_code.rs needs to be reviewed by @leonchan5 +services/service/rust/src/download_server_ipc_interface_code.rs @leonchan5 diff --git a/frameworks/js/napi/src/notify_stub.cpp b/frameworks/js/napi/src/notify_stub.cpp index 002e0a57..eef02995 100644 --- a/frameworks/js/napi/src/notify_stub.cpp +++ b/frameworks/js/napi/src/notify_stub.cpp @@ -17,6 +17,7 @@ #include "request_event.h" #include "log.h" #include "parcel_helper.h" +#include "download_server_ipc_interface_code.h" namespace OHOS::Request { int32_t NotifyStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageParcel &reply, @@ -25,22 +26,20 @@ int32_t NotifyStub::OnRemoteRequest(uint32_t code, MessageParcel &data, MessageP auto descriptorToken = data.ReadInterfaceToken(); if (descriptorToken != GetDescriptor()) { REQUEST_HILOGE("Remote descriptor not the same as local descriptor."); - return E_SERVICE_ERROR; + return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } switch (code) { - case REQUEST_NOTIFY: { + case static_cast(RequestNotifyInterfaceCode::REQUEST_NOTIFY): OnCallBack(data); break; - } - case REQUEST_DONE_NOTIFY: { + case static_cast(RequestNotifyInterfaceCode::REQUEST_DONE_NOTIFY): OnDone(data); break; - } - default: { - return OHOS::UNKNOWN_TRANSACTION; - } + default: + REQUEST_HILOGE("Default value received, check needed."); + return IPCObjectStub::OnRemoteRequest(code, data, reply, option); } - return E_OK; + return ERR_NONE; } void NotifyStub::OnCallBack(MessageParcel &data) diff --git a/frameworks/native/include/download_server_ipc_interface_code.h b/frameworks/native/include/download_server_ipc_interface_code.h new file mode 100644 index 00000000..563d230d --- /dev/null +++ b/frameworks/native/include/download_server_ipc_interface_code.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef DOWNLOAD_SERVER_IPC_INTERFACE_CODE_H +#define DOWNLOAD_SERVER_IPC_INTERFACE_CODE_H + +/* SAID: 3706*/ +namespace OHOS { +namespace Request { +enum class RequestInterfaceCode { + CMD_REQUEST = 0, + CMD_PAUSE, + CMD_QUERY, + CMD_QUERYMIMETYPE, + CMD_REMOVE, + CMD_RESUME, + CMD_ON, + CMD_OFF, + CMD_START, + CMD_STOP, + CMD_SHOW, + CMD_TOUCH, + CMD_SEARCH, + CMD_CLEAR, +}; + +enum class RequestNotifyInterfaceCode { + REQUEST_NOTIFY = 0, + REQUEST_DONE_NOTIFY, +}; +} // namespace Request +} // namespace OHOS + +#endif //DOWNLOAD_SERVER_IPC_INTERFACE_CODE_H \ No newline at end of file diff --git a/frameworks/native/include/notify_interface.h b/frameworks/native/include/notify_interface.h index 8795ae62..44751e98 100644 --- a/frameworks/native/include/notify_interface.h +++ b/frameworks/native/include/notify_interface.h @@ -28,10 +28,5 @@ public: virtual void CallBack(const Notify ¬ify) = 0; virtual void Done(const TaskInfo &taskInfo) = 0; }; - -enum { - REQUEST_NOTIFY, - REQUEST_DONE_NOTIFY, -}; } // namespace OHOS::Request #endif // DOWNLOAD_NOTIFY_INTERFACE_H diff --git a/frameworks/native/include/request_service_interface.h b/frameworks/native/include/request_service_interface.h index 75832bf2..057eb656 100644 --- a/frameworks/native/include/request_service_interface.h +++ b/frameworks/native/include/request_service_interface.h @@ -45,22 +45,5 @@ public: const sptr &listener) = 0; virtual int32_t Off(const std::string &type, const std::string &tid) = 0; }; - -enum { - CMD_REQUEST, - CMD_PAUSE, - CMD_QUERY, - CMD_QUERYMIMETYPE, - CMD_REMOVE, - CMD_RESUME, - CMD_ON, - CMD_OFF, - CMD_START, - CMD_STOP, - CMD_SHOW, - CMD_TOUCH, - CMD_SEARCH, - CMD_CLEAR, -}; } // namespace OHOS::Request #endif // DOWNLOAD_SERVICE_INTERFACE_H \ No newline at end of file diff --git a/frameworks/native/src/request_service_proxy.cpp b/frameworks/native/src/request_service_proxy.cpp index 779dfba5..07b4c4b2 100644 --- a/frameworks/native/src/request_service_proxy.cpp +++ b/frameworks/native/src/request_service_proxy.cpp @@ -13,6 +13,7 @@ * limitations under the License. */ #include "request_service_proxy.h" +#include "download_server_ipc_interface_code.h" #include #include @@ -61,7 +62,7 @@ int32_t RequestServiceProxy::Create(const Config &config, int32_t &tid, sptrAsObject().GetRefPtr()); - int32_t ret = Remote()->SendRequest(CMD_REQUEST, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_REQUEST), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("SendRequest ret : %{public}d", ret); return E_SERVICE_ERROR; @@ -115,7 +116,7 @@ int32_t RequestServiceProxy::Start(const std::string &tid) data.WriteInterfaceToken(GetDescriptor()); data.WriteString(tid); REQUEST_HILOGD("Start."); - int32_t ret = Remote()->SendRequest(CMD_START, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_START), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -130,7 +131,7 @@ int32_t RequestServiceProxy::Stop(const std::string &tid) data.WriteInterfaceToken(GetDescriptor()); data.WriteString(tid); REQUEST_HILOGD("Stop"); - int32_t ret = Remote()->SendRequest(CMD_STOP, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_STOP), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -146,7 +147,7 @@ int32_t RequestServiceProxy::Show(const std::string &tid, TaskInfo &info) data.WriteUint32(static_cast(Version::API10)); data.WriteString(tid); REQUEST_HILOGD("Show"); - int32_t ret = Remote()->SendRequest(CMD_SHOW, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_SHOW), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -166,7 +167,7 @@ int32_t RequestServiceProxy::Touch(const std::string &tid, const std::string &to data.WriteInterfaceToken(RequestServiceProxy::GetDescriptor()); data.WriteString(tid); data.WriteString(token); - int32_t ret = Remote()->SendRequest(CMD_TOUCH, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_TOUCH), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -190,7 +191,7 @@ int32_t RequestServiceProxy::Search(const Filter &filter, std::vector(filter.state)); data.WriteUint32(static_cast(filter.action)); data.WriteUint32(static_cast(filter.mode)); - int32_t ret = Remote()->SendRequest(CMD_TOUCH, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_TOUCH), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -214,7 +215,7 @@ int32_t RequestServiceProxy::Clear(const std::vector &tids, std::ve for (auto tid : tids) { data.WriteString(tid); } - int32_t ret = Remote()->SendRequest(CMD_CLEAR, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_CLEAR), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -238,7 +239,7 @@ int32_t RequestServiceProxy::Query(const std::string &tid, TaskInfo &info, Versi data.WriteUint32(static_cast(version)); data.WriteString(tid); REQUEST_HILOGD("RequestServiceProxy Query started."); - int32_t ret = Remote()->SendRequest(CMD_QUERY, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_QUERY), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -260,7 +261,7 @@ int32_t RequestServiceProxy::Pause(const std::string &tid, Version version) data.WriteUint32(static_cast(version)); data.WriteString(tid); REQUEST_HILOGD("RequestServiceProxy Pause started."); - int32_t ret = Remote()->SendRequest(CMD_PAUSE, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_PAUSE), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -275,7 +276,8 @@ int32_t RequestServiceProxy::QueryMimeType(const std::string &tid, std::string & data.WriteInterfaceToken(RequestServiceProxy::GetDescriptor()); data.WriteString(tid); REQUEST_HILOGD("RequestServiceProxy QueryMimeType started."); - int32_t ret = Remote()->SendRequest(CMD_QUERYMIMETYPE, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_QUERYMIMETYPE), + data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -296,7 +298,7 @@ int32_t RequestServiceProxy::Remove(const std::string &tid, Version version) data.WriteUint32(static_cast(version)); data.WriteString(tid); REQUEST_HILOGD("RequestServiceProxy Remove started."); - int32_t ret = Remote()->SendRequest(CMD_REMOVE, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_REMOVE), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -311,7 +313,7 @@ int32_t RequestServiceProxy::Resume(const std::string &tid) data.WriteInterfaceToken(RequestServiceProxy::GetDescriptor()); data.WriteString(tid); REQUEST_HILOGD("RequestServiceProxy Resume started."); - int32_t ret = Remote()->SendRequest(CMD_RESUME, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_RESUME), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -329,7 +331,7 @@ int32_t RequestServiceProxy::On(const std::string &type, const std::string &tid, data.WriteString(type); data.WriteString(tid); data.WriteRemoteObject(listener->AsObject().GetRefPtr()); - int32_t ret = Remote()->SendRequest(CMD_ON, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_ON), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; @@ -345,7 +347,7 @@ int32_t RequestServiceProxy::Off(const std::string &type, const std::string &tid data.WriteInterfaceToken(GetDescriptor()); data.WriteString(type); data.WriteString(tid); - int32_t ret = Remote()->SendRequest(CMD_OFF, data, reply, option); + int32_t ret = Remote()->SendRequest(static_cast(RequestInterfaceCode::CMD_OFF), data, reply, option); if (ret != ERR_NONE) { REQUEST_HILOGE("send request ret code is %{public}d", ret); return E_SERVICE_ERROR; diff --git a/services/service/rust/BUILD.gn b/services/service/rust/BUILD.gn index d6b3a9e6..9cbde96e 100644 --- a/services/service/rust/BUILD.gn +++ b/services/service/rust/BUILD.gn @@ -53,6 +53,7 @@ ohos_rust_shared_library("download_server") { ohos_rust_shared_library("request") { sources = [ + "src/download_server_ipc_interface_code.rs", "src/enumration.rs", "src/form_item.rs", "src/lib.rs", diff --git a/services/service/rust/src/download_server_ipc_interface_code.rs b/services/service/rust/src/download_server_ipc_interface_code.rs new file mode 100644 index 00000000..d5ffcd15 --- /dev/null +++ b/services/service/rust/src/download_server_ipc_interface_code.rs @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2023 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* SAID: 3706*/ +/// Function code of RequestInterfaceCode +pub enum RequestInterfaceCode { + /// request construct & api10 create task + Construct = 0, + /// pause task + Pause, + /// query task || system api Queries specified task details + Query, + /// query mime type + QueryMimeType, + /// remove task || removes specifed task belongs to the caller + Remove, + /// resume task + Resume, + /// on task + On, + /// off task + Off, + /// ap10 start task + Start, + /// stop task + Stop, + /// Shows specified task details belongs to the caller + Show, + /// Touches specified task with token + Touch, + /// Searches tasks, for system + Search, + /// system api deletes specifed tasks + Clear, +} + +/// Function code of RequestNotifyInterfaceCode +pub enum RequestNotifyInterfaceCode { + /// callback notification + Notify = 0, + /// Cache callback notification + DoneNotify, +} \ No newline at end of file diff --git a/services/service/rust/src/lib.rs b/services/service/rust/src/lib.rs index c957c763..2dd809c4 100644 --- a/services/service/rust/src/lib.rs +++ b/services/service/rust/src/lib.rs @@ -29,6 +29,7 @@ pub mod form_item; mod log; pub mod progress; mod utils; +mod download_server_ipc_interface_code; use enumration::ErrorCode; use hilog_rust::*; @@ -45,57 +46,26 @@ use std::{ option::Option, }; use task_manager::*; +use download_server_ipc_interface_code::*; -/// Function code of RequestCode -pub enum RequestCode { - /// request construct & api10 create task - Construct = 0, - /// pause task - Pause, - /// query task || system api Queries specified task details - Query, - /// query mime type - QueryMimeType, - /// remove task || removes specifed task belongs to the caller - Remove, - /// resume task - Resume, - /// on task - On, - /// off task - Off, - /// ap10 start task - Start, - /// stop task - Stop, - /// Shows specified task details belongs to the caller - Show, - /// Touches specified task with token. - Touch, - /// Searches tasks, for system. - Search, - /// system api deletes specifed tasks. - Clear, -} - -impl TryFrom for RequestCode { +impl TryFrom for RequestInterfaceCode { type Error = IpcStatusCode; fn try_from(code: u32) -> IpcResult { match code { - _ if code == RequestCode::Construct as u32 => Ok(RequestCode::Construct), - _ if code == RequestCode::Pause as u32 => Ok(RequestCode::Pause), - _ if code == RequestCode::Query as u32 => Ok(RequestCode::Query), - _ if code == RequestCode::QueryMimeType as u32 => Ok(RequestCode::QueryMimeType), - _ if code == RequestCode::Remove as u32 => Ok(RequestCode::Remove), - _ if code == RequestCode::Resume as u32 => Ok(RequestCode::Resume), - _ if code == RequestCode::On as u32 => Ok(RequestCode::On), - _ if code == RequestCode::Off as u32 => Ok(RequestCode::Off), - _ if code == RequestCode::Start as u32 => Ok(RequestCode::Start), - _ if code == RequestCode::Stop as u32 => Ok(RequestCode::Stop), - _ if code == RequestCode::Show as u32 => Ok(RequestCode::Show), - _ if code == RequestCode::Touch as u32 => Ok(RequestCode::Touch), - _ if code == RequestCode::Search as u32 => Ok(RequestCode::Search), - _ if code == RequestCode::Clear as u32 => Ok(RequestCode::Clear), + _ if code == RequestInterfaceCode::Construct as u32 => Ok(RequestInterfaceCode::Construct), + _ if code == RequestInterfaceCode::Pause as u32 => Ok(RequestInterfaceCode::Pause), + _ if code == RequestInterfaceCode::Query as u32 => Ok(RequestInterfaceCode::Query), + _ if code == RequestInterfaceCode::QueryMimeType as u32 => Ok(RequestInterfaceCode::QueryMimeType), + _ if code == RequestInterfaceCode::Remove as u32 => Ok(RequestInterfaceCode::Remove), + _ if code == RequestInterfaceCode::Resume as u32 => Ok(RequestInterfaceCode::Resume), + _ if code == RequestInterfaceCode::On as u32 => Ok(RequestInterfaceCode::On), + _ if code == RequestInterfaceCode::Off as u32 => Ok(RequestInterfaceCode::Off), + _ if code == RequestInterfaceCode::Start as u32 => Ok(RequestInterfaceCode::Start), + _ if code == RequestInterfaceCode::Stop as u32 => Ok(RequestInterfaceCode::Stop), + _ if code == RequestInterfaceCode::Show as u32 => Ok(RequestInterfaceCode::Show), + _ if code == RequestInterfaceCode::Touch as u32 => Ok(RequestInterfaceCode::Touch), + _ if code == RequestInterfaceCode::Search as u32 => Ok(RequestInterfaceCode::Search), + _ if code == RequestInterfaceCode::Clear as u32 => Ok(RequestInterfaceCode::Clear), _ => Err(IpcStatusCode::Failed), } } @@ -153,20 +123,20 @@ fn on_remote_request( return Err(IpcStatusCode::Failed); } match code.try_into()? { - RequestCode::Construct => stub.construct(data, reply), - RequestCode::Pause => stub.pause(data, reply), - RequestCode::Query => stub.show(data, reply), - RequestCode::QueryMimeType => stub.query_mime_type(data, reply), - RequestCode::Remove => stub.remove(data, reply), - RequestCode::Resume => stub.resume(data, reply), - RequestCode::On => stub.on(data, reply), - RequestCode::Off => stub.off(data, reply), - RequestCode::Start => stub.start(data, reply), - RequestCode::Stop => stub.stop(data, reply), - RequestCode::Show => stub.show(data, reply), - RequestCode::Touch => stub.touch(data, reply), - RequestCode::Search => stub.search(data, reply), - RequestCode::Clear => stub.clear(data, reply), + RequestInterfaceCode::Construct => stub.construct(data, reply), + RequestInterfaceCode::Pause => stub.pause(data, reply), + RequestInterfaceCode::Query => stub.show(data, reply), + RequestInterfaceCode::QueryMimeType => stub.query_mime_type(data, reply), + RequestInterfaceCode::Remove => stub.remove(data, reply), + RequestInterfaceCode::Resume => stub.resume(data, reply), + RequestInterfaceCode::On => stub.on(data, reply), + RequestInterfaceCode::Off => stub.off(data, reply), + RequestInterfaceCode::Start => stub.start(data, reply), + RequestInterfaceCode::Stop => stub.stop(data, reply), + RequestInterfaceCode::Show => stub.show(data, reply), + RequestInterfaceCode::Touch => stub.touch(data, reply), + RequestInterfaceCode::Search => stub.search(data, reply), + RequestInterfaceCode::Clear => stub.clear(data, reply), } } diff --git a/services/service/rust/src/request_service_ability.rs b/services/service/rust/src/request_service_ability.rs index 1c3b19b0..6e0bb235 100644 --- a/services/service/rust/src/request_service_ability.rs +++ b/services/service/rust/src/request_service_ability.rs @@ -18,7 +18,7 @@ extern crate ipc_rust; extern crate system_ability_fwk_rust; use super::{ enumration::*, log::LOG_LABEL, progress::*, request_binding, task_config::TaskConfig, - task_info::TaskInfo, task_manager::*, + task_info::TaskInfo, task_manager::*, download_server_ipc_interface_code::*, }; use hilog_rust::*; use ipc_rust::{ @@ -317,7 +317,7 @@ impl RequestAbility { client_data.write(&(item.2)).ok(); } debug!(LOG_LABEL, "send_request"); - let reply = obj.send_request(0, &client_data, false).ok(); + let reply = obj.send_request(RequestNotifyInterfaceCode::Notify as u32, &client_data, false).ok(); return; } debug!(LOG_LABEL, "key not find"); @@ -400,7 +400,7 @@ impl RequestAbility { reply.write(&(item.2)).ok(); } debug!(LOG_LABEL, "send_request"); - let reply = obj.send_request(1, &reply, false).ok(); + let reply = obj.send_request(RequestNotifyInterfaceCode::DoneNotify as u32, &reply, false).ok(); RequestAbility::get_ability_instance().off(task_info.task_id, String::from("done")); }