use ani_rs::ani_constructor;
pub mod api10;
pub mod api9;
pub mod constant;
mod seq;
#[macro_use]
extern crate request_utils;
use hilog_rust::{HiLogLabel, LogType};
pub(crate) const LOG_LABEL: HiLogLabel = HiLogLabel {
log_type: LogType::LogCore,
domain: 0xD001C50,
tag: "RequestAni",
};
ani_constructor!(
namespace "@ohos.request.request"
[
"checkDownloadConfig": api9::download::check_config,
"checkUploadConfig": api9::upload::check_config,
"downloadFileSync": api9::download::download_file,
"uploadFileSync": api9::upload::upload_file,
]
class "@ohos.request.request.DownloadTaskInner"
[
"onProgressInner": api9::callback::on_progress,
"onEvent": api9::callback::on_event,
"onFailInner": api9::callback::on_fail,
"offProgressInner": api9::callback::off_progress,
"offEvent": api9::callback::off_event,
"offFailInner": api9::callback::off_fail,
"deleteSync": api9::download::delete,
"suspendSync": api9::download::suspend,
"restoreSync": api9::download::restore,
"getTaskInfoSync": api9::download::get_task_info,
"getTaskMimeTypeSync": api9::download::get_task_mime_type,
"offEvents": api9::callback::off_events,
]
class "@ohos.request.request.UploadTaskInner"
[
"deleteSync": api9::upload::delete,
"onProgressInner": api9::callback::on_progress_uploadtask,
"onEventInner": api9::callback::on_event_uploadtask,
"onHeaderReceiveInner": api9::callback::on_header_receive,
"offProgressInner": api9::callback::off_progress_uploadtask,
"offEventInner": api9::callback::off_event_uploadtask,
"offHeaderReceiveInner": api9::callback::off_header_receive,
"offEvents": api9::callback::off_events,
]
namespace "@ohos.request.request.agent"
[
"checkConfig": api10::agent::check_config,
"createSync": api10::agent::create,
"getTaskSync": api10::agent::get_task,
"removeSync": api10::agent::remove,
"showSync": api10::agent::show,
"checkToken": api10::agent::check_token,
"checkTid": api10::agent::check_tid,
"touchSync": api10::agent::touch,
"searchSync": api10::agent::search,
"querySync": api10::agent::query,
"checkGroupConfig": api10::notification::check_group_config,
"createGroupSync": api10::notification::create_group,
"attachGroupSync": api10::notification::attach_group,
"deleteGroupSync": api10::notification::delete_group,
]
class "@ohos.request.request.agent.TaskInner"
[
"startSync": api10::task::start,
"pauseSync": api10::task::pause,
"resumeSync": api10::task::resume,
"stopSync": api10::task::stop,
"onEvent": api10::callback::on_event,
"onResponseEvent": api10::callback::on_response_event,
"onFaultEvent": api10::callback::on_fault_event,
"onWaitEvent": api10::callback::on_wait_event,
"checkMaxSpeed": api10::task::check_max_speed,
"setMaxSpeedSync": api10::task::set_max_speed,
"offEvent": api10::callback::off_event,
"offResponseEvent": api10::callback::off_response_event,
"offFaultEvent": api10::callback::off_fault_event,
"offWaitEvent": api10::callback::off_wait_event,
"offEvents": api10::callback::off_events,
]
);
#[used]
#[link_section = ".init_array"]
static A: extern "C" fn() = {
#[link_section = ".text.startup"]
extern "C" fn init() {
info!("begin request service init");
std::panic::set_hook(Box::new(|info| {
info!("Panic occurred: {:?}", info);
}));
}
init
};