const char *icon_path);
int noti_ex_item_icon_get_icon_path(noti_ex_item_h handle, char **icon_path);
-int noti_ex_item_button_set_image(noti_ex_item_h handle, char *path);
+int noti_ex_item_button_set_image(noti_ex_item_h handle, const char *path);
int noti_ex_item_button_get_image(noti_ex_item_h handle, char **path);
int noti_ex_reporter_find_by_channel(noti_ex_reporter_h handle,
const char *channel, noti_ex_item_h **noti_list, int *count);
int noti_ex_reporter_find_all(noti_ex_reporter_h handle,
noti_ex_item_h **noti_list, int *count);
-int noti_ex_reporter_delete_by_channel(noti_ex_reporter_h handle, char *channel,
- int *request_id);
+int noti_ex_reporter_delete_by_channel(noti_ex_reporter_h handle,
+ const char *channel, int *request_id);
-int noti_ex_manager_delete_by_channel(noti_ex_manager_h handle, char *channel,
- int *request_id);
+int noti_ex_manager_delete_by_channel(noti_ex_manager_h handle,
+ const char *channel, int *request_id);
+int noti_ex_manager_delete_by_appid(noti_ex_manager_h handle,
+ const char *app_id, int *request_id);
#ifdef __cplusplus
}
return info.GetRequestId();
}
+int Manager::DeleteByAppId(string appId) {
+ Bundle serialized;
+ EventInfo info(EventInfo::DeleteAll, util::GetAppId(), "", appId);
+ list<Bundle> serialized_list {serialized};
+ impl_->sender_->Notify(info, serialized_list, util::GetAppId());
+ return info.GetRequestId();
+}
+
int Manager::GetCount() const {
EventInfo info(EventInfo::Count, util::GetAppId(), "");
int num = impl_->sender_->RequestNumber(info);
int Delete(std::shared_ptr<item::AbstractItem> noti);
int DeleteAll();
int DeleteByChannel(std::string channel);
+ int DeleteByAppId(std::string appId);
int Hide(std::shared_ptr<item::AbstractItem> noti);
std::unique_ptr<item::AbstractItem> FindByRootID(std::string id);
int SendEvent(const IEventInfo& info, std::shared_ptr<item::AbstractItem> noti);
}
extern "C" EXPORT_API int noti_ex_item_button_set_image(
- noti_ex_item_h handle, char *path) {
+ noti_ex_item_h handle, const char *path) {
if (handle == nullptr || path == nullptr) {
LOGE("Invalid parameter");
return NOTI_EX_ERROR_INVALID_PARAMETER;
}
extern "C" EXPORT_API int noti_ex_manager_delete_by_channel(
- noti_ex_manager_h handle, char* channel, int* request_id) {
+ noti_ex_manager_h handle, const char* channel, int* request_id) {
if (handle == nullptr || channel == nullptr || request_id == nullptr) {
LOGE("Invalid parameter");
return NOTI_EX_ERROR_INVALID_PARAMETER;
return NOTI_EX_ERROR_NONE;
}
+extern "C" EXPORT_API int noti_ex_manager_delete_by_appid(
+ noti_ex_manager_h handle, const char* app_id, int* request_id) {
+ if (handle == nullptr || app_id == nullptr || request_id == nullptr) {
+ LOGE("Invalid parameter");
+ return NOTI_EX_ERROR_INVALID_PARAMETER;
+ }
+
+ try {
+ ManagerStub* stub = static_cast<ManagerStub*>(handle);
+ *request_id = stub->DeleteByAppId(app_id);
+ } catch (Exception &ex) {
+ LOGE("%s %d", ex.what(), ex.GetErrorCode());
+ return NOTI_EX_ERROR_IO_ERROR;
+ }
+
+ return NOTI_EX_ERROR_NONE;
+}
+
extern "C" EXPORT_API int noti_ex_manager_hide(noti_ex_manager_h handle,
noti_ex_item_h noti, int *request_id) {
if (handle == nullptr || noti == nullptr || request_id == nullptr) {
}
extern "C" EXPORT_API int noti_ex_reporter_delete_by_channel(
- noti_ex_reporter_h handle, char* channel, int* request_id) {
+ noti_ex_reporter_h handle, const char* channel, int* request_id) {
if (handle == nullptr || channel == nullptr || request_id == nullptr) {
LOGE("Invalid parameter");
return NOTI_EX_ERROR_INVALID_PARAMETER;