SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
SET(ICONDIR "${PREFIX}/share/${PROJECT_NAME}")
SET(RESDIR "${PREFIX}/share/${PROJECT_NAME}")
-SET(DBDIR "/opt/dbspace")
+SET(DBDIR "/usr/dbspace")
SET(IMGDIR "${RESDIR}/images")
SET(DBFILE ".notification.db")
SET(MAJOR_VER 0)
./src/notification_status.c
./src/notification_ipc.c
./src/notification_setting.c
+ ./src/notification_internal.c
./src/notification_old.c)
SET(HEADERS-DEVEL
./include/notification.h
dbus-1
dbus-glib-1
com-core
+ appcore-common
capi-appfw-application
+ capi-appfw-app-manager
capi-appfw-package-manager
+ pkgmgr-info
edbus
elementary
ecore
+++ /dev/null
-#!/bin/sh
-
-source ./config
-
-export TET_INSTALL_PATH=$TET_INSTALL_HOST_PATH # tetware root path
-#export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-simulator # tetware target path
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target # tetware target path
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
+++ /dev/null
-#!/bin/sh
-. ./config
-
-export TET_INSTALL_PATH=$TET_INSTALL_TARGET_PATH # path to path
-#export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-simulator
-export TET_TARGET_PATH=$TET_INSTALL_PATH/tetware-target
-export PATH=$TET_TARGET_PATH/bin:$PATH
-export LD_LIBRARY_PATH=$TET_TARGET_PATH/lib/tet3:$LD_LIBRARY_PATH
-export TET_ROOT=$TET_TARGET_PATH
+++ /dev/null
-#!/bin/sh
-
-. ./_export_env.sh # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/build-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -c -p ./
-tcc -b -j $JOURNAL_RESULT -p ./
-grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
+++ /dev/null
-#!/bin/sh
-
-. ./_export_env.sh # setting environment variables
-
-export TET_SUITE_ROOT=`pwd`
-RESULT_DIR=results
-
-tcc -c -p ./ # executing tcc, with clean option (-c)
-rm -r $RESULT_DIR
-rm -r tet_tmp_dir
-rm testcase/tet_captured
+++ /dev/null
-PKG_NAME=notification
-TET_INSTALL_HOST_PATH=/var/tmp/dts_fw/TC/TETware
-TET_INSTALL_TARGET_PATH=/opt/home/$PKG_NAME/TETware
+++ /dev/null
-#!/bin/sh
-
-. ./config
-
-TC_PATH=/opt/home/$PKG_NAME
-
-echo $TC_PATH
-
-sdb shell "mkdir -p $TC_PATH"
-
-sdb push . $TC_PATH
-
-
+++ /dev/null
-#!/bin/sh
-
-source ./_export_target_env.sh
-
-export TET_SUITE_ROOT=`pwd`
-FILE_NAME_EXTENSION=`date +%s`
-
-RESULT_DIR=results
-HTML_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.html
-JOURNAL_RESULT=$RESULT_DIR/exec-tar-result-$FILE_NAME_EXTENSION.journal
-
-mkdir -p $RESULT_DIR
-
-tcc -e -j $JOURNAL_RESULT -p ./
-grw -c 7 -f chtml -o $HTML_RESULT $JOURNAL_RESULT
+++ /dev/null
-include ../config
-
-CC ?= gcc
-
-C_FILES = $(shell ls *.c)
-
-PKGS = $(PKG_NAME)
-PKGS += glib-2.0
-LDFLAGS = `pkg-config --libs $(PKGS)`
-LDFLAGS += $(TET_ROOT)/lib/tet3/tcm_s.o
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -ltcm_s
-LDFLAGS += -L$(TET_ROOT)/lib/tet3 -lapi_s
-
-CFLAGS = -I. `pkg-config --cflags $(PKGS)`
-CFLAGS += -I$(TET_ROOT)/inc/tet3
-CFLAGS += -Wall
-
-TCS := $(shell ls -1 *.c | cut -d. -f1)
-
-all: $(TCS)
-
-%: %.c
- $(CC) -o $@ $< $(CFLAGS) $(LDFLAGS)
-
-clean:
- rm -f $(TCS)
+++ /dev/null
-/testcase/utc_notification
-/testcase/utc_notification_list
-/testcase/utc_notification_setting
-/testcase/utc_notification_status
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <libintl.h>
-#include <tet_api.h>
-#include <notification.h>
-
-#define TEST_PKG "org.tizen.tetware"
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-static void startup(void);
-static void cleanup(void);
-
-static void utc_notification_create_1_n(void);
-static void utc_notification_create_2_n(void);
-static void utc_notification_create_1_p(void);
-static void utc_notification_create_2_p(void);
-static void utc_notification_set_image_n(void);
-static void utc_notification_set_image_p(void);
-static void utc_notification_get_image_n(void);
-static void utc_notification_get_image_p(void);
-static void utc_notification_set_time_n(void);
-static void utc_notification_set_time_p(void);
-static void utc_notification_get_time_n(void);
-static void utc_notification_get_time_p(void);
-static void utc_notification_get_insert_time_n(void);
-static void utc_notification_get_insert_time_p(void);
-static void utc_notification_set_text_n(void);
-static void utc_notification_set_text_p(void);
-static void utc_notification_get_text_n(void);
-static void utc_notification_get_text_p(void);
-static void utc_notification_set_text_domain_n(void);
-static void utc_notification_set_text_domain_p(void);
-static void utc_notification_get_text_domain_n(void);
-static void utc_notification_get_text_domain_p(void);
-static void utc_notification_set_time_to_text_n(void);
-static void utc_notification_set_time_to_text_p(void);
-static void utc_notification_get_time_from_text_n(void);
-static void utc_notification_get_time_from_text_p(void);
-static void utc_notification_set_sound_n(void);
-static void utc_notification_set_sound_p(void);
-static void utc_notification_get_sound_n(void);
-static void utc_notification_get_sound_p(void);
-static void utc_notification_set_vibration_n(void);
-static void utc_notification_set_vibration_p(void);
-static void utc_notification_get_vibration_n(void);
-static void utc_notification_get_vibration_p(void);
-static void utc_notification_set_led_n(void);
-static void utc_notification_set_led_p(void);
-static void utc_notification_get_led_n(void);
-static void utc_notification_get_led_p(void);
-static void utc_notification_set_led_time_period_n(void);
-static void utc_notification_set_led_time_period_p(void);
-static void utc_notification_get_led_time_period_n(void);
-static void utc_notification_get_led_time_period_p(void);
-static void utc_notification_set_application_n(void);
-static void utc_notification_set_application_p(void);
-static void utc_notification_get_application_n(void);
-static void utc_notification_get_application_p(void);
-static void utc_notification_set_launch_option_n(void);
-static void utc_notification_set_launch_option_p(void);
-static void utc_notification_get_launch_option_n(void);
-static void utc_notification_get_launch_option_p(void);
-static void utc_notification_set_execute_option_n(void);
-static void utc_notification_set_execute_option_p(void);
-static void utc_notification_get_execute_option_n(void);
-static void utc_notification_get_execute_option_p(void);
-static void utc_notification_set_property_n(void);
-static void utc_notification_set_property_p(void);
-static void utc_notification_get_property_n(void);
-static void utc_notification_get_property_p(void);
-static void utc_notification_set_display_applist_n(void);
-static void utc_notification_set_display_applist_p(void);
-static void utc_notification_get_display_applist_n(void);
-static void utc_notification_get_display_applist_p(void);
-static void utc_notification_set_size_n(void);
-static void utc_notification_set_size_p(void);
-static void utc_notification_get_size_n(void);
-static void utc_notification_get_size_p(void);
-static void utc_notification_set_progress_n(void);
-static void utc_notification_set_progress_p(void);
-static void utc_notification_get_progress_n(void);
-static void utc_notification_get_progress_p(void);
-static void utc_notification_set_pkgname_n(void);
-static void utc_notification_set_pkgname_p(void);
-static void utc_notification_get_pkgname_n(void);
-static void utc_notification_get_pkgname_p(void);
-static void utc_notification_set_layout_n(void);
-static void utc_notification_set_layout_p(void);
-static void utc_notification_get_layout_n(void);
-static void utc_notification_get_layout_p(void);
-static void utc_notification_get_id_n(void);
-static void utc_notification_get_id_p(void);
-static void utc_notification_get_type_n(void);
-static void utc_notification_get_type_p(void);
-static void utc_notification_insert_n(void);
-static void utc_notification_insert_p(void);
-static void utc_notification_clear_n(void);
-static void utc_notification_clear_p(void);
-static void utc_notification_update_n(void);
-static void utc_notification_update_p(void);
-static void utc_notification_delete_all_by_type_n(void);
-static void utc_notification_delete_all_by_type_p(void);
-static void utc_notification_delete_by_priv_id_n(void);
-static void utc_notification_delete_by_priv_id_p(void);
-static void utc_notification_delete_n(void);
-static void utc_notification_delete_p(void);
-static void utc_notification_update_progress_n(void);
-static void utc_notification_update_progress_p(void);
-static void utc_notification_update_size_n(void);
-static void utc_notification_update_size_p(void);
-static void utc_notification_update_content_n(void);
-static void utc_notification_update_content_p(void);
-static void utc_notification_new_1_n(void);
-static void utc_notification_new_2_n(void);
-static void utc_notification_new_1_p(void);
-static void utc_notification_new_2_p(void);
-static void utc_notification_load_n(void);
-static void utc_notification_load_p(void);
-static void utc_notification_clone_n(void);
-static void utc_notification_clone_p(void);
-static void utc_notification_free_n(void);
-static void utc_notification_free_p(void);
-static void utc_notification_resister_changed_cb_n(void);
-static void utc_notification_resister_changed_cb_p(void);
-static void utc_notification_unresister_changed_cb_n(void);
-static void utc_notification_unresister_changed_cb_p(void);
-static void utc_notification_register_detailed_changed_cb_n(void);
-static void utc_notification_register_detailed_changed_cb_p(void);
-static void utc_notification_unregister_detailed_changed_cb_n(void);
-static void utc_notification_unregister_detailed_changed_cb_p(void);
-static void utc_notification_get_count_n(void);
-static void utc_notification_get_count_p(void);
-static void utc_notification_get_list_n(void);
-static void utc_notification_get_list_p(void);
-static void utc_notification_get_grouping_list_n(void);
-static void utc_notification_get_grouping_list_p(void);
-static void utc_notification_get_detail_list_n(void);
-static void utc_notification_get_detail_list_p(void);
-static void utc_notification_free_list_n(void);
-static void utc_notification_free_list_p(void);
-static void utc_notification_op_get_data_n(void);
-static void utc_notification_op_get_data_p(void);
-static void utc_notification_is_service_ready_p(void);
-static void utc_notification_add_deferred_task_n(void);
-static void utc_notification_add_deferred_task_p(void);
-static void utc_notification_del_deferred_task_n(void);
-static void utc_notification_del_deferred_task_p(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-struct tet_testlist tet_testlist[] = {
- {utc_notification_create_1_n, NEGATIVE_TC_IDX},
- {utc_notification_create_2_n, NEGATIVE_TC_IDX},
- {utc_notification_create_1_p, POSITIVE_TC_IDX},
- {utc_notification_create_2_p, POSITIVE_TC_IDX},
- {utc_notification_set_image_n, NEGATIVE_TC_IDX},
- {utc_notification_set_image_p, POSITIVE_TC_IDX},
- {utc_notification_get_image_n, NEGATIVE_TC_IDX},
- {utc_notification_get_image_p, POSITIVE_TC_IDX},
- {utc_notification_set_time_n, NEGATIVE_TC_IDX},
- {utc_notification_set_time_p, POSITIVE_TC_IDX},
- {utc_notification_get_time_n, NEGATIVE_TC_IDX},
- {utc_notification_get_time_p, POSITIVE_TC_IDX},
- {utc_notification_get_insert_time_n, NEGATIVE_TC_IDX},
- {utc_notification_get_insert_time_p, POSITIVE_TC_IDX},
- {utc_notification_set_text_n, NEGATIVE_TC_IDX},
- {utc_notification_set_text_p, POSITIVE_TC_IDX},
- {utc_notification_get_text_n, NEGATIVE_TC_IDX},
- {utc_notification_get_text_p, POSITIVE_TC_IDX},
- {utc_notification_set_text_domain_n, NEGATIVE_TC_IDX},
- {utc_notification_set_text_domain_p, POSITIVE_TC_IDX},
- {utc_notification_get_text_domain_n, NEGATIVE_TC_IDX},
- {utc_notification_get_text_domain_p, POSITIVE_TC_IDX},
- {utc_notification_set_time_to_text_n, NEGATIVE_TC_IDX},
- {utc_notification_set_time_to_text_p, POSITIVE_TC_IDX},
- {utc_notification_get_time_from_text_n, NEGATIVE_TC_IDX},
- {utc_notification_get_time_from_text_p, POSITIVE_TC_IDX},
- {utc_notification_set_sound_n, NEGATIVE_TC_IDX},
- {utc_notification_set_sound_p, POSITIVE_TC_IDX},
- {utc_notification_get_sound_n, NEGATIVE_TC_IDX},
- {utc_notification_get_sound_p, POSITIVE_TC_IDX},
- {utc_notification_set_vibration_n, NEGATIVE_TC_IDX},
- {utc_notification_set_vibration_p, POSITIVE_TC_IDX},
- {utc_notification_get_vibration_n, NEGATIVE_TC_IDX},
- {utc_notification_get_vibration_p, POSITIVE_TC_IDX},
- {utc_notification_set_led_n, NEGATIVE_TC_IDX},
- {utc_notification_set_led_p, POSITIVE_TC_IDX},
- {utc_notification_get_led_n, NEGATIVE_TC_IDX},
- {utc_notification_get_led_p, POSITIVE_TC_IDX},
- {utc_notification_set_led_time_period_n, NEGATIVE_TC_IDX},
- {utc_notification_set_led_time_period_p, POSITIVE_TC_IDX},
- {utc_notification_get_led_time_period_n, NEGATIVE_TC_IDX},
- {utc_notification_get_led_time_period_p, POSITIVE_TC_IDX},
- {utc_notification_set_application_n, NEGATIVE_TC_IDX},
- {utc_notification_set_application_p, POSITIVE_TC_IDX},
- {utc_notification_get_application_n, NEGATIVE_TC_IDX},
- {utc_notification_get_application_p, POSITIVE_TC_IDX},
- {utc_notification_set_launch_option_n, NEGATIVE_TC_IDX},
- {utc_notification_set_launch_option_p, POSITIVE_TC_IDX},
- {utc_notification_get_launch_option_n, NEGATIVE_TC_IDX},
- {utc_notification_get_launch_option_p, POSITIVE_TC_IDX},
- {utc_notification_set_execute_option_n, NEGATIVE_TC_IDX},
- {utc_notification_set_execute_option_p, POSITIVE_TC_IDX},
- {utc_notification_get_execute_option_n, NEGATIVE_TC_IDX},
- {utc_notification_get_execute_option_p, POSITIVE_TC_IDX},
- {utc_notification_set_property_n, NEGATIVE_TC_IDX},
- {utc_notification_set_property_p, POSITIVE_TC_IDX},
- {utc_notification_get_property_n, NEGATIVE_TC_IDX},
- {utc_notification_get_property_p, POSITIVE_TC_IDX},
- {utc_notification_set_display_applist_n, NEGATIVE_TC_IDX},
- {utc_notification_set_display_applist_p, POSITIVE_TC_IDX},
- {utc_notification_get_display_applist_n, NEGATIVE_TC_IDX},
- {utc_notification_get_display_applist_p, POSITIVE_TC_IDX},
- {utc_notification_set_size_n, NEGATIVE_TC_IDX},
- {utc_notification_set_size_p, POSITIVE_TC_IDX},
- {utc_notification_get_size_n, NEGATIVE_TC_IDX},
- {utc_notification_get_size_p, POSITIVE_TC_IDX},
- {utc_notification_set_progress_n, NEGATIVE_TC_IDX},
- {utc_notification_set_progress_p, POSITIVE_TC_IDX},
- {utc_notification_get_progress_n, NEGATIVE_TC_IDX},
- {utc_notification_get_progress_p, POSITIVE_TC_IDX},
- {utc_notification_set_pkgname_n, NEGATIVE_TC_IDX},
- {utc_notification_set_pkgname_p, POSITIVE_TC_IDX},
- {utc_notification_get_pkgname_n, NEGATIVE_TC_IDX},
- {utc_notification_get_pkgname_p, POSITIVE_TC_IDX},
- {utc_notification_set_layout_n, NEGATIVE_TC_IDX},
- {utc_notification_set_layout_p, POSITIVE_TC_IDX},
- {utc_notification_get_layout_n, NEGATIVE_TC_IDX},
- {utc_notification_get_layout_p, POSITIVE_TC_IDX},
- {utc_notification_get_id_n, NEGATIVE_TC_IDX},
- {utc_notification_get_id_p, POSITIVE_TC_IDX},
- {utc_notification_get_type_n, NEGATIVE_TC_IDX},
- {utc_notification_get_type_p, POSITIVE_TC_IDX},
- {utc_notification_insert_n, NEGATIVE_TC_IDX},
- {utc_notification_insert_p, POSITIVE_TC_IDX},
- {utc_notification_clear_n, NEGATIVE_TC_IDX},
- {utc_notification_clear_p, POSITIVE_TC_IDX},
- {utc_notification_update_n, NEGATIVE_TC_IDX},
- {utc_notification_update_p, POSITIVE_TC_IDX},
- {utc_notification_delete_all_by_type_n, NEGATIVE_TC_IDX},
- {utc_notification_delete_all_by_type_p, POSITIVE_TC_IDX},
- {utc_notification_delete_by_priv_id_n, NEGATIVE_TC_IDX},
- {utc_notification_delete_by_priv_id_p, POSITIVE_TC_IDX},
- {utc_notification_delete_n, NEGATIVE_TC_IDX},
- {utc_notification_delete_p, POSITIVE_TC_IDX},
- {utc_notification_update_progress_n, NEGATIVE_TC_IDX},
- {utc_notification_update_progress_p, POSITIVE_TC_IDX},
- {utc_notification_update_size_n, NEGATIVE_TC_IDX},
- {utc_notification_update_size_p, POSITIVE_TC_IDX},
- {utc_notification_update_content_n, NEGATIVE_TC_IDX},
- {utc_notification_update_content_p, POSITIVE_TC_IDX},
- {utc_notification_new_1_n, NEGATIVE_TC_IDX},
- {utc_notification_new_2_n, NEGATIVE_TC_IDX},
- {utc_notification_new_1_p, POSITIVE_TC_IDX},
- {utc_notification_new_2_p, POSITIVE_TC_IDX},
- {utc_notification_load_n, NEGATIVE_TC_IDX},
- {utc_notification_load_p, POSITIVE_TC_IDX},
- {utc_notification_clone_n, NEGATIVE_TC_IDX},
- {utc_notification_clone_p, POSITIVE_TC_IDX},
- {utc_notification_free_n, NEGATIVE_TC_IDX},
- {utc_notification_free_p, POSITIVE_TC_IDX},
- {utc_notification_resister_changed_cb_n, NEGATIVE_TC_IDX},
- {utc_notification_resister_changed_cb_p, POSITIVE_TC_IDX},
- {utc_notification_unresister_changed_cb_n, NEGATIVE_TC_IDX},
- {utc_notification_unresister_changed_cb_p, POSITIVE_TC_IDX},
- {utc_notification_register_detailed_changed_cb_n, NEGATIVE_TC_IDX},
- {utc_notification_register_detailed_changed_cb_p, POSITIVE_TC_IDX},
- {utc_notification_unregister_detailed_changed_cb_n, NEGATIVE_TC_IDX},
- {utc_notification_unregister_detailed_changed_cb_p, POSITIVE_TC_IDX},
- {utc_notification_get_count_n, NEGATIVE_TC_IDX},
- {utc_notification_get_count_p, POSITIVE_TC_IDX},
- {utc_notification_get_list_n, NEGATIVE_TC_IDX},
- {utc_notification_get_list_p, POSITIVE_TC_IDX},
- {utc_notification_get_grouping_list_n, NEGATIVE_TC_IDX},
- {utc_notification_get_grouping_list_p, POSITIVE_TC_IDX},
- {utc_notification_get_detail_list_n, NEGATIVE_TC_IDX},
- {utc_notification_get_detail_list_p, POSITIVE_TC_IDX},
- {utc_notification_free_list_n, NEGATIVE_TC_IDX},
- {utc_notification_free_list_p, POSITIVE_TC_IDX},
- {utc_notification_op_get_data_n, NEGATIVE_TC_IDX},
- {utc_notification_op_get_data_p, POSITIVE_TC_IDX},
- {utc_notification_is_service_ready_p, POSITIVE_TC_IDX},
- {utc_notification_add_deferred_task_n, NEGATIVE_TC_IDX},
- {utc_notification_add_deferred_task_p, POSITIVE_TC_IDX},
- {utc_notification_del_deferred_task_n, NEGATIVE_TC_IDX},
- {utc_notification_del_deferred_task_p, POSITIVE_TC_IDX},
- { NULL, 0 },
-};
-
-static void startup(void)
-{
- /* start of TC */
- notification_clear(NOTIFICATION_TYPE_NONE);
- tet_printf("\n TC start");
-}
-
-
-static void cleanup(void)
-{
- /* end of TC */
- tet_printf("\n TC end");
-}
-
-static void _changed_cb(void *data, notification_type_e type)
-{
-}
-
-static void _detailed_changed_cb(void *data, notification_type_e type, notification_op *op_list, int num_op)
-{
-}
-
-static void _deffered_job_cb(void *data)
-{
-}
-
-/**
- * @brief Negative test case of notification_create()
- */
-static void utc_notification_create_1_n(void)
-{
- notification_h notification = NULL;
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NONE);
- dts_check_eq("notification_create", notification, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_create()
- */
-static void utc_notification_create_2_n(void)
-{
- notification_h notification = NULL;
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_MAX);
- dts_check_eq("notification_create", notification, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_create()
- */
-static void utc_notification_create_1_p(void)
-{
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- dts_check_ne("notification_create", notification, NULL,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_create()
- */
-static void utc_notification_create_2_p(void)
-{
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- dts_check_ne("notification_create", notification, NULL,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_image()
- */
-static void utc_notification_set_image_n(void)
-{
- int ret = 0;
-
- ret = notification_set_image(NULL, NOTIFICATION_IMAGE_TYPE_ICON, NULL);
-
- dts_check_eq("notification_set_image", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_image()
- */
-static void utc_notification_set_image_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_image(notification, NOTIFICATION_IMAGE_TYPE_ICON, "test.png");
-
- dts_check_eq("notification_set_image", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_image()
- */
-static void utc_notification_get_image_n(void)
-{
- int ret = 0;
-
- ret = notification_get_image(NULL, NOTIFICATION_IMAGE_TYPE_ICON, NULL);
-
- dts_check_eq("notification_get_image", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_image()
- */
-static void utc_notification_get_image_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- char *image = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_image(notification, NOTIFICATION_IMAGE_TYPE_ICON, &image);
-
- dts_check_eq("notification_get_image", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_time()
- */
-static void utc_notification_set_time_n(void)
-{
- int ret = 0;
-
- ret = notification_set_time(NULL, 0);
-
- dts_check_eq("notification_set_time", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_time()
- */
-static void utc_notification_set_time_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_time(notification, 0xFFFFFFF);
-
- dts_check_eq("notification_set_time", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_time()
- */
-static void utc_notification_get_time_n(void)
-{
- int ret = 0;
-
- ret = notification_get_time(NULL, NULL);
-
- dts_check_eq("notification_get_time", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_time()
- */
-static void utc_notification_get_time_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- time_t t = 0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_time(notification, &t);
-
- dts_check_eq("notification_get_time", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_insert_time()
- */
-static void utc_notification_get_insert_time_n(void)
-{
- int ret = 0;
-
- ret = notification_get_insert_time(NULL, NULL);
-
- dts_check_eq("notification_get_insert_time", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_insert_time()
- */
-static void utc_notification_get_insert_time_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- time_t t = 0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_insert_time(notification, &t);
-
- dts_check_eq("notification_get_insert_time", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_text()
- */
-static void utc_notification_set_text_n(void)
-{
- int ret = 0;
-
- ret = notification_set_text(NULL, NOTIFICATION_TEXT_TYPE_NONE, NULL, NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
-
- dts_check_eq("notification_set_text", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_text()
- */
-static void utc_notification_set_text_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "test", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
-
- dts_check_eq("notification_set_text", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_text()
- */
-static void utc_notification_get_text_n(void)
-{
- int ret = 0;
-
- ret = notification_get_text(NULL, NOTIFICATION_TEXT_TYPE_TITLE, NULL);
-
- dts_check_eq("notification_get_text", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_text()
- */
-static void utc_notification_get_text_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- char *value = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, &value);
-
- dts_check_eq("notification_get_text", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_text_domain()
- */
-static void utc_notification_set_text_domain_n(void)
-{
- int ret = 0;
-
- ret = notification_set_text_domain(NULL, NULL, NULL);
-
- dts_check_eq("notification_set_text_domain", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_text_domain()
- */
-static void utc_notification_set_text_domain_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_text_domain(notification, "domain", "domain.po");
-
- dts_check_eq("notification_set_text_domain", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_text_domain()
- */
-static void utc_notification_get_text_domain_n(void)
-{
- int ret = 0;
-
- ret = notification_get_text_domain(NULL, NULL, NULL);
-
- dts_check_eq("notification_get_text_domain", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_text_domain()
- */
-static void utc_notification_get_text_domain_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- char *value1 = NULL;
- char *value2 = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_text_domain(notification, &value1, &value2);
-
- dts_check_eq("notification_get_text_domain", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_time_to_text()
- */
-static void utc_notification_set_time_to_text_n(void)
-{
- int ret = 0;
-
- ret = notification_set_time_to_text(NULL, NOTIFICATION_TEXT_TYPE_NONE, 0);
-
- dts_check_eq("notification_set_time_to_text", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_time_to_text()
- */
-static void utc_notification_set_time_to_text_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_time_to_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, time(NULL));
-
- dts_check_eq("notification_set_time_to_text", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_time_from_text()
- */
-static void utc_notification_get_time_from_text_n(void)
-{
- int ret = 0;
-
- ret = notification_get_time_from_text(NULL, NOTIFICATION_TEXT_TYPE_TITLE, NULL);
-
- dts_check_eq("notification_get_time_from_text", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_time_from_text()
- */
-static void utc_notification_get_time_from_text_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- time_t t = 0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_time_to_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, time(NULL));
- ret = notification_get_time_from_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, &t);
-
- dts_check_eq("notification_get_time_from_text", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_sound()
- */
-static void utc_notification_set_sound_n(void)
-{
- int ret = 0;
-
- ret = notification_set_sound(NULL, NOTIFICATION_SOUND_TYPE_MAX, NULL);
-
- dts_check_eq("notification_set_sound", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_sound()
- */
-static void utc_notification_set_sound_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_sound(notification, NOTIFICATION_SOUND_TYPE_DEFAULT, "path");
-
- dts_check_eq("notification_set_sound", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_sound()
- */
-static void utc_notification_get_sound_n(void)
-{
- int ret = 0;
-
- ret = notification_get_sound(NULL, NULL, NULL);
-
- dts_check_eq("notification_get_sound", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_sound()
- */
-static void utc_notification_get_sound_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- notification_sound_type_e type;
- const char *value = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_sound(notification, &type, &value);
-
- dts_check_eq("notification_get_sound", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_vibration()
- */
-static void utc_notification_set_vibration_n(void)
-{
- int ret = 0;
-
- ret = notification_set_vibration(NULL, NOTIFICATION_VIBRATION_TYPE_MAX, NULL);
-
- dts_check_eq("notification_set_vibration", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_vibration()
- */
-static void utc_notification_set_vibration_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_vibration(notification, NOTIFICATION_VIBRATION_TYPE_DEFAULT, "path");
-
- dts_check_eq("notification_set_vibration", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_vibration()
- */
-static void utc_notification_get_vibration_n(void)
-{
- int ret = 0;
-
- ret = notification_get_vibration(NULL, NULL, NULL);
-
- dts_check_eq("notification_get_vibration", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_vibration()
- */
-static void utc_notification_get_vibration_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- notification_vibration_type_e type;
- const char *value = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_vibration(notification, &type, &value);
-
- dts_check_eq("notification_get_vibration", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_led()
- */
-static void utc_notification_set_led_n(void)
-{
- int ret = 0;
-
- ret = notification_set_led(NULL, NOTIFICATION_LED_OP_MAX, 0);
-
- dts_check_eq("notification_set_led", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_led()
- */
-static void utc_notification_set_led_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_led(notification, NOTIFICATION_LED_OP_ON, 0);
-
- dts_check_eq("notification_set_led", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_led()
- */
-static void utc_notification_get_led_n(void)
-{
- int ret = 0;
-
- ret = notification_get_led(NULL, NULL, NULL);
-
- dts_check_eq("notification_get_led", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_led()
- */
-static void utc_notification_get_led_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- notification_led_op_e type;
- int value = 0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_led(notification, &type, &value);
-
- dts_check_eq("notification_get_led", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_led_time_period()
- */
-static void utc_notification_set_led_time_period_n(void)
-{
- int ret = 0;
-
- ret = notification_set_led_time_period(NULL, 0, 0);
-
- dts_check_eq("notification_set_led_time_period", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_led_time_period()
- */
-static void utc_notification_set_led_time_period_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_led_time_period(notification, 10, 10);
-
- dts_check_eq("notification_set_led_time_period", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_led_time_period()
- */
-static void utc_notification_get_led_time_period_n(void)
-{
- int ret = 0;
-
- ret = notification_get_led_time_period(NULL, NULL, NULL);
-
- dts_check_eq("notification_get_led_time_period", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_led_time_period()
- */
-static void utc_notification_get_led_time_period_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- int value1 = 0;
- int value2 = 0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_led_time_period(notification, &value1, &value2);
-
- dts_check_eq("notification_get_led_time_period", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_application()
- */
-static void utc_notification_set_application_n(void)
-{
- int ret = 0;
-
- ret = notification_set_application(NULL, NULL);
-
- dts_check_eq("notification_set_application", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_application()
- */
-static void utc_notification_set_application_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_application(notification, "org.tizen.quickpanel");
-
- dts_check_eq("notification_set_application", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_application()
- */
-static void utc_notification_get_application_n(void)
-{
- int ret = 0;
-
- ret = notification_get_application(NULL, NULL);
-
- dts_check_eq("notification_get_application", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_application()
- */
-static void utc_notification_get_application_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- char *value = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_application(notification, &value);
-
- dts_check_eq("notification_get_application", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_launch()
- */
-static void utc_notification_set_launch_option_n(void)
-{
- int ret = 0;
-
- ret = notification_set_launch_option(NULL, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, NULL);
-
- dts_check_eq("notification_set_launch_option", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_launch_option()
- */
-static void utc_notification_set_launch_option_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- app_control_h app_control = NULL;
- bundle *b = NULL;
-
- app_control_create(&app_control);
- app_control_set_app_id(app_control, "org.tizen.app");
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_launch_option(notification, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, app_control);
- app_control_destroy(app_control);
-
- dts_check_eq("notification_set_launch_option", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_launch_option()
- */
-static void utc_notification_get_launch_option_n(void)
-{
- int ret = 0;
- app_control_h app_control = NULL;
-
- ret = notification_get_launch_option(NULL, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, NULL);
-
- dts_check_eq("notification_get_launch_option", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_launch_option()
- */
-static void utc_notification_get_launch_option_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- app_control_h app_control = NULL;
-
- app_control_create(&app_control);
- app_control_set_app_id(app_control, "org.tizen.app");
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_launch_option(notification, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, app_control);
- app_control_destroy(app_control);
- app_control = NULL;
-
- ret = notification_get_launch_option(notification, NOTIFICATION_LAUNCH_OPTION_APP_CONTROL, &app_control);
- notification_free(notification);
-
- dts_check_eq("notification_get_launch_option", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_execute_option()
- */
-static void utc_notification_set_execute_option_n(void)
-{
- int ret = 0;
-
- ret = notification_set_execute_option(NULL, NOTIFICATION_EXECUTE_TYPE_NONE, NULL, NULL, NULL);
-
- dts_check_eq("notification_set_execute_option", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_execute_option()
- */
-static void utc_notification_set_execute_option_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- bundle *b = NULL;
-
- b = bundle_create();
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_execute_option(notification, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b);
-
- dts_check_eq("notification_set_execute_option", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_execute_option()
- */
-static void utc_notification_get_execute_option_n(void)
-{
- int ret = 0;
-
- ret = notification_get_execute_option(NULL, NOTIFICATION_EXECUTE_TYPE_NONE, NULL, NULL);
-
- dts_check_eq("notification_get_execute_option", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_execute_option()
- */
-static void utc_notification_get_execute_option_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- bundle *b = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_execute_option(notification, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, &b);
-
- dts_check_eq("notification_get_execute_option", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_property()
- */
-static void utc_notification_set_property_n(void)
-{
- int ret = 0;
-
- ret = notification_set_property(NULL, 0);
-
- dts_check_eq("notification_set_property", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_property()
- */
-static void utc_notification_set_property_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_property(notification, NOTIFICATION_PROP_DISABLE_AUTO_DELETE);
-
- dts_check_eq("notification_set_property", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_property()
- */
-static void utc_notification_get_property_n(void)
-{
- int ret = 0;
-
- ret = notification_get_property(NULL, NULL);
-
- dts_check_eq("notification_get_property", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_property()
- */
-static void utc_notification_get_property_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- int value = 0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_property(notification, &value);
-
- dts_check_eq("notification_get_property", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_display_applist()
- */
-static void utc_notification_set_display_applist_n(void)
-{
- int ret = 0;
-
- ret = notification_set_display_applist(NULL, 0);
-
- dts_check_eq("notification_set_display_applist", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_display_applist()
- */
-static void utc_notification_set_display_applist_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_display_applist(notification, NOTIFICATION_DISPLAY_APP_ALL);
-
- dts_check_eq("notification_set_display_applist", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_display_applist()
- */
-static void utc_notification_get_display_applist_n(void)
-{
- int ret = 0;
-
- ret = notification_get_display_applist(NULL, NULL);
-
- dts_check_eq("notification_get_display_applist", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_display_applist()
- */
-static void utc_notification_get_display_applist_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- int value = 0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_display_applist(notification, &value);
-
- dts_check_eq("notification_get_display_applist", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_size()
- */
-static void utc_notification_set_size_n(void)
-{
- int ret = 0;
-
- ret = notification_set_size(NULL, 0.0);
-
- dts_check_eq("notification_set_size", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_size()
- */
-static void utc_notification_set_size_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_size(notification, 0.5);
-
- dts_check_eq("notification_set_size", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_size()
- */
-static void utc_notification_get_size_n(void)
-{
- int ret = 0;
-
- ret = notification_get_size(NULL, NULL);
-
- dts_check_eq("notification_get_size", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_size()
- */
-static void utc_notification_get_size_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- double value = 0.0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_size(notification, &value);
-
- dts_check_eq("notification_get_size", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_progress()
- */
-static void utc_notification_set_progress_n(void)
-{
- int ret = 0;
-
- ret = notification_set_progress(NULL, 0.0);
-
- dts_check_eq("notification_set_progress", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_progress()
- */
-static void utc_notification_set_progress_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_progress(notification, 0.5);
-
- dts_check_eq("notification_set_progress", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_progress()
- */
-static void utc_notification_get_progress_n(void)
-{
- int ret = 0;
-
- ret = notification_get_progress(NULL, NULL);
-
- dts_check_eq("notification_get_progress", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_progress()
- */
-static void utc_notification_get_progress_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- double value = 0.0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_progress(notification, &value);
-
- dts_check_eq("notification_get_progress", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_pkgname()
- */
-static void utc_notification_set_pkgname_n(void)
-{
- int ret = 0;
-
- ret = notification_set_pkgname(NULL, NULL);
-
- dts_check_eq("notification_set_pkgname", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_pkgname()
- */
-static void utc_notification_set_pkgname_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_pkgname(notification, "org.tizen.quickpanel");
-
- dts_check_eq("notification_set_pkgname", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_pkgname()
- */
-static void utc_notification_get_pkgname_n(void)
-{
- int ret = 0;
-
- ret = notification_get_pkgname(NULL, NULL);
-
- dts_check_eq("notification_get_pkgname", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_pkgname()
- */
-static void utc_notification_get_pkgname_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- char *value = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_pkgname(notification, &value);
-
- dts_check_eq("notification_get_pkgname", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_set_layout()
- */
-static void utc_notification_set_layout_n(void)
-{
- int ret = 0;
-
- ret = notification_set_layout(NULL, NOTIFICATION_LY_NONE);
-
- dts_check_eq("notification_set_layout", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_set_layout()
- */
-static void utc_notification_set_layout_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_set_layout(notification, NOTIFICATION_LY_NOTI_EVENT_SINGLE);
-
- dts_check_eq("notification_set_layout", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_layout()
- */
-static void utc_notification_get_layout_n(void)
-{
- int ret = 0;
-
- ret = notification_get_layout(NULL, NULL);
-
- dts_check_eq("notification_get_layout", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_layout()
- */
-static void utc_notification_get_layout_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- notification_ly_type_e type;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_layout(notification, &type);
-
- dts_check_eq("notification_get_layout", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_id()
- */
-static void utc_notification_get_id_n(void)
-{
- int ret = 0;
-
- ret = notification_get_id(NULL, NULL, NULL);
-
- dts_check_eq("notification_get_id", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_id()
- */
-static void utc_notification_get_id_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- int value = 0;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_id(notification, NULL, &value);
-
- dts_check_eq("notification_get_id", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_type()
- */
-static void utc_notification_get_type_n(void)
-{
- int ret = 0;
-
- ret = notification_get_type(NULL, NULL);
-
- dts_check_eq("notification_get_type", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_type()
- */
-static void utc_notification_get_type_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- notification_type_e type;
-
- /*Invalid parameter test*/
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- ret = notification_get_type(notification, &type);
-
- dts_check_eq("notification_get_type", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_insert()
- */
-static void utc_notification_insert_n(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "test", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- ret = notification_insert(NULL, NULL);
-
- dts_check_eq("notification_insert", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_insert()
- */
-static void utc_notification_insert_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "test", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- ret = notification_insert(notification, NULL);
-
- dts_check_eq("notification_insert", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_clear()
- */
-static void utc_notification_clear_n(void)
-{
- int ret = 0;
-
- ret = notification_clear(NOTIFICATION_TYPE_MAX);
- dts_check_eq("notification_clear", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_clear()
- */
-static void utc_notification_clear_p(void)
-{
- int ret = 0;
-
- ret = notification_clear(NOTIFICATION_TYPE_NOTI);
- dts_check_eq("notification_clear", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_update()
- */
-static void utc_notification_update_n(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "test", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, NULL);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "updated", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- ret = notification_update(NULL);
-
- dts_check_eq("notification_update", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_update()
- */
-static void utc_notification_update_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "test", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, NULL);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "updated", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- ret = notification_update(notification);
-
- dts_check_eq("notification_update", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_delete_all_by_type()
- */
-static void utc_notification_delete_all_by_type_n(void)
-{
- int ret = 0;
-
- ret = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_MAX);
- dts_check_eq("notification_delete_all_by_type", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_delete_all_by_type()
- */
-static void utc_notification_delete_all_by_type_p(void)
-{
- int ret = 0;
-
- ret = notification_delete_all_by_type(NULL, NOTIFICATION_TYPE_NOTI);
- dts_check_eq("notification_delete_all_by_type", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_delete_by_priv_id()
- */
-static void utc_notification_delete_by_priv_id_n(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "privid_delete", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, &priv_id);
-
- ret = notification_delete_by_priv_id(TEST_PKG, NOTIFICATION_TYPE_NOTI, NOTIFICATION_PRIV_ID_NONE);
- dts_check_eq("notification_delete_by_priv_id", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_delete_by_priv_id()
- */
-static void utc_notification_delete_by_priv_id_p(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "privid_delete", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, &priv_id);
-
- ret = notification_delete_by_priv_id(TEST_PKG, NOTIFICATION_TYPE_NOTI, priv_id);
- dts_check_eq("notification_delete_by_priv_id", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_delete()
- */
-static void utc_notification_delete_n(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "privid_delete", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, &priv_id);
-
- ret = notification_delete(NULL);
- dts_check_eq("notification_delete", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_delete()
- */
-static void utc_notification_delete_p(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "privid_delete", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, &priv_id);
-
- ret = notification_delete(notification);
- dts_check_eq("notification_delete", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_update_progress()
- */
-static void utc_notification_update_progress_n(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "progress_test-N", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_set_progress(notification, 0.1);
- notification_insert(notification, &priv_id);
-
- sleep(3);
-
- ret = notification_update_progress(NULL, NOTIFICATION_PRIV_ID_NONE, 0.9);
- dts_check_eq("notification_update_progress", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_update_progress()
- */
-static void utc_notification_update_progress_p(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "progress_test-P", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_set_progress(notification, 0.1);
- notification_insert(notification, &priv_id);
-
- sleep(3);
-
- ret = notification_update_progress(notification, priv_id, 0.9);
- dts_check_eq("notification_update_progress", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_update_size()
- */
-static void utc_notification_update_size_n(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "size_test-N", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_set_size(notification, 1000);
- notification_insert(notification, &priv_id);
-
- sleep(3);
-
- ret = notification_update_size(NULL, NOTIFICATION_PRIV_ID_NONE, 10000000);
- dts_check_eq("notification_update_size", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_update_size()
- */
-static void utc_notification_update_size_p(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_TITLE, "size_test-P", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_set_size(notification, 1000);
- notification_insert(notification, &priv_id);
-
- sleep(3);
-
- ret = notification_update_size(notification, priv_id, 10000000);
- dts_check_eq("notification_update_size", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_update_content()
- */
-static void utc_notification_update_content_n(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_CONTENT, "contents_test-N", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, &priv_id);
-
- sleep(3);
-
- ret = notification_update_content(NULL, NOTIFICATION_PRIV_ID_NONE, NULL);
- dts_check_eq("notification_update_content", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_update_content()
- */
-static void utc_notification_update_content_p(void)
-{
- int ret = 0;
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_CONTENT, "contents_test-P", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, &priv_id);
-
- sleep(3);
-
- ret = notification_update_content(notification, priv_id, "contents_test-P-done");
- dts_check_eq("notification_update_content", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_new()
- */
-static void utc_notification_new_1_n(void)
-{
- notification_h notification = NULL;
- /*Invalid parameter test*/
- notification = notification_new(NOTIFICATION_TYPE_NONE, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
- dts_check_eq("notification_new", notification, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_new()
- */
-static void utc_notification_new_2_n(void)
-{
- notification_h notification = NULL;
- /*Invalid parameter test*/
- notification = notification_new(NOTIFICATION_TYPE_MAX, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
- dts_check_eq("notification_new", notification, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_new()
- */
-static void utc_notification_new_1_p(void)
-{
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
- dts_check_ne("notification_new", notification, NULL,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_new()
- */
-static void utc_notification_new_2_p(void)
-{
- notification_h notification = NULL;
-
- /*Invalid parameter test*/
- notification = notification_new(NOTIFICATION_TYPE_ONGOING, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE);
- dts_check_ne("notification_new", notification, NULL,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_load()
- */
-static void utc_notification_load_n(void)
-{
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_CONTENT, "contents_test-P", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, &priv_id);
-
- sleep(1);
-
- /*Invalid parameter test*/
- notification = notification_load(NULL, NOTIFICATION_PRIV_ID_NONE);
- dts_check_eq("notification_load", notification, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_load()
- */
-static void utc_notification_load_p(void)
-{
- int priv_id = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- notification_set_pkgname(notification, TEST_PKG);
- notification_set_text(notification, NOTIFICATION_TEXT_TYPE_CONTENT, "contents_test-P", NULL, NOTIFICATION_VARIABLE_TYPE_NONE);
- notification_insert(notification, &priv_id);
-
- sleep(1);
-
- /*Invalid parameter test*/
- notification = notification_load(TEST_PKG, priv_id);
- dts_check_ne("notification_load", notification, NULL,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_clone()
- */
-static void utc_notification_clone_n(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- ret = notification_clone(NULL, NULL);
-
- dts_check_eq("notification_update_content", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_clone()
- */
-static void utc_notification_clone_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
- notification_h notification_cloned = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- ret = notification_clone(notification, ¬ification_cloned);
-
- dts_check_eq("notification_update_content", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_free()
- */
-static void utc_notification_free_n(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- ret = notification_free(NULL);
-
- dts_check_eq("notification_update_content", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_free()
- */
-static void utc_notification_free_p(void)
-{
- int ret = 0;
- notification_h notification = NULL;
-
- notification = notification_create(NOTIFICATION_TYPE_ONGOING);
- ret = notification_free(notification);
-
- dts_check_eq("notification_update_content", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_resister_changed_cb()
- */
-static void utc_notification_resister_changed_cb_n(void)
-{
- int ret = 0;
-
- ret = notification_resister_changed_cb(NULL, NULL);
- dts_check_eq("notification_resister_changed_cb", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_resister_changed_cb()
- */
-static void utc_notification_resister_changed_cb_p(void)
-{
- int ret = 0;
-
- ret = notification_resister_changed_cb(_changed_cb, NULL);
- notification_unresister_changed_cb(_changed_cb);
- dts_check_eq("notification_resister_changed_cb", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_unresister_changed_cb()
- */
-static void utc_notification_unresister_changed_cb_n(void)
-{
- int ret = 0;
-
- ret = notification_unresister_changed_cb(NULL);
- dts_check_eq("notification_unresister_changed_cb", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_unresister_changed_cb()
- */
-static void utc_notification_unresister_changed_cb_p(void)
-{
- int ret = 0;
-
- notification_resister_changed_cb(_changed_cb, NULL);
- ret = notification_unresister_changed_cb(_changed_cb);
- dts_check_eq("notification_unresister_changed_cb", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_register_detailed_changed_cb()
- */
-static void utc_notification_register_detailed_changed_cb_n(void)
-{
- int ret = 0;
-
- ret = notification_register_detailed_changed_cb(NULL, NULL);
- dts_check_eq("notification_register_detailed_changed_cb", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_register_detailed_changed_cb()
- */
-static void utc_notification_register_detailed_changed_cb_p(void)
-{
- int ret = 0;
-
- ret = notification_register_detailed_changed_cb(_detailed_changed_cb, NULL);
- notification_unregister_detailed_changed_cb(_detailed_changed_cb, NULL);
- dts_check_eq("notification_register_detailed_changed_cb", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_unregister_detailed_changed_cb()
- */
-static void utc_notification_unregister_detailed_changed_cb_n(void)
-{
- int ret = 0;
-
- ret = notification_unregister_detailed_changed_cb(NULL, NULL);
- dts_check_eq("notification_unregister_detailed_changed_cb", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_unregister_detailed_changed_cb()
- */
-static void utc_notification_unregister_detailed_changed_cb_p(void)
-{
- int ret = 0;
-
- notification_register_detailed_changed_cb(_detailed_changed_cb, NULL);
- ret = notification_unregister_detailed_changed_cb(_detailed_changed_cb, NULL);
- dts_check_eq("notification_unregister_detailed_changed_cb", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_count()
- */
-static void utc_notification_get_count_n(void)
-{
- int ret = 0;
-
- ret = notification_get_count(NOTIFICATION_TYPE_NONE, NULL,
- NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE
- ,NULL);
- dts_check_eq("notification_get_count", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_count()
- */
-static void utc_notification_get_count_p(void)
-{
- int ret = 0;
- int value = 0;
-
- ret = notification_get_count(NOTIFICATION_TYPE_NONE, TEST_PKG,
- NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE
- , &value);
- dts_check_eq("notification_get_count", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_list()
- */
-static void utc_notification_get_list_n(void)
-{
- int ret = 0;
-
- ret = notification_get_list(NOTIFICATION_TYPE_NONE, -1, NULL);
- dts_check_eq("notification_get_list", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_list()
- */
-static void utc_notification_get_list_p(void)
-{
- int ret = 0;
- notification_list_h list;
-
- ret = notification_get_list(NOTIFICATION_TYPE_NOTI, -1, &list);
- dts_check_eq("notification_get_list", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_grouping_list()
- */
-static void utc_notification_get_grouping_list_n(void)
-{
- int ret = 0;
-
- ret = notification_get_grouping_list(NOTIFICATION_TYPE_NONE, -1, NULL);
- dts_check_eq("notification_get_grouping_list", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_grouping_list()
- */
-static void utc_notification_get_grouping_list_p(void)
-{
- int ret = 0;
- notification_list_h list;
-
- ret = notification_get_grouping_list(NOTIFICATION_TYPE_NOTI, -1, &list);
- dts_check_eq("notification_get_grouping_list", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_get_detail_list()
- */
-static void utc_notification_get_detail_list_n(void)
-{
- int ret = 0;
-
- ret = notification_get_detail_list(TEST_PKG,
- NOTIFICATION_GROUP_ID_NONE,
- NOTIFICATION_PRIV_ID_NONE,
- -1, NULL);
- dts_check_eq("notification_get_detail_list", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_get_detail_list()
- */
-static void utc_notification_get_detail_list_p(void)
-{
- int ret = 0;
- notification_list_h list;
-
- ret = notification_get_detail_list(TEST_PKG,
- NOTIFICATION_GROUP_ID_NONE,
- NOTIFICATION_PRIV_ID_NONE,
- -1, &list);
- dts_check_eq("notification_get_detail_list", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_free_list()
- */
-static void utc_notification_free_list_n(void)
-{
- int ret = 0;
-
- ret = notification_free_list(NULL);
- dts_check_eq("notification_free_list", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_free_list()
- */
-static void utc_notification_free_list_p(void)
-{
- int ret = 0;
- notification_list_h list;
-
- ret = notification_get_detail_list(TEST_PKG,
- NOTIFICATION_GROUP_ID_NONE,
- NOTIFICATION_PRIV_ID_NONE,
- -1, &list);
-
- ret = notification_free_list(list);
- dts_check_eq("notification_free_list", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_op_get_data()
- */
-static void utc_notification_op_get_data_n(void)
-{
- int ret = 0;
-
- ret = notification_op_get_data(NULL, NOTIFICATION_OP_DATA_MIN, NULL);
- dts_check_eq("notification_op_get_data", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_op_get_data()
- */
-static void utc_notification_op_get_data_p(void)
-{
- int ret = 0;
- int value = 0;
- notification_op noti_op;
- noti_op.type = NOTIFICATION_OP_INSERT;
- noti_op.priv_id = 1;
-
- ret = notification_op_get_data(¬i_op, NOTIFICATION_OP_DATA_PRIV_ID, &value);
- dts_check_eq("notification_op_get_data", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_is_service_ready()
- */
-static void utc_notification_is_service_ready_p(void)
-{
- int value = 0;
-
- value = notification_is_service_ready();
- dts_check_eq("notification_is_service_ready", value, 1,
- "Must return 1 in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_add_deferred_task()
- */
-static void utc_notification_add_deferred_task_n(void)
-{
- int ret = 0;
-
- ret = notification_add_deferred_task(NULL, NULL);
- dts_check_eq("notification_add_deferred_task", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_add_deferred_task()
- */
-static void utc_notification_add_deferred_task_p(void)
-{
- int ret = 0;
-
- ret = notification_add_deferred_task(_deffered_job_cb, NULL);
- notification_del_deferred_task(_deffered_job_cb);
- dts_check_eq("notification_add_deferred_task", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_del_deferred_task()
- */
-static void utc_notification_del_deferred_task_n(void)
-{
- int ret = 0;
-
- ret = notification_del_deferred_task(NULL);
- dts_check_eq("notification_del_deferred_task", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_del_deferred_task()
- */
-static void utc_notification_del_deferred_task_p(void)
-{
- int ret = 0;
-
- ret = notification_add_deferred_task(_deffered_job_cb, NULL);
- ret = notification_del_deferred_task(_deffered_job_cb);
- dts_check_eq("notification_del_deferred_task", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of invalid parameter");
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <libintl.h>
-#include <tet_api.h>
-#include <notification.h>
-
-#define TEST_PKG "org.tizen.tetware"
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-static void startup(void);
-static void cleanup(void);
-
-static void utc_notification_list_get_head_n(void);
-static void utc_notification_list_get_head_p(void);
-static void utc_notification_list_get_tail_n(void);
-static void utc_notification_list_get_tail_p(void);
-static void utc_notification_list_get_prev_n(void);
-static void utc_notification_list_get_prev_p(void);
-static void utc_notification_list_get_next_n(void);
-static void utc_notification_list_get_next_p(void);
-static void utc_notification_list_get_data_n(void);
-static void utc_notification_list_get_data_p(void);
-static void utc_notification_list_append_n(void);
-static void utc_notification_list_append_p(void);
-static void utc_notification_list_remove_n(void);
-static void utc_notification_list_remove_p(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-struct tet_testlist tet_testlist[] = {
- {utc_notification_list_get_head_n, NEGATIVE_TC_IDX},
- {utc_notification_list_get_head_p, POSITIVE_TC_IDX},
- {utc_notification_list_get_tail_n, NEGATIVE_TC_IDX},
- {utc_notification_list_get_tail_p, POSITIVE_TC_IDX},
- {utc_notification_list_get_prev_n, NEGATIVE_TC_IDX},
- {utc_notification_list_get_prev_p, POSITIVE_TC_IDX},
- {utc_notification_list_get_next_n, NEGATIVE_TC_IDX},
- {utc_notification_list_get_next_p, POSITIVE_TC_IDX},
- {utc_notification_list_get_data_n, NEGATIVE_TC_IDX},
- {utc_notification_list_get_data_p, POSITIVE_TC_IDX},
- {utc_notification_list_append_n, NEGATIVE_TC_IDX},
- {utc_notification_list_append_p, POSITIVE_TC_IDX},
- {utc_notification_list_remove_n, NEGATIVE_TC_IDX},
- {utc_notification_list_remove_p, POSITIVE_TC_IDX},
- { NULL, 0 },
-};
-
-static void startup(void)
-{
- /* start of TC */
- notification_clear(NOTIFICATION_TYPE_NONE);
- tet_printf("\n TC start");
-}
-
-
-static void cleanup(void)
-{
- /* end of TC */
- tet_printf("\n TC end");
-}
-
-/**
- * @brief Negative test case of notification_list_get_head()
- */
-static void utc_notification_list_get_head_n(void)
-{
- notification_list_h list = NULL;
- notification_list_h list_value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- list_value = notification_list_get_head(NULL);
- dts_check_eq("notification_list_get_head", list_value, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_list_get_head()
- */
-static void utc_notification_list_get_head_p(void)
-{
- notification_list_h list = NULL;
- notification_list_h list_value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- /*Invalid parameter test*/
- list_value = notification_list_get_head(list);
- dts_check_ne("notification_list_get_head", list_value, NULL,
- "Must return valid pointer in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_list_get_tail()
- */
-static void utc_notification_list_get_tail_n(void)
-{
- notification_list_h list = NULL;
- notification_list_h list_value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- list_value = notification_list_get_tail(NULL);
- dts_check_eq("notification_list_get_tail", list_value, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_list_get_tail()
- */
-static void utc_notification_list_get_tail_p(void)
-{
- notification_list_h list = NULL;
- notification_list_h list_value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- /*Invalid parameter test*/
- list_value = notification_list_get_tail(list);
- dts_check_ne("notification_list_get_tail", list_value, NULL,
- "Must return valid pointer in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_list_get_prev()
- */
-static void utc_notification_list_get_prev_n(void)
-{
- notification_list_h list = NULL;
- notification_list_h list_value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- list_value = notification_list_get_prev(NULL);
- dts_check_eq("notification_list_get_prev", list_value, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_list_get_prev()
- */
-static void utc_notification_list_get_prev_p(void)
-{
- notification_list_h list = NULL;
- notification_list_h list_value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- /*Invalid parameter test*/
- list = notification_list_get_tail(list);
- list_value = notification_list_get_prev(list);
- dts_check_ne("notification_list_get_prev", list_value, NULL,
- "Must return valid pointer in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_list_get_next()
- */
-static void utc_notification_list_get_next_n(void)
-{
- notification_list_h list = NULL;
- notification_list_h list_value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- list_value = notification_list_get_next(NULL);
- dts_check_eq("notification_list_get_next", list_value, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_list_get_next()
- */
-static void utc_notification_list_get_next_p(void)
-{
- notification_list_h list = NULL;
- notification_list_h list_value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- /*Invalid parameter test*/
- list = notification_list_get_head(list);
- list_value = notification_list_get_next(list);
- dts_check_ne("notification_list_get_next", list_value, NULL,
- "Must return valid pointer in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_list_get_data()
- */
-static void utc_notification_list_get_data_n(void)
-{
- notification_list_h list = NULL;
- notification_h value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- value = notification_list_get_data(NULL);
- dts_check_eq("notification_list_get_data", value, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_list_get_data()
- */
-static void utc_notification_list_get_data_p(void)
-{
- notification_list_h list = NULL;
- notification_h value = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- /*Invalid parameter test*/
- value = notification_list_get_data(list);
- dts_check_ne("notification_list_get_data", value, NULL,
- "Must return valid pointer in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_list_append()
- */
-static void utc_notification_list_append_n(void)
-{
- notification_list_h list = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, NULL);
- dts_check_eq("notification_list_append", list, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_list_append()
- */
-static void utc_notification_list_append_p(void)
-{
- notification_list_h list = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- dts_check_ne("notification_list_append", list, NULL,
- "Must return valid pointer in case of invalid parameter");
-}
-
-/**
- * @brief Negative test case of notification_list_remove()
- */
-static void utc_notification_list_remove_n(void)
-{
- notification_list_h list = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- list = notification_list_remove(NULL, NULL);
- dts_check_eq("notification_list_remove", list, NULL,
- "Must return NULL in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_list_remove()
- */
-static void utc_notification_list_remove_p(void)
-{
- notification_list_h list = NULL;
- notification_h notification_1 = NULL;
- notification_h notification_2 = NULL;
- notification_h notification_3 = NULL;
- notification_h notification_4 = NULL;
-
- notification_1 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_2 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_3 = notification_create(NOTIFICATION_TYPE_NOTI);
- notification_4 = notification_create(NOTIFICATION_TYPE_NOTI);
- list = notification_list_append(list, notification_1);
- list = notification_list_append(list, notification_2);
- list = notification_list_append(list, notification_3);
- list = notification_list_append(list, notification_4);
-
- list = notification_list_remove(list, notification_1);
- dts_check_ne("notification_list_remove", list, NULL,
- "Must return valid pointer in case of invalid parameter");
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <libintl.h>
-#include <tet_api.h>
-#include <notification.h>
-
-#define TEST_PKG "org.tizen.tetware"
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-static void startup(void);
-static void cleanup(void);
-
-static void utc_notification_setting_property_set_n(void);
-static void utc_notification_setting_property_set_p(void);
-static void utc_notification_setting_property_get_n(void);
-static void utc_notification_setting_property_get_p(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-struct tet_testlist tet_testlist[] = {
- {utc_notification_setting_property_set_n, NEGATIVE_TC_IDX},
- {utc_notification_setting_property_set_p, POSITIVE_TC_IDX},
- {utc_notification_setting_property_get_n, NEGATIVE_TC_IDX},
- {utc_notification_setting_property_get_p, POSITIVE_TC_IDX},
- { NULL, 0 },
-};
-
-static void startup(void)
-{
- /* start of TC */
- notification_clear(NOTIFICATION_TYPE_NONE);
- tet_printf("\n TC start");
-}
-
-
-static void cleanup(void)
-{
- /* end of TC */
- tet_printf("\n TC end");
-}
-
-/**
- * @brief Negative test case of notification_setting_property_set()
- */
-static void utc_notification_setting_property_set_n(void)
-{
- int ret;
-
- ret = notification_setting_property_set(NULL, NULL, NULL);
- dts_check_eq("notification_setting_property_set", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_setting_property_set()
- */
-static void utc_notification_setting_property_set_p(void)
-{
- int ret;
-
- ret = notification_setting_property_set(TEST_PKG, "OPT_NOTIFICATION", "ON");
- /*Invalid parameter test*/
- dts_check_ne("notification_setting_property_set", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_setting_property_get()
- */
-static void utc_notification_setting_property_get_n(void)
-{
- int ret;
-
- ret = notification_setting_property_get(NULL, NULL, NULL);
- dts_check_eq("notification_setting_property_get", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_setting_property_get()
- */
-static void utc_notification_setting_property_get_p(void)
-{
- int ret;
- char *value = NULL;
-
- ret = notification_setting_property_get(TEST_PKG, "OPT_NOTIFICATION", &value);
- dts_check_ne("notification_setting_property_get", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
+++ /dev/null
-/*
- * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <libintl.h>
-#include <tet_api.h>
-#include <notification.h>
-
-#define TEST_PKG "org.tizen.tetware"
-
-enum {
- POSITIVE_TC_IDX = 0x01,
- NEGATIVE_TC_IDX,
-};
-
-static void startup(void);
-static void cleanup(void);
-
-static void utc_notification_status_message_post_n(void);
-static void utc_notification_status_message_post_p(void);
-static void utc_notification_status_monitor_message_cb_set_n(void);
-static void utc_notification_status_monitor_message_cb_set_p(void);
-static void utc_notification_status_monitor_message_cb_unset_p(void);
-
-void (*tet_startup)(void) = startup;
-void (*tet_cleanup)(void) = cleanup;
-
-struct tet_testlist tet_testlist[] = {
- {utc_notification_status_message_post_n, NEGATIVE_TC_IDX},
- {utc_notification_status_message_post_p, POSITIVE_TC_IDX},
- {utc_notification_status_monitor_message_cb_set_n, NEGATIVE_TC_IDX},
- {utc_notification_status_monitor_message_cb_set_p, POSITIVE_TC_IDX},
- {utc_notification_status_monitor_message_cb_unset_p, POSITIVE_TC_IDX},
- { NULL, 0 },
-};
-
-static void startup(void)
-{
- /* start of TC */
- notification_clear(NOTIFICATION_TYPE_NONE);
- tet_printf("\n TC start");
-}
-
-
-static void cleanup(void)
-{
- /* end of TC */
- tet_printf("\n TC end");
-}
-
-static void _message_callback(const char *message, void *data)
-{
-}
-
-/**
- * @brief Negative test case of notification_status_message_post()
- */
-static void utc_notification_status_message_post_n(void)
-{
- int ret;
-
- ret = notification_status_message_post(NULL);
- dts_check_eq("notification_status_message_post", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_status_message_post()
- */
-static void utc_notification_status_message_post_p(void)
-{
- int ret;
-
- ret = notification_status_message_post("TETWARE-P");
- /*Invalid parameter test*/
- dts_check_eq("notification_status_message_post", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Negative test case of notification_status_monitor_message_cb_set()
- */
-static void utc_notification_status_monitor_message_cb_set_n(void)
-{
- int ret;
-
- ret = notification_status_monitor_message_cb_set(NULL, NULL);
- dts_check_eq("notification_status_message_post", ret, NOTIFICATION_ERROR_INVALID_DATA,
- "Must return NOTIFICATION_ERROR_INVALID_DATA in case of invalid parameter");
-}
-
-/**
- * @brief Positive test case of notification_status_monitor_message_cb_set()
- */
-static void utc_notification_status_monitor_message_cb_set_p(void)
-{
- int ret;
-
- ret = notification_status_monitor_message_cb_set(_message_callback, NULL);
- dts_check_eq("notification_status_monitor_message_cb_set", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
-
-/**
- * @brief Positive test case of notification_status_monitor_message_cb_unset()
- */
-static void utc_notification_status_monitor_message_cb_unset_p(void)
-{
- int ret;
-
- ret = notification_status_monitor_message_cb_unset();
- dts_check_eq("notification_status_monitor_message_cb_unset", ret, NOTIFICATION_ERROR_NONE,
- "Must return NOTIFICATION_ERROR_NONE in case of valid parameter");
-}
+++ /dev/null
-all
- ^TEST
-##### Scenarios for TEST #####
-
-# Test scenario
-TEST
- :include:/testcase/tslist
+++ /dev/null
-TET_OUTPUT_CAPTURE=True # capture option for build operation checking
-TET_BUILD_TOOL=make # build with using make command
-TET_BUILD_FILE=-f Makefile # execution file (Makefile) for build
-TET_API_COMPLIANT=True # use TET API in Test Case ?
-TET_PASS_TC_NAME=True # report passed TC name in Journal file?
+++ /dev/null
-TET_OUTPUT_CAPTURE=True # capture option
-TET_CLEAN_TOOL= make clean # clean tool
-TET_CLEAN_FILE= Makefile # file for clean
-TET_API_COMPLIANT=True # TET API useage
-TET_PASS_TC_NAME=True # showing name , passed TC
+++ /dev/null
-TET_OUTPUT_CAPTURE=True # capturing execution or not
-TET_EXEC_TOOL= # ex) exec : execution tool set up/ Optional
-TET_EXEC_FILE= # ex) exectool : execution file/ Optional
-TET_API_COMPLIANT=True # Test case or Tool usesTET API?
-TET_PASS_TC_NAME=True # showing Passed TC name ?
+++ /dev/null
-libnotification (0.1.1-14) unstable; urgency=low
-
- * remove VCONFKEY_SETAPPL_STATE_TICKER_NOTI_DISPLAY_CONTENT_BOOL
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-14
-
- -- Jeonghoon Park <jh1979.park@samsung.com> Tue, 17 Apr 2012 11:24:34 +0900
-
-libnotification (0.1.1-13) unstable; urgency=low
-
- * add bundle package dependency for dev package
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-13
-
- -- Jeonghoon Park <jh1979.park@samsung.comp> Mon, 09 Apr 2012 16:34:18 +0900
-
-libnotification (0.1.1-12) unstable; urgency=low
-
- * fix bugs on dbus connection (the applictions will exit if they unregisters their changed callback)
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-12
-
- -- Jeonghoon Park <jh1979.park@samsung.com> Tue, 20 Mar 2012 13:19:27 +0900
-
-libnotification (0.1.1-11) unstable; urgency=low
-
- * fix pkgconfig file
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-11
-
- -- Jeonghoon Park <jh1979.park@samsung.com> Thu, 15 Mar 2012 23:48:41 +0900
-
-libnotification (0.1.1-10) unstable; urgency=low
-
- * replace heynoti publish to dbus signal
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-10
-
- -- Jeonghoon Park <jh1979.park@samsung.com> Thu, 15 Mar 2012 19:57:19 +0900
-
-libnotification (0.1.1-9) unstable; urgency=low
-
- * Add content update API
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-9
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Wed, 25 Jan 2012 21:32:38 +0900
-
-libnotification (0.1.1-8) unstable; urgency=low
-
- * Remove deprecated API
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-8
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Thu, 12 Jan 2012 16:32:56 +0900
-
-libnotification (0.1.1-7) unstable; urgency=low
-
- * Deprecate some of the unused API
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-7
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Wed, 04 Jan 2012 18:54:12 +0900
-
-libnotification (0.1.1-6) unstable; urgency=low
-
- * Add Error type for update API
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-6
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Wed, 04 Jan 2012 15:47:28 +0900
-
-libnotification (0.1.1-5) unstable; urgency=low
-
- * Add notification update function
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-5
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Mon, 26 Dec 2011 17:54:37 +0900
-
-libnotification (0.1.1-4) unstable; urgency=low
-
- * Remove ip from changelog
- * Git: slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-4
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Mon, 19 Dec 2011 15:24:01 +0900
-
-libnotification (0.1.1-3) unstable; urgency=low
-
- * Update boilerplate
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-3
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Tue, 06 Dec 2011 21:41:59 +0900
-
-libnotification (0.1.1-2) unstable; urgency=low
-
- * Fix DB query to bind title key string
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-2
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Thu, 17 Nov 2011 11:11:48 +0900
-
-libnotification (0.1.1-1) unstable; urgency=low
-
- * Update API(ver.0.1.1)
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.1-1
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Mon, 14 Nov 2011 18:10:11 +0900
-
-libnotification (0.1.0-9) unstable; urgency=low
-
- * Apply Boilerplate
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-9
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Thu, 03 Nov 2011 17:29:12 +0900
-
-libnotification (0.1.0-8) unstable; urgency=low
-
- * Add volatile property
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-8
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Thu, 20 Oct 2011 18:11:14 +0900
-
-libnotification (0.1.0-7) unstable; urgency=low
-
- * Remove eina from pc file
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-7
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Tue, 18 Oct 2011 16:45:27 +0900
-
-libnotification (0.1.0-6) unstable; urgency=low
-
- * Add API to select display app, Fix DB query error
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-6
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Mon, 17 Oct 2011 20:52:38 +0900
-
-libnotification (0.1.0-5) unstable; urgency=low
-
- * Add New API for tigen UX, Merge noti and ongoing DB
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-5
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Mon, 10 Oct 2011 19:39:17 +0900
-
-libnotification (0.1.0-4) unstable; urgency=low
-
- * Add caller pkgname set API
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-4
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Fri, 16 Sep 2011 13:16:18 +0900
-
-libnotification (0.1.0-3) unstable; urgency=low
-
- * Fix prevent defect, bind query for insert error.
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-3
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Wed, 14 Sep 2011 22:30:35 +0900
-
-libnotification (0.1.0-2) unstable; urgency=low
-
- * Add property for tickernoti, Remove content display option
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-2
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Wed, 07 Sep 2011 23:15:25 +0900
-
-libnotification (0.1.0-1) unstable; urgency=low
-
- * Initial Release
- * Git: slp-source.sec.samsung.net:slp/pkgs/n/notification
- * Tag: libnotification_0.1.0-1
-
- -- Mi-Ju Lee <miju52.lee@samsung.com> Tue, 30 Aug 2011 14:44:14 +0900
+++ /dev/null
-Source: libnotification
-Section: libs
-Priority: optional
-Maintainer: Jeonghoon Park <jh1979.park@samsung.com>, Youngjoo Park <yjoo93.park@samsung.com>
-Build-Depends: debhelper (>= 5), libsqlite3-dev, libslp-db-util-dev, libvconf-dev, libbundle-dev, libdbus-1-dev, dlog-dev, libail-0-dev, libaul-1-dev, libappsvc-dev, libdbus-glib-1-dev
-Standards-Version: 3.7.2
-
-Package: libnotification-dev
-Section: libdevel
-Architecture: any
-Depends: libnotification-0 (= ${Source-Version}), libbundle-dev
-Description: Notification library
- This package contains devel content.
-
-Package: libnotification-0
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Notification library
- This package contains notification library.
-
-Package: libnotification-dbg
-Section: debug
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libnotification-0 (= ${Source-Version})
-Description: Notification library
- This package is for debug
+++ /dev/null
-@PREFIX@/lib/*.so*
+++ /dev/null
-#!/bin/sh
-
-
-if [ ! -d @DATADIR@/dbspace ]
-then
- mkdir @DATADIR@/dbspace
-fi
-
-if [ ! -f @DATADIR@/dbspace/.notification.db ]
-then
- sqlite3 @DATADIR@/dbspace/.notification.db 'PRAGMA journal_mode = PERSIST;
- create table if not exists noti_list (
- type INTEGER NOT NULL,
- caller_pkgname TEXT NOT NULL,
- launch_pkgname TEXT,
- image_path TEXT,
- group_id INTEGER default 0,
- internal_group_id INTEGER default 0,
- priv_id INTERGER NOT NULL,
- title_key TEXT,
- b_text TEXT,
- b_key TEXT,
- b_format_args TEXT,
- num_format_args INTEGER default 0,
- text_domain TEXT,
- text_dir TEXT,
- time INTEGER default 0,
- insert_time INTEGER default 0,
- args TEXT,
- group_args TEXT,
- b_execute_option TEXT,
- b_service_responding TEXT,
- b_service_single_launch TEXT,
- b_service_multi_launch TEXT,
- sound_type INTEGER default 0,
- sound_path TEXT,
- vibration_type INTEGER default 0,
- vibration_path TEXT,
- flags_for_property INTEGER default 0,
- flag_simmode INTEGER default 0,
- display_applist INTEGER,
- progress_size DOUBLE default 0,
- progress_percentage DOUBLE default 0,
- rowid INTEGER PRIMARY KEY AUTOINCREMENT,
- UNIQUE (caller_pkgname, priv_id)
- );
- create table if not exists noti_group_data (
- caller_pkgname TEXT NOT NULL,
- group_id INTEGER default 0,
- badge INTEGER default 0,
- title TEXT,
- content TEXT,
- loc_title TEXT,
- loc_content TEXT,
- count_display_title INTEGER,
- count_display_content INTEGER,
- rowid INTEGER PRIMARY KEY AUTOINCREMENT,
- UNIQUE (caller_pkgname, group_id)
- );
- create table if not exists ongoing_list (
- caller_pkgname TEXT NOT NULL,
- launch_pkgname TEXT,
- icon_path TEXT,
- group_id INTEGER default 0,
- internal_group_id INTEGER default 0,
- priv_id INTERGER NOT NULL,
- title TEXT,
- content TEXT,
- default_content TEXT,
- loc_title TEXT,
- loc_content TEXT,
- loc_default_content TEXT,
- text_domain TEXT,
- text_dir TEXT,
- args TEXT,
- group_args TEXT,
- flag INTEGER default 0,
- progress_size DOUBLE default 0,
- progress_percentage DOUBLE default 0,
- rowid INTEGER PRIMARY KEY AUTOINCREMENT,
- UNIQUE (caller_pkgname, priv_id)
- );
- '
-fi
-
-if [ ${USER} = "root" ]
-then
- chown root:5000 @DATADIR@/dbspace/.notification.db
- chown root:5000 @DATADIR@/dbspace/.notification.db-journal
-fi
-chmod 660 @DATADIR@/dbspace/.notification.db
-chmod 660 @DATADIR@/dbspace/.notification.db-journal
+++ /dev/null
-@PREFIX@/include/*
-@PREFIX@/lib/pkgconfig/*.pc
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-CFLAGS ?= -Wall -g
-CXXFLAGS ?= -Wall -g
-LDFLAGS ?=
-PREFIX ?= /usr
-DATADIR ?= /opt
-
-ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
- CXXFLAGS += -O0
-else
- CFLAGS += -O2
- CXXFLAGS += -O2
-endif
-
-LDFLAGS += -Wl,--rpath=$(PREFIX)/lib -Wl,--as-needed
-
-CMAKE_BUILD_DIR ?= $(CURDIR)/cmake_build_tmp
-
-configure: configure-stamp
-configure-stamp:
- dh_testdir
- # Add here commands to configure the package.
- mkdir -p $(CMAKE_BUILD_DIR) && cd $(CMAKE_BUILD_DIR) && \
- CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" cmake .. -DCMAKE_INSTALL_PREFIX=$(PREFIX)
-
- touch configure-stamp
-
-build: build-stamp
-
-build-stamp: configure-stamp
- dh_testdir
-
- # Add here commands to compile the package.
- cd $(CMAKE_BUILD_DIR) && $(MAKE)
-
- #docbook-to-man debian/wavplayer.sgml > wavplayer.1
-
- for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
- cat $$f > $${f%.in}; \
- sed -i -e "s#@PREFIX@#$(PREFIX)#g" $${f%.in}; \
- sed -i -e "s#@DATADIR@#$(DATADIR)#g" $${f%.in}; \
- done
-
- touch $@
-
-clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
-
- rm -rf $(CMAKE_BUILD_DIR)
-
- for f in `find $(CURDIR)/debian/ -name "*.in"`; do \
- rm -f $${f%.in}; \
- done
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- # Add here commands to install the package into debian/wavplayer.
- cd $(CMAKE_BUILD_DIR) && $(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
-
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_install --sourcedir=debian/tmp
-# dh_installmenu
-# dh_installdebconf
-# dh_installlogrotate
-# dh_installemacsen
-# dh_installpam
-# dh_installmime
-# dh_python
-# dh_installinit
-# dh_installcron
-# dh_installinfo
- dh_installman
- dh_link
- dh_strip --dbg-package=libnotification-dbg
- dh_compress
- dh_fixperms
-# dh_perl
- dh_makeshlibs
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install configure
#include <notification_error.h>
#include <notification_type.h>
-#include <notification_list.h>
#include <notification_status.h>
#ifdef __cplusplus
int notification_post(notification_h noti);
/**
- * @brief Sets permission to application for updating or deleting the notification
+ * @brief Gets the package name of the notification
* @since_tizen 2.4
- * @privlevel public
- * @privilege %http://tizen.org/privilege/notification
* @param[in] noti Notification handle
- * @param[in] permission_type permission type
- * @param[in] app_id target application id
- * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
- * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
- * @see #notification_get_permission
- * @see #notification_permission_type_e
- * @see #notification_h
+ * @param[out] pkgname The package name of the notification
+ * @return #NOTIFICATION_ERROR_NONE on success, otherwise a negative error value
+ * @retval NOTIFICATION_ERROR_NONE Success
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
* @par Sample code:
* @code
#include <notification.h>
{
notification_h noti = NULL;
int noti_err = NOTIFICATION_ERROR_NONE;
+ char *pkgname = NULL;
- noti = notification_create(NOTIFICATION_TYPE_NOTI);
- if(noti == NULL) {
- return;
- }
...
- noti_err = notification_set_permission(noti, NOTIFICATION_PERMISSION_TYPE_DELETE, "org.tizen.xxx");
+ noti_err = notification_get_pkgname(noti, &pkgname);
+
if(noti_err != NOTIFICATION_ERROR_NONE) {
notification_free(noti);
return;
}
* @endcode
*/
-int notification_set_permission(notification_h noti, notification_permission_type_e permission_type, const char *app_id);
+int notification_get_pkgname(notification_h noti, char **pkgname);
/**
- * @brief Gets permission of the notification
- * @remarks @a app_id must be freed with notification_free() function.
+ * @brief Adds a button on the notification
* @since_tizen 2.4
- * @privlevel public
- * @privilege %http://tizen.org/privilege/notification
* @param[in] noti Notification handle
- * @param[out] permission_type permission type
- * @param[out] app_id target application id
- * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
- * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
- * @see #notification_set_permission
- * @see #notification_permission_type_e
- * @see #notification_h
+ * @param[in] button_index Button index
+ * @return #NOTIFICATION_ERROR_NONE on success, otherwise a negative error value
+ * @retval NOTIFICATION_ERROR_NONE Success
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
* @par Sample code:
* @code
#include <notification.h>
...
{
+ notification_h noti = NULL;
int noti_err = NOTIFICATION_ERROR_NONE;
- notification_permission_type_e permission_type;
- const char *app_id = NULL;
+ char *pkgname = NULL;
...
- noti_err = notification_get_permission(noti, &permission_type, &app_id);
+ noti_err = notification_add_button(noti, NOTIFICATION_BUTTON_1);
+
if(noti_err != NOTIFICATION_ERROR_NONE) {
notification_free(noti);
return;
}
* @endcode
*/
-int notification_get_permission(notification_h noti, notification_permission_type_e *permission_type, const char **app_id);
+int notification_add_button(notification_h noti, notification_button_index_e button_index);
/**
- * @brief Gets the package name of the notification
+ * @brief Removes a button on the notification
* @since_tizen 2.4
* @param[in] noti Notification handle
- * @param[out] pkgname The package name of the notification
+ * @param[in] button_index Button index
* @return #NOTIFICATION_ERROR_NONE on success, otherwise a negative error value
* @retval NOTIFICATION_ERROR_NONE Success
* @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
...
- noti_err = notification_get_pkgname(noti, &pkgname);
+ noti_err = notification_remove_button(noti, NOTIFICATION_BUTTON_1);
if(noti_err != NOTIFICATION_ERROR_NONE) {
notification_free(noti);
}
* @endcode
*/
-int notification_get_pkgname(notification_h noti, char **pkgname);
+int notification_remove_button(notification_h noti, notification_button_index_e button_index);
+/**
+ * @brief Sets the 'auto remove' option of the active notification
+ * @details The 'auto remove' option let the active notification be removed in several seconds after it shows. Default value is true.
+ * @remarks When 'auto_remove' is set as false, the active notification will not be removed
+ as long as the user removes the active notification or the app which posted the active notification removes the active notification.
+ * @since_tizen 2.4
+ * @param[in] noti Notification handle
+ * @param[in] auto_remove Auto remove option
+ * @return #NOTIFICATION_ERROR_NONE On success, other value if failure
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see #notification_h
+ * @see #notification_get_auto_remove
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ ...
+
+ noti_err = notification_set_auto_remove(noti, false);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_set_auto_remove(notification_h noti, bool auto_remove);
+
+/**
+ * @brief Gets the 'auto remove' option of the active notification
+ * @details The 'auto remove' option let the active notification be removed in several seconds after it shows. Default value is true.
+ * @since_tizen 2.4
+ * @param[in] noti Notification handle
+ * @param[out] auto_remove Auto remove option
+ * @return #NOTIFICATION_ERROR_NONE On success, other value on failure
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @see #notification_h
+ * @see #notification_get_auto_remove
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ bool auto_remove;
+
+ ...
+
+ noti_err = notification_get_auto_remove(noti, &auto_remove);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_get_auto_remove(notification_h noti, bool *auto_remove);
/* For backward compatibility */
/**
* @{
*/
+#define NOTIFICATION_DISPLAY_APP_HEADS_UP NOTIFICATION_DISPLAY_APP_ACTIVE /* To avoid build error */
+
/**
* @brief This function add deferred task. the registered task will be executed when notification service become ready
* @param[in] deferred_task_cb The callback function
#define __NOTIFICATION_NOTI_H__
#include <notification.h>
+#include <notification_list.h>
#define TAG_TIME "TIME"
#define TAG_TYPE_INVALID -1
char *temp_title;
char *temp_content;
char *tag;
+ bool ongoing_flag;
+ bool auto_remove;
};
struct notification_system_setting {
*/
/**
- * @brief Sends a string (message) to the notification status monitor.
+ * @brief Shows a toast popup window with given messaege
* @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
* @privlevel public
- * @privilege %http://tizen.org/privilege/notification
* @param[in] message The messages to be posted
-
* @return #NOTIFICATION_ERROR_NONE on success,
* otherwise any other value on failure
* @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
* @retval #NOTIFICATION_ERROR_FROM_DBUS Error from DBus
- * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
* @see #notification_error_e
*/
int notification_status_message_post(const char *message);
NOTIFICATION_COUNT_DISPLAY_TYPE_MAX,
} notification_count_display_type_e;
+/**
+ * @brief Enumeration for button
+ * @since_tizen 2.4
+ */
+typedef enum _notification_button_index {
+ NOTIFICATION_BUTTON_1 = 1, /**< button 1 */
+ NOTIFICATION_BUTTON_2 = 2, /**< button 2 */
+ NOTIFICATION_BUTTON_3 = 3, /**< button 3 */
+ NOTIFICATION_BUTTON_4 = 4, /**< button 4 */
+ NOTIFICATION_BUTTON_5 = 5, /**< button 5 */
+ NOTIFICATION_BUTTON_6 = 6, /**< button 6 */
+} notification_button_index_e;
+
/**
* @brief Enumeration for notification text type.
* @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
* @since_tizen @if WEARABLE 2.3.1 @elseif MOBILE 2.3 @endif
*/
enum _notificaton_display_applist {
- NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY = 0x00000001,/**< Notification Tray(Quickpanel) */
- NOTIFICATION_DISPLAY_APP_TICKER = 0x00000002,
- /**< Ticker notification */
- NOTIFICATION_DISPLAY_APP_LOCK = 0x00000004,
- /**< Lock screen */
+ NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY = 0x00000001, /**< Notification Tray(Quickpanel) */
+ NOTIFICATION_DISPLAY_APP_TICKER = 0x00000002, /**< Ticker notification */
+ NOTIFICATION_DISPLAY_APP_LOCK = 0x00000004, /**< Lock screen */
NOTIFICATION_DISPLAY_APP_INDICATOR = 0x00000008,/**< Indicator */
- NOTIFICATION_DISPLAY_APP_HEADS_UP = 0x00000010,/**< Heads-up notification */
- NOTIFICATION_DISPLAY_APP_ALL = 0xffffffff,
- /**< All display application */
+ NOTIFICATION_DISPLAY_APP_ACTIVE = 0x00000010,/**< Active notification */
+ NOTIFICATION_DISPLAY_APP_ALL = 0x0000000f, /**< All display application except active notification*/
};
/**
BuildRequires: pkgconfig(appsvc)
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(com-core)
+BuildRequires: pkgconfig(appcore-common)
BuildRequires: pkgconfig(capi-appfw-application)
+BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-appfw-package-manager)
+BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(edbus)
BuildRequires: pkgconfig(elementary)
BuildRequires: pkgconfig(ecore)
%post
/sbin/ldconfig
-if [ ! -d /opt/dbspace ]
+if [ ! -d /usr/dbspace ]
then
- mkdir /opt/dbspace
+ mkdir /usr/dbspace
fi
-if [ ! -f /opt/dbspace/.notification.db ]
+if [ ! -f /usr/dbspace/.notification.db ]
then
- sqlite3 /opt/dbspace/.notification.db 'PRAGMA journal_mode = PERSIST;
+ sqlite3 /usr/dbspace/.notification.db 'PRAGMA journal_mode = PERSIST;
create table if not exists noti_list (
type INTEGER NOT NULL,
layout INTEGER NOT NULL default 0,
'
fi
-chown :5000 /opt/dbspace/.notification.db
-chown :5000 /opt/dbspace/.notification.db-journal
-chmod 644 /opt/dbspace/.notification.db
-chmod 644 /opt/dbspace/.notification.db-journal
+chown :5000 /usr/dbspace/.notification.db
+chown :5000 /usr/dbspace/.notification.db-journal
+chmod 644 /usr/dbspace/.notification.db
+chmod 644 /usr/dbspace/.notification.db-journal
%postun -p /sbin/ldconfig
#include <dbus/dbus-glib-lowlevel.h>
#include <app.h>
+#include <app_internal.h>
+#include <app_manager.h>
#include <app_control_internal.h>
+#include <package_manager.h>
#include <aul.h>
#include <ail.h>
#include <appsvc.h>
#include <notification_ipc.h>
#include <notification_internal.h>
-typedef struct _notification_cb_list notification_cb_list_s;
-
-typedef enum __notification_cb_type {
- NOTIFICATION_CB_NORMAL = 1,
- NOTIFICATION_CB_DETAILED,
-} _notification_cb_type_e;
-
-struct _notification_cb_list {
- notification_cb_list_s *prev;
- notification_cb_list_s *next;
-
- _notification_cb_type_e cb_type;
- void (*changed_cb) (void *data, notification_type_e type);
- void (*detailed_changed_cb) (void *data, notification_type_e type, notification_op *op_list, int num_op);
- void *data;
-};
-
-static notification_cb_list_s *g_notification_cb_list = NULL;
-
static void (*posted_toast_message_cb) (void *data);
#define NOTI_TEXT_RESULT_LEN 2048
return dup_pkgname;
}
-static void _notification_get_text_domain(notification_h noti)
-{
- if (noti->domain != NULL) {
-
- }
-
- if (noti->dir != NULL) {
-
- }
-}
-
EXPORT_API int notification_set_image(notification_h noti,
notification_image_type_e type,
const char *image_path)
{
bundle *b = NULL;
char buf_key[32] = { 0, };
- const char *ret_val = NULL;
+ char *ret_val = NULL;
/* Check noti and image_path are valid data */
if (noti == NULL || image_path == NULL) {
snprintf(buf_key, sizeof(buf_key), "%d", type);
/* Get value using key */
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
/* If key is exist, remove this value to store new image path */
bundle_del(b, buf_key);
}
/* Add new image path with type key */
- bundle_add(b, buf_key, image_path);
+ bundle_add_str(b, buf_key, image_path);
} else {
/* If image path bundle is not exist, create new one */
b = bundle_create();
snprintf(buf_key, sizeof(buf_key), "%d", type);
/* Add new image path with type key */
- bundle_add(b, buf_key, image_path);
+ bundle_add_str(b, buf_key, image_path);
/* Save to image path bundle */
noti->b_image_path = b;
{
bundle *b = NULL;
char buf_key[32] = { 0, };
- const char *ret_val = NULL;
+ char *ret_val = NULL;
/* Check noti and image_path is valid data */
if (noti == NULL || image_path == NULL) {
snprintf(buf_key, sizeof(buf_key), "%d", type);
/* Get value of key */
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
- *image_path = (char *)ret_val;
+ *image_path = ret_val;
} else {
/* If image path bundle does not exist, image path is NULL */
*image_path = NULL;
bundle *b = NULL;
char buf_key[32] = { 0, };
char buf_val[1024] = { 0, };
- const char *ret_val = NULL;
+ char *ret_val = NULL;
va_list var_args;
notification_variable_type_e var_type;
int num_args = 0;
snprintf(buf_key, sizeof(buf_key), "%d", type);
/* Get value using type key */
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
/* If value exist, remove this to add new value */
bundle_del(b, buf_key);
snprintf(buf_val, sizeof(buf_val), "%s", text);
/* Add new text value */
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
} else {
/* If text bundle does not exist, create new one */
b = bundle_create();
snprintf(buf_val, sizeof(buf_val), "%s", text);
/* Add new text value */
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
/* Save text bundle */
noti->b_text = b;
snprintf(buf_key, sizeof(buf_key), "%d", type);
/* Get value using type key */
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
/* If value exist, remove this */
bundle_del(b, buf_key);
snprintf(buf_key, sizeof(buf_key), "%d", type);
/* Get value using type key */
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
/* If value exist, remove this to add new value */
bundle_del(b, buf_key);
snprintf(buf_val, sizeof(buf_val), "%s", key);
/* Add new key value */
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
} else {
/* If key bundle does not exist, create new one */
b = bundle_create();
snprintf(buf_val, sizeof(buf_val), "%s", key);
/* Add new key value */
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
/* Save key bundle */
noti->b_key = b;
snprintf(buf_key, sizeof(buf_key), "%d", type);
/* Get value using type key */
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
/* If value exist, remove this */
bundle_del(b, buf_key);
snprintf(buf_key, sizeof(buf_key), "%dtype%d", type, num_args);
snprintf(buf_val, sizeof(buf_val), "%d", var_type);
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
bundle_del(b, buf_key);
}
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
switch (var_type) {
case NOTIFICATION_VARIABLE_TYPE_INT:
num_args);
snprintf(buf_val, sizeof(buf_val), "%d", var_value_int);
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
bundle_del(b, buf_key);
}
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
break;
case NOTIFICATION_VARIABLE_TYPE_DOUBLE:
var_value_double = va_arg(var_args, double);
snprintf(buf_val, sizeof(buf_val), "%.2f",
var_value_double);
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
bundle_del(b, buf_key);
}
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
break;
case NOTIFICATION_VARIABLE_TYPE_STRING:
var_value_string = va_arg(var_args, char *);
snprintf(buf_val, sizeof(buf_val), "%s",
var_value_string);
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
bundle_del(b, buf_key);
}
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
break;
case NOTIFICATION_VARIABLE_TYPE_COUNT:
var_value_count =
snprintf(buf_val, sizeof(buf_val), "%d",
var_value_count);
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
bundle_del(b, buf_key);
}
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
break;
default:
NOTIFICATION_ERR("Error. invalid variable type. : %d",
snprintf(buf_key, sizeof(buf_key), "num%d", type);
snprintf(buf_val, sizeof(buf_val), "%d", noti->num_format_args);
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
bundle_del(b, buf_key);
}
- bundle_add(b, buf_key, buf_val);
+ bundle_add_str(b, buf_key, buf_val);
noti->b_format_args = b;
{
bundle *b = NULL;
char buf_key[32] = { 0, };
- const char *ret_val = NULL;
- const char *get_str = NULL;
+ char *ret_val = NULL;
+ char *get_str = NULL;
notification_text_type_e check_type = NOTIFICATION_TEXT_TYPE_NONE;
//int display_option_flag = 0;
snprintf(buf_key, sizeof(buf_key), "%d", type);
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL && noti->domain != NULL
&& noti->dir != NULL) {
/* Get application string */
/* Get basic text */
snprintf(buf_key, sizeof(buf_key), "%d", type);
- get_str = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &get_str);
}
check_type = type;
- /* Set display option is off type when option is off, type is noti */
- /*if (get_str != NULL && display_option_flag == 1
- && noti->type == NOTIFICATION_TYPE_NOTI) {
- if (type == NOTIFICATION_TEXT_TYPE_CONTENT
- || type == NOTIFICATION_TEXT_TYPE_GROUP_CONTENT) {
- // Set check_type to option content string
- if (type == NOTIFICATION_TEXT_TYPE_CONTENT) {
- check_type =
- NOTIFICATION_TEXT_TYPE_CONTENT_FOR_DISPLAY_OPTION_IS_OFF;
- } else if (type == NOTIFICATION_TEXT_TYPE_GROUP_CONTENT) {
- check_type =
- NOTIFICATION_TEXT_TYPE_GROUP_CONTENT_FOR_DISPLAY_OPTION_IS_OFF;
- }
-
- // Check key
- if (noti->b_key != NULL) {
- b = noti->b_key;
-
- // Get text domain and dir
- _notification_get_text_domain(noti);
-
- snprintf(buf_key, sizeof(buf_key), "%d",
- check_type);
-
- ret_val = bundle_get_val(b, buf_key);
- if (ret_val != NULL && noti->domain != NULL
- && noti->dir != NULL) {
- // Get application string
- bindtextdomain(noti->domain, noti->dir);
-
- get_check_type_str =
- dgettext(noti->domain, ret_val);
- } else if (ret_val != NULL) {
- // Get system string
- get_check_type_str =
- dgettext("sys_string", ret_val);
- } else {
- get_check_type_str = NULL;
- }
- }
-
- if (get_check_type_str == NULL && noti->b_text != NULL) {
- b = noti->b_text;
- // Get basic text
- snprintf(buf_key, sizeof(buf_key), "%d",
- check_type);
-
- get_check_type_str = bundle_get_val(b, buf_key);
- }
- }
-
- if (get_check_type_str != NULL) {
- // Replace option off type string
- get_str = get_check_type_str;
- } else {
- // Set default string
- get_str =
- dgettext("sys_string", "IDS_COM_POP_MISSED_EVENT");
- }
- }*/
-
if (get_str != NULL) {
/* Get number format args */
b = noti->b_format_args;
if (b != NULL) {
snprintf(buf_key, sizeof(buf_key), "num%d", check_type);
- ret_val = bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL) {
noti->num_format_args = atoi(ret_val);
}
/* Check first variable is count, LEFT pos */
snprintf(buf_key, sizeof(buf_key), "%dtype%d",
check_type, num_args);
- ret_val = bundle_get_val(b, buf_key);
- ret_var_type = atoi(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_var_type = atoi(ret_val);
+ }
if (ret_var_type == NOTIFICATION_VARIABLE_TYPE_COUNT) {
/* Get var Value */
snprintf(buf_key, sizeof(buf_key), "%dvalue%d",
check_type, num_args);
- ret_val = bundle_get_val(b, buf_key);
- ret_variable_int = atoi(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_variable_int = atoi(ret_val);
+ }
if (ret_variable_int ==
NOTIFICATION_COUNT_POS_LEFT) {
sizeof(buf_key),
"%dtype%d", check_type,
num_args);
- ret_val =
- bundle_get_val(b, buf_key);
- ret_var_type = atoi(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_var_type = atoi(ret_val);
+ }
if (ret_var_type ==
NOTIFICATION_VARIABLE_TYPE_COUNT)
{
} else {
/* Get var Value */
snprintf(buf_key,
- sizeof
- (buf_key),
+ sizeof(buf_key),
"%dvalue%d",
check_type,
num_args);
- ret_val =
- bundle_get_val(b,
- buf_key);
- ret_variable_int =
- atoi(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_variable_int = atoi(ret_val);
+ }
}
snprintf(buf_str,
sizeof(buf_key),
"%dvalue%d",
check_type, num_args);
- ret_val =
- bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
if (ret_val != NULL && noti->domain != NULL && noti->dir != NULL) {
/* Get application string */
translated_str = NULL;
}
- strncpy(buf_str, translated_str, sizeof(buf_str));
+ strncpy(buf_str, translated_str, sizeof(buf_str) - 1);
int src_len = strlen(result_str);
int max_len = NOTI_TEXT_RESULT_LEN - src_len - 1;
sizeof(buf_key),
"%dvalue%d",
check_type, num_args);
- ret_val =
- bundle_get_val(b, buf_key);
- ret_variable_double =
- atof(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_variable_double = atof(ret_val);
+ }
snprintf(buf_str,
sizeof(buf_str),
sizeof(buf_key),
"%dtype%d", check_type,
num_args + *(temp_str + 1) - 49);
- ret_val =
- bundle_get_val(b, buf_key);
- ret_var_type = atoi(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_var_type = atoi(ret_val);
+ }
if (ret_var_type ==
NOTIFICATION_VARIABLE_TYPE_COUNT)
{
"%dvalue%d",
check_type,
num_args + *(temp_str + 1) - 49);
- ret_val =
- bundle_get_val(b,
- buf_key);
- ret_variable_int =
- atoi(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_variable_int = atoi(ret_val);
+ }
}
snprintf(buf_str,
sizeof(buf_key),
"%dvalue%d",
check_type, num_args + *(temp_str + 1) - 49);
- ret_val =
- bundle_get_val(b, buf_key);
+ bundle_get_str(b, buf_key, &ret_val);
snprintf(buf_str,
sizeof(buf_str), "%s",
sizeof(buf_key),
"%dvalue%d",
check_type, num_args + *(temp_str + 1) - 49);
- ret_val =
- bundle_get_val(b, buf_key);
- ret_variable_double =
- atof(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_variable_double = atof(ret_val);
+ }
snprintf(buf_str,
sizeof(buf_str),
if (num_args < noti->num_format_args) {
snprintf(buf_key, sizeof(buf_key), "%dtype%d",
check_type, num_args);
- ret_val = bundle_get_val(b, buf_key);
- ret_var_type = atoi(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_var_type = atoi(ret_val);
+ }
+
if (ret_var_type ==
NOTIFICATION_VARIABLE_TYPE_COUNT) {
/* Get var Value */
snprintf(buf_key, sizeof(buf_key),
"%dvalue%d", check_type,
num_args);
- ret_val = bundle_get_val(b, buf_key);
- ret_variable_int = atoi(ret_val);
+ bundle_get_str(b, buf_key, &ret_val);
+ if (ret_val != NULL) {
+ ret_variable_int = atoi(ret_val);
+ }
if (ret_variable_int ==
NOTIFICATION_COUNT_POS_RIGHT) {
*text = NULL;
}
- NOTIFICATION_INFO("text[%s]", *text);
-
return NOTIFICATION_ERROR_NONE;
}
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int notification_set_application(notification_h noti,
- const char *pkgname)
-{
- if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (noti->launch_pkgname) {
- free(noti->launch_pkgname);
- }
-
- noti->launch_pkgname = strdup(pkgname);
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_get_application(notification_h noti,
- char **pkgname)
-{
- if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (noti->launch_pkgname) {
- *pkgname = noti->launch_pkgname;
- } else {
- *pkgname = noti->caller_pkgname;
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
-
EXPORT_API int notification_set_launch_option(notification_h noti,
notification_launch_option_type type, void *option)
{
+ int err = NOTIFICATION_ERROR_NONE;
int ret = 0;
bundle *b = NULL;
app_control_h app_control = option;
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
- if (app_control == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
- if (type != NOTIFICATION_LAUNCH_OPTION_APP_CONTROL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ if (noti == NULL || app_control == NULL || type != NOTIFICATION_LAUNCH_OPTION_APP_CONTROL) {
+ err = NOTIFICATION_ERROR_INVALID_PARAMETER;
+ goto out;
}
- if ((ret = app_control_export_as_bundle(app_control, &b)) == APP_CONTROL_ERROR_NONE) {
- return notification_set_execute_option(noti,
- NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
- NULL, NULL,
- b);
- } else {
+ if ((ret = app_control_export_as_bundle(app_control, &b)) != APP_CONTROL_ERROR_NONE) {
NOTIFICATION_ERR("Failed to convert appcontrol to bundle:%d", ret);
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ err = NOTIFICATION_ERROR_INVALID_PARAMETER;
+ goto out;
}
+
+ err = notification_set_execute_option(noti, NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH, NULL, NULL, b);
+
+out:
+ if (b)
+ bundle_free(b);
+
+ return err;
}
EXPORT_API int notification_get_launch_option(notification_h noti,
if (noti == NULL) {
err = NOTIFICATION_ERROR_INVALID_PARAMETER;
NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
- err = NOTIFICATION_ERROR_INVALID_PARAMETER;
+ goto out;
}
if (event_type < NOTIFICATION_EVENT_TYPE_CLICK_ON_BUTTON_1
}
else {
app_control_destroy(app_control_new);
+ app_control_new = NULL;
NOTIFICATION_ERR("Failed to import app control from bundle [%d]", err);
err = NOTIFICATION_ERROR_IO_ERROR;
goto out;
return err;
}
-EXPORT_API int notification_set_execute_option(notification_h noti,
- notification_execute_type_e type,
- const char *text,
- const char *key,
- bundle *service_handle)
-{
- char buf_key[32] = { 0, };
- const char *ret_val = NULL;
- bundle *b = NULL;
-
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (type <= NOTIFICATION_EXECUTE_TYPE_NONE
- || type >= NOTIFICATION_EXECUTE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- /* Create execute option bundle if does not exist */
- if (noti->b_execute_option == NULL) {
- noti->b_execute_option = bundle_create();
- }
-
- b = noti->b_execute_option;
-
- /* Save text */
- if (text != NULL) {
- /* Make text key */
- snprintf(buf_key, sizeof(buf_key), "text%d", type);
-
- /* Check text key exist */
- ret_val = bundle_get_val(b, buf_key);
- if (ret_val != NULL) {
- /* Remove previous data */
- bundle_del(b, buf_key);
- }
-
- /* Add text data */
- bundle_add(b, buf_key, text);
- }
-
- /* Save key */
- if (key != NULL) {
- /* Make key key */
- snprintf(buf_key, sizeof(buf_key), "key%d", type);
-
- /* Check key key exist */
- ret_val = bundle_get_val(b, buf_key);
- if (ret_val != NULL) {
- /* Remove previous data */
- bundle_del(b, buf_key);
- }
-
- /* Add text data */
- bundle_add(b, buf_key, key);
- }
-
- switch ((int)type) {
- case NOTIFICATION_EXECUTE_TYPE_RESPONDING:
- /* Remove previous data if exist */
- if (noti->b_service_responding != NULL) {
- bundle_free(noti->b_service_responding);
- noti->b_service_responding = NULL;
- }
-
- /* Save service handle */
- if (service_handle != NULL) {
- noti->b_service_responding = bundle_dup(service_handle);
- }
- break;
- case NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH:
- /* Remove previous data if exist */
- if (noti->b_service_single_launch != NULL) {
- bundle_free(noti->b_service_single_launch);
- noti->b_service_single_launch = NULL;
- }
-
- /* Save service handle */
- if (service_handle != NULL) {
- noti->b_service_single_launch =
- bundle_dup(service_handle);
- }
- break;
- case NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH:
- /* Remove previous data if exist */
- if (noti->b_service_multi_launch != NULL) {
- bundle_free(noti->b_service_multi_launch);
- noti->b_service_multi_launch = NULL;
- }
-
- /* Save service handle */
- if (service_handle != NULL) {
- noti->b_service_multi_launch =
- bundle_dup(service_handle);
- }
- break;
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_get_execute_option(notification_h noti,
- notification_execute_type_e type,
- const char **text,
- bundle **service_handle)
-{
- char buf_key[32] = { 0, };
- const char *ret_val = NULL;
- char *get_str = NULL;
- bundle *b = NULL;
-
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (type <= NOTIFICATION_EXECUTE_TYPE_NONE
- || type >= NOTIFICATION_EXECUTE_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- switch (type) {
- case NOTIFICATION_EXECUTE_TYPE_RESPONDING:
- b = noti->b_service_responding;
- break;
- case NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH:
- b = noti->b_service_single_launch;
- break;
- case NOTIFICATION_EXECUTE_TYPE_MULTI_LAUNCH:
- b = noti->b_service_multi_launch;
- default:
- break;
- }
-
- if (b != NULL) {
- // Return text
- if (text != NULL) {
- // Get text domain and dir
- if (noti->domain == NULL || noti->dir == NULL) {
- _notification_get_text_domain(noti);
- }
-
- /* Make key */
- snprintf(buf_key, sizeof(buf_key), "key%d", type);
- /* Check key key exist */
- ret_val = bundle_get_val(b, buf_key);
- if (ret_val != NULL && noti->domain != NULL
- && noti->dir != NULL) {
- /* Get application string */
- bindtextdomain(noti->domain, noti->dir);
- get_str = dgettext(noti->domain, ret_val);
- *text = get_str;
- } else if (ret_val != NULL) {
- /* Get system string */
- get_str = dgettext("sys_string", ret_val);
-
- *text = get_str;
- } else {
- /* Get basic text */
- snprintf(buf_key, sizeof(buf_key), "text%d",
- type);
-
- ret_val = bundle_get_val(b, buf_key);
-
- *text = ret_val;
- }
- }
- }
-
- if (service_handle != NULL) {
- *service_handle = b;
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
EXPORT_API int notification_set_property(notification_h noti,
int flags)
}
/* Set app list */
+ if (applist == 0xffffffff) { /* 0xffffffff means old NOTIFICATION_DISPLAY_APP_ALL */
+ applist = NOTIFICATION_DISPLAY_APP_ALL;
+ }
noti->display_applist = applist;
return NOTIFICATION_ERROR_NONE;
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int notification_set_pkgname(notification_h noti,
- const char *pkgname)
-{
- /* check noti and pkgname are valid data */
- if (noti == NULL || pkgname == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- /* Remove previous caller pkgname */
- if (noti->caller_pkgname) {
- free(noti->caller_pkgname);
- noti->caller_pkgname = NULL;
- }
-
- noti->caller_pkgname = strdup(pkgname);
-
- return NOTIFICATION_ERROR_NONE;
-}
-
EXPORT_API int notification_get_pkgname(notification_h noti,
char **pkgname)
{
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int notification_get_id(notification_h noti,
- int *group_id, int *priv_id)
-{
- /* check noti is valid data */
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- /* Check group_id is valid data */
- if (group_id) {
- /* Set group id */
- if (noti->group_id < NOTIFICATION_GROUP_ID_NONE) {
- *group_id = NOTIFICATION_GROUP_ID_NONE;
- } else {
- *group_id = noti->group_id;
- }
- }
-
- /* Check priv_id is valid data */
- if (priv_id) {
- /* Set priv_id */
- *priv_id = noti->priv_id;
- }
- return NOTIFICATION_ERROR_NONE;
-}
EXPORT_API int notification_get_type(notification_h noti,
notification_type_e *type)
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int notification_insert(notification_h noti,
- int *priv_id)
-{
- int ret = 0;
- int id = 0;
-
- /* Check noti is vaild data */
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- /* Check noti type is valid type */
- if (noti->type <= NOTIFICATION_TYPE_NONE
- || noti->type >= NOTIFICATION_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- /* Save insert time */
- noti->insert_time = time(NULL);
- ret = notification_ipc_request_insert(noti, &id);
- if (ret != NOTIFICATION_ERROR_NONE) {
- return ret;
- }
- noti->priv_id = id;
- NOTIFICATION_DBG("from master:%d", id);
-
- /* If priv_id is valid data, set priv_id */
- if (priv_id != NULL) {
- *priv_id = noti->priv_id;
- }
- return NOTIFICATION_ERROR_NONE;
-}
EXPORT_API int notification_update(notification_h noti)
{
return ret;
}
-EXPORT_API int notification_update_async(notification_h noti,
- void (*result_cb)(int priv_id, int result, void *data), void *user_data)
+EXPORT_API int notification_delete_all(notification_type_e type)
{
int ret = 0;
+ char *caller_pkgname = NULL;
- if (noti == NULL) {
+ if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) {
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
- /* Update insert time ? */
- noti->insert_time = time(NULL);
- ret = notification_ipc_request_update_async(noti, result_cb, user_data);
-
- return ret;
-}
+ caller_pkgname = notification_get_pkgname_by_pid();
-EXPORT_API int notifiation_clear(notification_type_e type)
-{
- int ret = 0;
+ ret = notification_ipc_request_delete_multiple(type, caller_pkgname);
- if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ if (caller_pkgname) {
+ free(caller_pkgname);
}
- ret = notification_ipc_request_delete_multiple(type, NULL);
-
return ret;
}
-EXPORT_API int notification_clear(notification_type_e type)
+EXPORT_API int notification_delete(notification_h noti)
{
int ret = 0;
- if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) {
+ if (noti == NULL) {
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
- ret = notification_ipc_request_delete_multiple(type, NULL);
+ ret = notification_ipc_request_delete_single(NOTIFICATION_TYPE_NONE, noti->caller_pkgname, noti->priv_id);
return ret;
}
-EXPORT_API int notification_delete_all(notification_type_e type)
+static notification_h _notification_create(notification_type_e type)
{
- int ret = 0;
- char *caller_pkgname = NULL;
+ notification_h noti = NULL;
+ package_info_h package_info = NULL;
+ char *app_id = NULL;
+ char *domain_name = NULL;
+ char *app_root_path = NULL;
+ char locale_directory[PATH_MAX] = { 0, }; /* PATH_MAX 4096 */
+ int err_app_manager = APP_MANAGER_ERROR_NONE;
if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ NOTIFICATION_ERR("INVALID TYPE : %d", type);
+ set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER);
+ return NULL;
}
- caller_pkgname = notification_get_pkgname_by_pid();
-
- ret = notification_ipc_request_delete_multiple(type, caller_pkgname);
-
- if (caller_pkgname) {
- free(caller_pkgname);
- }
-
- return ret;
-}
-
-EXPORT_API int notification_delete_all_by_type(const char *pkgname,
- notification_type_e type)
-{
- int ret = 0;
- char *caller_pkgname = NULL;
-
- if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (pkgname == NULL) {
- caller_pkgname = notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(pkgname);
- }
-
- ret = notification_ipc_request_delete_multiple(type, caller_pkgname);
-
- if (caller_pkgname) {
- free(caller_pkgname);
- }
-
- return ret;
-}
-
-EXPORT_API int notification_delete_by_priv_id(const char *pkgname,
- notification_type_e type,
- int priv_id)
-{
- int ret = 0;
- char *caller_pkgname = NULL;
-
- if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (pkgname == NULL) {
- caller_pkgname = notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(pkgname);
- }
-
- ret = notification_ipc_request_delete_single(type, caller_pkgname, priv_id);
-
- if (caller_pkgname) {
- free(caller_pkgname);
- }
-
- return ret;
-}
-
-EXPORT_API int notification_delete(notification_h noti)
-{
- int ret = 0;
-
+ noti = (notification_h) calloc(1, sizeof(struct _notification));
if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ NOTIFICATION_ERR("NO MEMORY : noti == NULL");
+ set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
+ return NULL;
}
- ret = notification_ipc_request_delete_single(NOTIFICATION_TYPE_NONE, noti->caller_pkgname, noti->priv_id);
-
- return ret;
-}
-
-EXPORT_API int notification_update_progress(notification_h noti,
- int priv_id,
- double progress)
-{
- char *caller_pkgname = NULL;
- int input_priv_id = 0;
- int ret = 0;
- double input_progress = 0.0;
-
- if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- } else {
- input_priv_id = noti->priv_id;
- }
- } else {
- input_priv_id = priv_id;
- }
+ noti->type = type;
- if (noti == NULL) {
- caller_pkgname = notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(noti->caller_pkgname);
- }
+ if (type == NOTIFICATION_TYPE_NOTI)
+ noti->layout = NOTIFICATION_LY_NOTI_EVENT_SINGLE;
+ else if (type == NOTIFICATION_TYPE_ONGOING)
+ noti->layout = NOTIFICATION_LY_ONGOING_PROGRESS;
- if (progress < 0.0) {
- input_progress = 0.0;
- } else if (progress > 1.0) {
- input_progress = 1.0;
- } else {
- input_progress = progress;
- }
+ noti->caller_pkgname = notification_get_pkgname_by_pid();
+ noti->group_id = NOTIFICATION_GROUP_ID_NONE;
+ noti->priv_id = NOTIFICATION_PRIV_ID_NONE;
+ noti->sound_type = NOTIFICATION_SOUND_TYPE_NONE;
+ noti->vibration_type = NOTIFICATION_VIBRATION_TYPE_NONE;
+ noti->led_operation = NOTIFICATION_LED_OP_OFF;
+ noti->display_applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER | NOTIFICATION_DISPLAY_APP_INDICATOR;
- ret = notification_ongoing_update_progress(caller_pkgname, input_priv_id,
- input_progress);
- if (caller_pkgname) {
- free(caller_pkgname);
+ err_app_manager = app_manager_get_app_id(getpid(), &app_id);
+ if (err_app_manager != APP_MANAGER_ERROR_NONE || app_id == NULL) {
+ NOTIFICATION_WARN("app_manager_get_app_id failed err[%d] app_id[%p]", err_app_manager, app_id);
+ goto out;
}
- return ret;
-}
-
-EXPORT_API int notification_update_size(notification_h noti,
- int priv_id,
- double size)
-{
- char *caller_pkgname = NULL;
- int input_priv_id = 0;
- int ret = 0;
- double input_size = 0.0;
+ /* app name is used as domain name */
+ /* domain_name is allocated by app_get_package_app_name */
+ err_app_manager = app_get_package_app_name(app_id, &domain_name);
- if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- } else {
- input_priv_id = noti->priv_id;
- }
- } else {
- input_priv_id = priv_id;
+ if (err_app_manager != APP_ERROR_NONE || domain_name == NULL) {
+ NOTIFICATION_WARN("app_get_package_app_name failed err[%d] domain_name[%p]", err_app_manager, domain_name);
+ goto out;
}
- if (noti == NULL) {
- caller_pkgname = notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(noti->caller_pkgname);
- }
+ err_app_manager = package_info_create(noti->caller_pkgname, &package_info);
- if (size < 0.0) {
- input_size = 0.0;
- } else {
- input_size = size;
+ if (err_app_manager != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) {
+ NOTIFICATION_WARN("package_info_create failed err[%d] package_info[%p]", err_app_manager, package_info);
+ goto out;
}
- ret = notification_ongoing_update_size(caller_pkgname, input_priv_id,
- input_size);
+ err_app_manager = package_info_get_root_path(package_info, &app_root_path);
- if (caller_pkgname) {
- free(caller_pkgname);
+ if (err_app_manager != PACKAGE_MANAGER_ERROR_NONE || app_root_path == NULL) {
+ NOTIFICATION_WARN("package_info_get_root_path failed err[%d] app_root_path[%p]", err_app_manager, app_root_path);
+ goto out;
}
- return ret;
-}
-
-EXPORT_API int notification_update_content(notification_h noti,
- int priv_id,
- const char *content)
-{
- char *caller_pkgname = NULL;
- int input_priv_id = 0;
- int ret = 0;
+ snprintf(locale_directory, PATH_MAX, "%s/res/locale", app_root_path);
- if (priv_id <= NOTIFICATION_PRIV_ID_NONE) {
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- } else {
- input_priv_id = noti->priv_id;
- }
- } else {
- input_priv_id = priv_id;
- }
+ noti->domain = strdup(domain_name);
+ noti->dir = strdup(locale_directory);
- if (noti == NULL) {
- caller_pkgname = notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(noti->caller_pkgname);
+out:
+ if (domain_name) {
+ free(domain_name);
}
- ret = notification_ongoing_update_content(caller_pkgname, input_priv_id,
- content);
-
- if (caller_pkgname) {
- free(caller_pkgname);
+ if (app_id) {
+ free(app_id);
}
- return ret;
-}
-
-static notification_h _notification_create(notification_type_e type)
-{
- notification_h noti = NULL;
-
- if (type <= NOTIFICATION_TYPE_NONE || type >= NOTIFICATION_TYPE_MAX) {
- NOTIFICATION_ERR("INVALID TYPE : %d", type);
- set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER);
- return NULL;
+ if (app_root_path) {
+ free(app_root_path);
}
- noti = (notification_h) calloc(1, sizeof(struct _notification));
- if (noti == NULL) {
- NOTIFICATION_ERR("NO MEMORY : noti == NULL");
- set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
- return NULL;
+ if (package_info) {
+ package_info_destroy(package_info);
}
- noti->type = type;
-
- if (type == NOTIFICATION_TYPE_NOTI)
- noti->layout = NOTIFICATION_LY_NOTI_EVENT_SINGLE;
- else if (type == NOTIFICATION_TYPE_ONGOING)
- noti->layout = NOTIFICATION_LY_ONGOING_PROGRESS;
-
- noti->caller_pkgname = notification_get_pkgname_by_pid();
- noti->group_id = NOTIFICATION_GROUP_ID_NONE;
- noti->priv_id = NOTIFICATION_PRIV_ID_NONE;
- noti->sound_type = NOTIFICATION_SOUND_TYPE_NONE;
- noti->vibration_type = NOTIFICATION_VIBRATION_TYPE_NONE;
- noti->led_operation = NOTIFICATION_LED_OP_OFF;
- noti->display_applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY | NOTIFICATION_DISPLAY_APP_TICKER | NOTIFICATION_DISPLAY_APP_INDICATOR;
/*!
* \NOTE
* Other fields are already initialized with ZERO.
return noti;
}
-EXPORT_API notification_h notification_new(notification_type_e type,
- int group_id, int priv_id)
-{
- return _notification_create(type);
-}
-
EXPORT_API notification_h notification_create(notification_type_e type)
{
return _notification_create(type);
}
-EXPORT_API notification_h notification_load(char *pkgname,
- int priv_id)
-{
- int ret = 0;
- notification_h noti = NULL;
-
- noti = (notification_h) calloc(1, sizeof(struct _notification));
- if (noti == NULL) {
- NOTIFICATION_ERR("NO MEMORY : noti == NULL");
- return NULL;
- }
-
- ret = notification_noti_get_by_priv_id(noti, pkgname, priv_id);
- if (ret != NOTIFICATION_ERROR_NONE) {
- notification_free(noti);
- return NULL;
- }
-
- return noti;
-}
-
EXPORT_API notification_h notification_load_by_tag(const char *tag)
{
int ret = 0;
if (!caller_pkgname) {
NOTIFICATION_ERR("Failed to get a package name");
set_last_result(NOTIFICATION_ERROR_OUT_OF_MEMORY);
-
return NULL;
}
return NULL;
}
- ret = notification_ipc_request_load_noti_by_tag(noti, caller_pkgname, tag);
+ ret = notification_noti_get_by_tag(noti, caller_pkgname, (char*)tag);
free(caller_pkgname);
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int
-notification_resister_changed_cb(void (*changed_cb)
- (void *data, notification_type_e type),
- void *user_data)
+EXPORT_API int notification_set_tag(notification_h noti, const char *tag)
{
- notification_cb_list_s *noti_cb_list_new = NULL;
- notification_cb_list_s *noti_cb_list = NULL;
-
- if (changed_cb == NULL) {
+ /* Check noti is valid data */
+ if (noti == NULL) {
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
- if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
- return NOTIFICATION_ERROR_IO_ERROR;
- }
-
- noti_cb_list_new =
- (notification_cb_list_s *) malloc(sizeof(notification_cb_list_s));
- if (noti_cb_list_new == NULL) {
- return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ if (tag != NULL) {
+ /* save input TAG */
+ if (noti->tag != NULL) {
+ free(noti->tag);
+ }
+ noti->tag = strdup(tag);
}
- noti_cb_list_new->next = NULL;
- noti_cb_list_new->prev = NULL;
-
- noti_cb_list_new->cb_type = NOTIFICATION_CB_NORMAL;
- noti_cb_list_new->changed_cb = changed_cb;
- noti_cb_list_new->detailed_changed_cb = NULL;
- noti_cb_list_new->data = user_data;
-
- if (g_notification_cb_list == NULL) {
- g_notification_cb_list = noti_cb_list_new;
- } else {
- noti_cb_list = g_notification_cb_list;
+ return NOTIFICATION_ERROR_NONE;
- while (noti_cb_list->next != NULL) {
- noti_cb_list = noti_cb_list->next;
- }
+}
- noti_cb_list->next = noti_cb_list_new;
- noti_cb_list_new->prev = noti_cb_list;
+EXPORT_API int notification_get_tag(notification_h noti, const char **tag)
+{
+ /* Check noti is valid data */
+ if (noti == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
+
+ *tag = noti->tag;
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int
-notification_unresister_changed_cb(void (*changed_cb)
- (void *data, notification_type_e type))
+void notification_call_posted_toast_cb(const char *message)
{
- notification_cb_list_s *noti_cb_list = NULL;
- notification_cb_list_s *noti_cb_list_prev = NULL;
- notification_cb_list_s *noti_cb_list_next = NULL;
-
- noti_cb_list = g_notification_cb_list;
-
- if (changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ if (posted_toast_message_cb != NULL) {
+ posted_toast_message_cb((void*)message);
}
- if (noti_cb_list == NULL) {
+}
+
+EXPORT_API int notification_set_ongoing_flag(notification_h noti, bool ongoing_flag)
+{
+ if (noti == NULL)
return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
- while (noti_cb_list->prev != NULL) {
- noti_cb_list = noti_cb_list->prev;
- }
+ noti->ongoing_flag = ongoing_flag;
- do {
- if (noti_cb_list->changed_cb == changed_cb) {
- noti_cb_list_prev = noti_cb_list->prev;
- noti_cb_list_next = noti_cb_list->next;
+ return NOTIFICATION_ERROR_NONE;
+}
- if (noti_cb_list_prev == NULL) {
- g_notification_cb_list = noti_cb_list_next;
- } else {
- noti_cb_list_prev->next = noti_cb_list_next;
- }
+EXPORT_API int notification_get_ongoing_flag(notification_h noti, bool *ongoing_flag)
+{
+ if (noti == NULL || ongoing_flag == NULL)
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
- if (noti_cb_list_next == NULL) {
- if (noti_cb_list_prev != NULL) {
- noti_cb_list_prev->next = NULL;
- }
- } else {
- noti_cb_list_next->prev = noti_cb_list_prev;
- }
+ *ongoing_flag = noti->ongoing_flag;
- free(noti_cb_list);
+ return NOTIFICATION_ERROR_NONE;
+}
- if (g_notification_cb_list == NULL)
- notification_ipc_monitor_fini();
- return NOTIFICATION_ERROR_NONE;
- }
- noti_cb_list = noti_cb_list->next;
- } while (noti_cb_list != NULL);
+EXPORT_API int notification_add_button(notification_h noti, notification_button_index_e button_index)
+{
+ if (noti == NULL || button_index < NOTIFICATION_BUTTON_1 || button_index > NOTIFICATION_BUTTON_6)
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int
-notification_register_detailed_changed_cb(
- void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
- void *user_data)
+EXPORT_API int notification_remove_button(notification_h noti, notification_button_index_e button_index)
{
- notification_cb_list_s *noti_cb_list_new = NULL;
- notification_cb_list_s *noti_cb_list = NULL;
-
- if (detailed_changed_cb == NULL) {
+ if (noti == NULL || button_index < NOTIFICATION_BUTTON_1 || button_index > NOTIFICATION_BUTTON_6)
return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
- if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
- return NOTIFICATION_ERROR_IO_ERROR;
- }
-
- noti_cb_list_new =
- (notification_cb_list_s *) malloc(sizeof(notification_cb_list_s));
- if (noti_cb_list_new == NULL) {
- return NOTIFICATION_ERROR_OUT_OF_MEMORY;
+ if (noti->b_event_handler[button_index - 1]) {
+ bundle_free(noti->b_event_handler[button_index - 1]);
+ noti->b_event_handler[button_index - 1] = NULL;
}
- noti_cb_list_new->next = NULL;
- noti_cb_list_new->prev = NULL;
-
- noti_cb_list_new->cb_type = NOTIFICATION_CB_DETAILED;
- noti_cb_list_new->changed_cb = NULL;
- noti_cb_list_new->detailed_changed_cb = detailed_changed_cb;
- noti_cb_list_new->data = user_data;
+ return NOTIFICATION_ERROR_NONE;
+}
- if (g_notification_cb_list == NULL) {
- g_notification_cb_list = noti_cb_list_new;
- } else {
- noti_cb_list = g_notification_cb_list;
+EXPORT_API int notification_set_auto_remove(notification_h noti, bool auto_remove)
+{
+ if (noti == NULL)
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
- while (noti_cb_list->next != NULL) {
- noti_cb_list = noti_cb_list->next;
- }
+ noti->auto_remove = auto_remove;
- noti_cb_list->next = noti_cb_list_new;
- noti_cb_list_new->prev = noti_cb_list;
- }
return NOTIFICATION_ERROR_NONE;
}
-EXPORT_API int
-notification_unregister_detailed_changed_cb(
- void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
- void *user_data)
+EXPORT_API int notification_get_auto_remove(notification_h noti, bool *auto_remove)
{
- notification_cb_list_s *noti_cb_list = NULL;
- notification_cb_list_s *noti_cb_list_prev = NULL;
- notification_cb_list_s *noti_cb_list_next = NULL;
-
- noti_cb_list = g_notification_cb_list;
-
- if (detailed_changed_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
- if (noti_cb_list == NULL) {
+ if (noti == NULL || auto_remove == NULL)
return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- while (noti_cb_list->prev != NULL) {
- noti_cb_list = noti_cb_list->prev;
- }
-
- do {
- if (noti_cb_list->detailed_changed_cb == detailed_changed_cb) {
- noti_cb_list_prev = noti_cb_list->prev;
- noti_cb_list_next = noti_cb_list->next;
- if (noti_cb_list_prev == NULL) {
- g_notification_cb_list = noti_cb_list_next;
- } else {
- noti_cb_list_prev->next = noti_cb_list_next;
- }
-
- if (noti_cb_list_next == NULL) {
- if (noti_cb_list_prev != NULL) {
- noti_cb_list_prev->next = NULL;
- }
- } else {
- noti_cb_list_next->prev = noti_cb_list_prev;
- }
-
- free(noti_cb_list);
-
- if (g_notification_cb_list == NULL)
- notification_ipc_monitor_fini();
-
- return NOTIFICATION_ERROR_NONE;
- }
- noti_cb_list = noti_cb_list->next;
- } while (noti_cb_list != NULL);
-
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
-}
-
-EXPORT_API int notification_get_count(notification_type_e type,
- const char *pkgname,
- int group_id,
- int priv_id, int *count)
-{
- int ret = 0;
- int noti_count = 0;
-
- if (count == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- ret =
- notification_noti_get_count(type, pkgname, group_id, priv_id,
- ¬i_count);
- if (ret != NOTIFICATION_ERROR_NONE) {
- return ret;
- }
-
- *count = noti_count;
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_get_list(notification_type_e type,
- int count,
- notification_list_h *list)
-{
- notification_list_h get_list = NULL;
- int ret = 0;
-
- if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- ret = notification_noti_get_grouping_list(type, count, &get_list);
- if (ret != NOTIFICATION_ERROR_NONE) {
- return ret;
- }
-
- *list = get_list;
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int
-notification_get_grouping_list(notification_type_e type, int count,
- notification_list_h * list)
-{
- notification_list_h get_list = NULL;
- int ret = 0;
-
- if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- ret = notification_noti_get_grouping_list(type, count, &get_list);
- if (ret != NOTIFICATION_ERROR_NONE) {
- return ret;
- }
-
- *list = get_list;
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_get_detail_list(const char *pkgname,
- int group_id,
- int priv_id,
- int count,
- notification_list_h *list)
-{
- notification_list_h get_list = NULL;
- int ret = 0;
-
- if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- ret =
- notification_noti_get_detail_list(pkgname, group_id, priv_id, count,
- &get_list);
- if (ret != NOTIFICATION_ERROR_NONE) {
- return ret;
- }
-
- *list = get_list;
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_free_list(notification_list_h list)
-{
- notification_list_h cur_list = NULL;
- notification_h noti = NULL;
-
- if (list == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- cur_list = notification_list_get_head(list);
-
- while (cur_list != NULL) {
- noti = notification_list_get_data(cur_list);
- cur_list = notification_list_remove(cur_list, noti);
-
- notification_free(noti);
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_op_get_data(notification_op *noti_op, notification_op_data_type_e type,
- void *data)
-{
- if (noti_op == NULL || data == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- switch (type) {
- case NOTIFICATION_OP_DATA_TYPE:
- *((int*)data) = noti_op->type;
- break;
- case NOTIFICATION_OP_DATA_PRIV_ID:
- *((int*)data) = noti_op->priv_id;
- break;
- case NOTIFICATION_OP_DATA_NOTI:
- *((notification_h *)data) = noti_op->noti;
- break;
- case NOTIFICATION_OP_DATA_EXTRA_INFO_1:
- *((int*)data) = noti_op->extra_info_1;
- break;
- case NOTIFICATION_OP_DATA_EXTRA_INFO_2:
- *((int*)data) = noti_op->extra_info_2;
- break;
- default:
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- break;
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-void notification_call_changed_cb(notification_op *op_list, int op_num)
-{
- notification_cb_list_s *noti_cb_list = NULL;
- notification_type_e type = 0;
-
- if (g_notification_cb_list == NULL) {
- return;
- }
- noti_cb_list = g_notification_cb_list;
-
- while (noti_cb_list->prev != NULL) {
- noti_cb_list = noti_cb_list->prev;
- }
-
- if (op_list == NULL) {
- NOTIFICATION_ERR("invalid data");
- return ;
- }
-
- notification_get_type(op_list->noti, &type);
-
- while (noti_cb_list != NULL) {
- if (noti_cb_list->cb_type == NOTIFICATION_CB_NORMAL && noti_cb_list->changed_cb) {
- noti_cb_list->changed_cb(noti_cb_list->data,
- type);
- }
- if (noti_cb_list->cb_type == NOTIFICATION_CB_DETAILED && noti_cb_list->detailed_changed_cb) {
- noti_cb_list->detailed_changed_cb(noti_cb_list->data,
- type, op_list, op_num);
- }
-
- noti_cb_list = noti_cb_list->next;
- }
-}
-
-EXPORT_API int notification_is_service_ready(void)
-{
- return notification_ipc_is_master_ready();
-}
-
-EXPORT_API int
-notification_add_deferred_task(
- void (*deferred_task_cb)(void *data), void *user_data)
-{
- if (deferred_task_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- return notification_ipc_add_deffered_task(deferred_task_cb, user_data);
-}
-
-EXPORT_API int
-notification_del_deferred_task(
- void (*deferred_task_cb)(void *data))
-{
- if (deferred_task_cb == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- return notification_ipc_del_deffered_task(deferred_task_cb);
-}
-
-/* notification_set_icon will be removed */
-EXPORT_API int notification_set_icon(notification_h noti,
- const char *icon_path)
-{
- int ret_err = NOTIFICATION_ERROR_NONE;
-
- ret_err =
- notification_set_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
- icon_path);
-
- return ret_err;
-}
-
-/* notification_get_icon will be removed */
-EXPORT_API int notification_get_icon(notification_h noti,
- char **icon_path)
-{
- int ret_err = NOTIFICATION_ERROR_NONE;
- char *ret_image_path = NULL;
-
- ret_err =
- notification_get_image(noti, NOTIFICATION_IMAGE_TYPE_ICON,
- &ret_image_path);
-
- if (ret_err == NOTIFICATION_ERROR_NONE && icon_path != NULL) {
- *icon_path = ret_image_path;
-
- //NOTIFICATION_DBG("Get icon : %s", *icon_path);
- }
-
- return ret_err;
-}
-
-EXPORT_API int notification_set_title(notification_h noti,
- const char *title,
- const char *loc_title)
-{
- int noti_err = NOTIFICATION_ERROR_NONE;
-
- noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
- title, loc_title,
- NOTIFICATION_VARIABLE_TYPE_NONE);
-
- return noti_err;
-}
-
-EXPORT_API int notification_get_title(notification_h noti,
- char **title,
- char **loc_title)
-{
- int noti_err = NOTIFICATION_ERROR_NONE;
- char *ret_text = NULL;
-
- noti_err =
- notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
- &ret_text);
-
- if (title != NULL) {
- *title = ret_text;
- }
-
- if (loc_title != NULL) {
- *loc_title = NULL;
- }
-
- return noti_err;
-}
-
-EXPORT_API int notification_set_content(notification_h noti,
- const char *content,
- const char *loc_content)
-{
- int noti_err = NOTIFICATION_ERROR_NONE;
-
- noti_err = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
- content, loc_content,
- NOTIFICATION_VARIABLE_TYPE_NONE);
-
- return noti_err;
-}
-
-EXPORT_API int notification_get_content(notification_h noti,
- char **content,
- char **loc_content)
-{
- int noti_err = NOTIFICATION_ERROR_NONE;
- char *ret_text = NULL;
-
- noti_err =
- notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
- &ret_text);
-
- if (content != NULL) {
- *content = ret_text;
- }
-
- if (loc_content != NULL) {
- *loc_content = NULL;
- }
-
- return noti_err;
-
-#if 0
- ret =
- vconf_get_bool
- (VCONFKEY_SETAPPL_STATE_TICKER_NOTI_DISPLAY_CONTENT_BOOL, &boolval);
-
- if (ret == -1 || boolval == 0) {
- if (content != NULL && noti->default_content != NULL) {
- *content = noti->default_content;
- }
-
- if (loc_content != NULL && noti->loc_default_content != NULL) {
- *loc_content = noti->loc_default_content;
- }
- }
-#endif
-}
-
-EXPORT_API int notification_set_args(notification_h noti,
- bundle * args,
- bundle * group_args)
-{
- if (noti == NULL || args == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (noti->args) {
- bundle_free(noti->args);
- }
-
- noti->args = bundle_dup(args);
-
- if (noti->group_args) {
- bundle_free(noti->group_args);
- noti->group_args = NULL;
- }
-
- if (group_args != NULL) {
- noti->group_args = bundle_dup(group_args);
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_get_args(notification_h noti,
- bundle ** args,
- bundle ** group_args)
-{
- if (noti == NULL || args == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (noti->args) {
- *args = noti->args;
- } else {
- *args = NULL;
- }
-
- if (group_args != NULL && noti->group_args) {
- *group_args = noti->group_args;
- }
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_delete_group_by_group_id(const char *pkgname,
- notification_type_e type,
- int group_id)
-{
- int ret = 0;
- char *caller_pkgname = NULL;
-
- if (pkgname == NULL) {
- caller_pkgname = notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(pkgname);
- }
-
- ret = notification_ipc_request_delete_multiple(type, caller_pkgname);
- if (ret != NOTIFICATION_ERROR_NONE) {
- if (caller_pkgname) {
- free(caller_pkgname);
- }
- return ret;
- }
-
- if (caller_pkgname) {
- free(caller_pkgname);
- }
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_delete_group_by_priv_id(const char *pkgname,
- notification_type_e type,
- int priv_id)
-{
- int ret = 0;
- char *caller_pkgname = NULL;
-
- if (pkgname == NULL) {
- caller_pkgname = notification_get_pkgname_by_pid();
- } else {
- caller_pkgname = strdup(pkgname);
- }
-
- ret = notification_ipc_request_delete_single(type, caller_pkgname, priv_id);
- if (ret != NOTIFICATION_ERROR_NONE) {
- if (caller_pkgname) {
- free(caller_pkgname);
- }
- return ret;
- }
-
- if (caller_pkgname) {
- free(caller_pkgname);
- }
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_set_tag(notification_h noti, const char *tag)
-{
- /* Check noti is valid data */
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (tag != NULL) {
- /* save input TAG */
- if (noti->tag != NULL) {
- free(noti->tag);
- }
- noti->tag = strdup(tag);
- }
-
- return NOTIFICATION_ERROR_NONE;
-
-}
-
-EXPORT_API int notification_get_tag(notification_h noti, const char **tag)
-{
- /* Check noti is valid data */
- if (noti == NULL) {
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- /* Set sound type */
- *tag = noti->tag;
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_register_toast_message(void (*posted_toast_cb) (void *data))
-{
- if (notification_ipc_monitor_init() != NOTIFICATION_ERROR_NONE) {
- return NOTIFICATION_ERROR_IO_ERROR;
- }
-
- posted_toast_message_cb = posted_toast_cb;
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-void notification_call_posted_toast_cb(const char *message)
-{
- if (posted_toast_message_cb != NULL) {
- posted_toast_message_cb((void*)message);
- }
-}
-
-EXPORT_API int notification_set_permission(notification_h handle, notification_permission_type_e permission_type, const char *app_id)
-{
- return NOTIFICATION_ERROR_INVALID_OPERATION;
-}
-
-EXPORT_API int notification_get_permission(notification_h handle, notification_permission_type_e *permission_type, const char **app_id)
-{
- return NOTIFICATION_ERROR_INVALID_OPERATION;
-}
-
-EXPORT_API int notification_set_ongoing_flag(notification_h noti, bool ongoing_flag)
-{
- if (noti == NULL)
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
-
- return NOTIFICATION_ERROR_NONE;
-}
-
-EXPORT_API int notification_get_ongoing_flag(notification_h noti, bool *ongoing_flag)
-{
- if (noti == NULL)
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ *auto_remove = noti->auto_remove;
return NOTIFICATION_ERROR_NONE;
}
op_list = (notification_op *)malloc(sizeof(notification_op) * num_op);
if (op_list == NULL) {
+ NOTIFICATION_ERR("malloc failed");
return NULL;
}
ret = strdup(string);
if (!ret)
- NOTIFICATION_ERR("Error: %d\n", errno);
+ NOTIFICATION_ERR("Error: %s\n", strerror(errno));
return ret;
}
char *b_key = NULL;
char *b_format_args = NULL;
struct packet *(*func_to_create_packet)(const char *command, const char *fmt, ...);
- const char *title_key = NULL;
+ char *title_key = NULL;
char buf_key[32] = { 0, };
/* Decode bundle to insert DB */
snprintf(buf_key, sizeof(buf_key), "%d",
NOTIFICATION_TEXT_TYPE_TITLE);
- title_key = bundle_get_val(noti->b_key, buf_key);
+ bundle_get_str(noti->b_key, buf_key, &title_key);
}
if (title_key == NULL && noti->b_text != NULL) {
snprintf(buf_key, sizeof(buf_key), "%d",
NOTIFICATION_TEXT_TYPE_TITLE);
- title_key = bundle_get_val(noti->b_text, buf_key);
+ bundle_get_str(noti->b_text, buf_key, &title_key);
}
if (title_key == NULL) {
char *b_text = NULL;
char *b_key = NULL;
char *b_format_args = NULL;
- const char *title_key = NULL;
+ char *title_key = NULL;
char buf_key[32] = { 0, };
/* Decode bundle to insert DB */
snprintf(buf_key, sizeof(buf_key), "%d",
NOTIFICATION_TEXT_TYPE_TITLE);
- title_key = bundle_get_val(noti->b_key, buf_key);
+ bundle_get_str(noti->b_key, buf_key, &title_key);
}
if (title_key == NULL && noti->b_text != NULL) {
snprintf(buf_key, sizeof(buf_key), "%d",
NOTIFICATION_TEXT_TYPE_TITLE);
- title_key = bundle_get_val(noti->b_text, buf_key);
+ bundle_get_str(noti->b_text, buf_key, &title_key);
}
if (title_key == NULL) {
#include <notification.h>
#include <notification_list.h>
+#include <notification_noti.h>
#include <notification_debug.h>
#include <notification_private.h>
return NULL;
}
+
+EXPORT_API int notification_get_list(notification_type_e type,
+ int count,
+ notification_list_h *list)
+{
+ notification_list_h get_list = NULL;
+ int ret = 0;
+
+ if (list == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ ret = notification_noti_get_grouping_list(type, count, &get_list);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ return ret;
+ }
+
+ *list = get_list;
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API int notification_get_detail_list(const char *pkgname,
+ int group_id,
+ int priv_id,
+ int count,
+ notification_list_h *list)
+{
+ notification_list_h get_list = NULL;
+ int ret = 0;
+
+ if (list == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ ret =
+ notification_noti_get_detail_list(pkgname, group_id, priv_id, count,
+ &get_list);
+ if (ret != NOTIFICATION_ERROR_NONE) {
+ return ret;
+ }
+
+ *list = get_list;
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
+EXPORT_API int notification_free_list(notification_list_h list)
+{
+ notification_list_h cur_list = NULL;
+ notification_h noti = NULL;
+
+ if (list == NULL) {
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ cur_list = notification_list_get_head(list);
+
+ while (cur_list != NULL) {
+ noti = notification_list_get_data(cur_list);
+ cur_list = notification_list_remove(cur_list, noti);
+
+ notification_free(noti);
+ }
+
+ return NOTIFICATION_ERROR_NONE;
+}
#include <Ecore.h>
#include <Elementary.h>
#include <Eina.h>
+#include <package_manager.h>
#include <notification.h>
#include <notification_db.h>
+#include <notification_list.h>
#include <notification_noti.h>
#include <notification_debug.h>
#include <notification_private.h>
+#include <notification_setting.h>
+#include <notification_setting_internal.h>
#define NOTI_BURST_DELETE_UNIT 10
return ret;
}
+static bool _is_allowed_to_notify(const char *caller_package_name)
+{
+ notification_setting_h setting = NULL;
+ int err;
+ char *package_id = NULL;
+ bool ret = true;
+
+ err = notification_setting_get_setting_by_package_name(caller_package_name, &setting);
+ if (err != NOTIFICATION_ERROR_NONE) {
+ /* Retry with package id */
+ err = package_manager_get_package_id_by_app_id (caller_package_name, &package_id);
+
+ if (err != PACKAGE_MANAGER_ERROR_NONE || package_id == NULL) {
+ NOTIFICATION_ERR("package_manager_get_package_id_by_app_id failed [%d]", err);
+ goto out;
+ }
+ else {
+ err = notification_setting_get_setting_by_package_name(package_id, &setting);
+ if (err != NOTIFICATION_ERROR_NONE) {
+ NOTIFICATION_ERR("notification_setting_get_setting_by_package_name failed [%d]", err);
+ goto out;
+ }
+ }
+ }
+
+ err = notification_setting_get_allow_to_notify(setting, &ret);
+ if (err != NOTIFICATION_ERROR_NONE) {
+ NOTIFICATION_ERR("notification_setting_get_allow_to_notify failed [%d]", err);
+ goto out;
+ }
+
+ if (ret != true) {
+ NOTIFICATION_DBG("[%s] is not allowed to notify", caller_package_name);
+ }
+
+out:
+ if (package_id) {
+ free(package_id);
+ }
+
+ if (setting) {
+ notification_setting_free_notification(setting);
+ }
+
+ return ret;
+}
+
EXPORT_API int notification_noti_insert(notification_h noti)
{
int ret = 0;
sqlite3_stmt *stmt = NULL;
char *query = NULL;
char buf_key[32] = { 0, };
- const char *title_key = NULL;
+ char *title_key = NULL;
+
+ if (noti == NULL) {
+ NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ if (_is_allowed_to_notify((const char*)noti->caller_pkgname) == false) {
+ NOTIFICATION_DBG("Not allowed to notify");
+ return NOTIFICATION_ERROR_PERMISSION_DENIED;
+ }
/* Open DB */
db = notification_db_open(DBPATH);
snprintf(buf_key, sizeof(buf_key), "%d",
NOTIFICATION_TEXT_TYPE_TITLE);
- title_key = bundle_get_val(noti->b_key, buf_key);
+ bundle_get_str(noti->b_key, buf_key, &title_key);
}
if (title_key == NULL && noti->b_text != NULL) {
snprintf(buf_key, sizeof(buf_key), "%d",
NOTIFICATION_TEXT_TYPE_TITLE);
- title_key = bundle_get_val(noti->b_text, buf_key);
+ bundle_get_str(noti->b_text, buf_key, &title_key);
}
if (title_key == NULL) {
} else {
ret = NOTIFICATION_ERROR_FROM_DB;
}
+
err:
if (stmt) {
if (tmp) {
*list_deleted_rowid = tmp;
} else {
- NOTIFICATION_ERR("Heap: %d\n", errno);
+ NOTIFICATION_ERR("Heap: %s\n", strerror(errno));
/*!
* \TODO
* How can I handle this?
goto err;
}
-/*
- query = sqlite3_mprintf("select priv_id from noti_list where caller_pkgname = '%s' and tag = '%s'",
- noti->caller_pkgname, noti->tag);
- if (query == NULL) {
- ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
- goto err;
- }
-
- ret = sqlite3_prepare(db, query, strlen(query), &stmt, NULL);
- if (ret != SQLITE_OK) {
- NOTIFICATION_ERR("Get priv id DB err(%d) : %s", ret,
- sqlite3_errmsg(db));
- ret = NOTIFICATION_ERROR_FROM_DB;
- goto err;
- }
-*/
ret = sqlite3_step(stmt);
if (ret == SQLITE_ROW) {
result = sqlite3_column_int(stmt, 0);
#include <stdlib.h>
#include <db-util.h>
#include <package_manager.h>
+#include <pkgmgr-info.h>
#include <tizen_type.h>
#include <notification.h>
#include <notification_db.h>
+#include <notification_list.h>
#include <notification_noti.h>
#include <notification_debug.h>
#include <notification_ipc.h>
#include <notification_setting.h>
#include <notification_setting_internal.h>
+#define NOTIFICATION_PRIVILEGE "http://tizen.org/privilege/notification"
+
static int _get_table_field_data_int(char **table, int *buf, int index)
{
}
if (!row_count) {
- NOTIFICATION_DBG ("No setting found...");
+ NOTIFICATION_DBG ("No setting found for [%s]", package_name);
err= NOTIFICATION_ERROR_NOT_EXIST_ID;
goto out;
}
EXPORT_API int notification_setting_get_setting(notification_setting_h *setting)
{
+ int ret;
char *package_name = NULL;
package_name = notification_get_pkgname_by_pid();
if (package_name == NULL)
return NOTIFICATION_ERROR_NOT_EXIST_ID;
- return notification_setting_get_setting_by_package_name(package_name, setting);
+ ret = notification_setting_get_setting_by_package_name(package_name, setting);
+
+ free(package_name);
+
+ return ret;
}
EXPORT_API int notification_setting_get_package_name(notification_setting_h setting, char **value)
return err;
}
-static int _get_count_of_setting(sqlite3 *db, int *count)
-{
- int sqlite3_ret = SQLITE_OK;
- int err = NOTIFICATION_ERROR_NONE;
- const char *sql_query = "SELECT COUNT(priv_id) FROM notification_setting";
- char **result_table = NULL;
-
- if (count == NULL) {
- NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
- err = NOTIFICATION_ERROR_INVALID_PARAMETER;
- goto out;
- }
-
- sqlite3_ret = sqlite3_get_table(db, sql_query, &result_table, NULL, NULL, NULL);
-
- if (sqlite3_ret != SQLITE_OK || result_table[1] == NULL) {
- NOTIFICATION_ERR("sqlite3_get_table failed [%d][%s]", sqlite3_ret, sqlite3_errmsg(db));
- err = NOTIFICATION_ERROR_FROM_DB;
- goto out;
- }
-
- *count = atoi(result_table[1]);
-
-out:
-
- if (result_table)
- sqlite3_free_table(result_table);
-
- return err;
-}
-
-static int _get_count_of_package(int *count)
-{
- int err = NOTIFICATION_ERROR_NONE;
- int pkgmgr_ret = PACKAGE_MANAGER_ERROR_NONE;
- package_manager_filter_h package_filter = NULL;
- int package_count = 0;
-
- if (count == NULL) {
- NOTIFICATION_ERR("NOTIFICATION_ERROR_INVALID_PARAMETER");
- err = NOTIFICATION_ERROR_INVALID_PARAMETER;
- goto out;
- }
-
- if ((pkgmgr_ret = package_manager_filter_create (&package_filter)) != PACKAGE_MANAGER_ERROR_NONE) {
- NOTIFICATION_ERR("package_manager_filter_create failed [%08X]", pkgmgr_ret);
- err = NOTIFICATION_ERROR_FROM_DB;
- goto out;
- }
-
- if ((pkgmgr_ret = package_manager_filter_add_bool(package_filter, "PMINFO_PKGINFO_PROP_PACKAGE_NODISPLAY_SETTING", false)) != PACKAGE_MANAGER_ERROR_NONE) {
- NOTIFICATION_ERR("package_manager_filter_add_bool failed [%08X]", pkgmgr_ret);
- err = NOTIFICATION_ERROR_FROM_DB;
- goto out;
- }
-
- if ((pkgmgr_ret = package_manager_filter_count(package_filter, &package_count)) != PACKAGE_MANAGER_ERROR_NONE) {
- NOTIFICATION_ERR("package_manager_filter_count failed [%08X]", pkgmgr_ret);
- err = NOTIFICATION_ERROR_FROM_DB;
- goto out;
- }
-
- *count = package_count;
-
-out:
- if (package_filter) {
- if ((pkgmgr_ret = package_manager_filter_destroy(package_filter)) != PACKAGE_MANAGER_ERROR_NONE) {
- NOTIFICATION_WARN("package_manager_filter_destroy failed [%08X]", pkgmgr_ret);
- }
- }
-
- return err;
-}
-
-static bool foreach_package_info_callback(package_info_h package_info, void *user_data)
+static int foreach_package_info_callback(const pkgmgrinfo_pkginfo_h package_info, void *user_data)
{
sqlite3 *db = user_data;
sqlite3_stmt *db_statement = NULL;
int field_index = 1;
int err = true;
- if ((pkgmgr_ret = package_info_get_package(package_info, &package_name)) != PACKAGE_MANAGER_ERROR_NONE) {
+ if ((pkgmgr_ret = pkgmgrinfo_pkginfo_get_pkgname(package_info, &package_name)) != PACKAGE_MANAGER_ERROR_NONE) {
NOTIFICATION_ERR("package_info_get_package failed [%d]", pkgmgr_ret);
err = false;
goto out;
sqlite3_finalize(db_statement);
}
- if(package_name) {
- free(package_name);
- }
-
NOTIFICATION_INFO("foreach_package_info_callback returns[%d]", err);
return err;
}
sqlite3 *db = NULL;
int sqlite3_ret = SQLITE_OK;
int pkgmgr_ret = PACKAGE_MANAGER_ERROR_NONE;
- int setting_count = 0;
- int package_count = 0;
+ pkgmgrinfo_pkginfo_filter_h filter;
+ uid_t current_uid;
sqlite3_ret = db_util_open(DBPATH, &db, 0);
goto out;
}
- if ((err = _get_count_of_setting(db, &setting_count)) != NOTIFICATION_ERROR_NONE) {
- NOTIFICATION_ERR("_get_count_of_setting failed [%08X]", err);
- goto out;
- }
+ sqlite3_exec(db, "BEGIN immediate;", NULL, NULL, NULL);
- if ((err = _get_count_of_package(&package_count)) != NOTIFICATION_ERROR_NONE) {
- NOTIFICATION_ERR("_get_count_of_package failed [%08X]", err);
+ pkgmgr_ret = pkgmgrinfo_pkginfo_filter_create(&filter);
+ if (pkgmgr_ret != PMINFO_R_OK) {
+ NOTIFICATION_ERR("pkgmgrinfo_pkginfo_filter_create failed [%d]", pkgmgr_ret);
+ err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
- NOTIFICATION_INFO("setting_count [%d], package_count [%d]", setting_count, package_count);
-
- if (setting_count == package_count) {
- NOTIFICATION_INFO("No need to refresh");
+ pkgmgr_ret = pkgmgrinfo_pkginfo_filter_add_string(filter, PMINFO_PKGINFO_PROP_PACKAGE_PRIVILEGE, NOTIFICATION_PRIVILEGE);
+ if (pkgmgr_ret != PMINFO_R_OK) {
+ NOTIFICATION_ERR("pkgmgrinfo_pkginfo_filter_add_string failed [%d]", pkgmgr_ret);
+ err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
- sqlite3_exec(db, "BEGIN immediate;", NULL, NULL, NULL);
+ current_uid = getuid();
- pkgmgr_ret = package_manager_foreach_package_info(foreach_package_info_callback, db);
- if (pkgmgr_ret != PACKAGE_MANAGER_ERROR_NONE) {
- NOTIFICATION_ERR("package_manager_filter_foreach_package_info failed [%d]", pkgmgr_ret);
+ pkgmgr_ret = pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo(filter, foreach_package_info_callback, db, current_uid);
+ if (pkgmgr_ret != PMINFO_R_OK) {
+ NOTIFICATION_ERR("pkgmgrinfo_pkginfo_usr_filter_foreach_pkginfo failed [%d]", pkgmgr_ret);
err = NOTIFICATION_ERROR_FROM_DB;
goto out;
}
+ pkgmgrinfo_pkginfo_filter_destroy(filter);
+
+
out:
if (db) {
#include <Ecore.h>
#include <Elementary.h>
#include <Eina.h>
-#include <Evas.h>
#include <notification.h>
#include <notification_db.h>
+#include <notification_list.h>
#include <notification_noti.h>
#include <notification_debug.h>
#include <notification_private.h>
#define INTERFACE_NAME "org.tizen.system.notification.status_message"
#define MEMBER_NAME "status_message"
-static Eina_List *toast_list;
-static Evas_Object *toast_popup;
-
struct _message_cb_data {
notification_status_message_cb callback;
void *data;
static struct _message_cb_data md;
-int _post_toast_message(char *message);
-
-static void popup_timeout_cb(void *data, Evas_Object *obj, void *event_info)
-{
- char *msg = NULL;
- int count = 0;
-
- evas_object_del(toast_popup);
- toast_popup = NULL;
- evas_object_del((Evas_Object *)data);
-
- count = eina_list_count(toast_list);
-
- if (count == 1){
- msg = (char *)eina_list_data_get(toast_list);
- free(msg);
-
- eina_list_free(toast_list);
- toast_list = NULL;
- } else if (count > 1) {
- msg = (char *)eina_list_data_get(toast_list);
- toast_list = eina_list_remove(toast_list, msg);
- free(msg);
- _post_toast_message((char *)eina_list_data_get(toast_list));
- }
-}
-
-int _post_toast_message(char *message)
-{
- Evas_Object *toast_window;
- Evas *e;
- Ecore_Evas *ee;
- double scale = elm_config_scale_get();
-
-
- toast_window = elm_win_add(NULL, "toast", ELM_WIN_BASIC);
-
- elm_win_alpha_set(toast_window, EINA_TRUE);
- elm_win_title_set(toast_window, "toast");
-
- elm_win_indicator_mode_set(toast_window, ELM_WIN_INDICATOR_SHOW);
-/**
- * @note
- * TYPE_1 is deprecated from elementary.
- elm_win_indicator_type_set(toast_window, ELM_WIN_INDICATOR_TYPE_1);
-*/
-
- //elm_win_autodel_set(toast_win, EINA_TRUE);
- if (elm_win_wm_rotation_supported_get(toast_window)) {
- int rots[4] = { 0, 90, 180, 270 };
- elm_win_wm_rotation_available_rotations_set(toast_window, (const int*)(&rots), 4);
- }
-
- e = evas_object_evas_get(toast_window);
- ee = ecore_evas_ecore_evas_get(e);
- ecore_evas_name_class_set(ee, "TOAST_POPUP", "SYSTEM_POPUP");
-
- evas_object_resize(toast_window, (480 * scale), (650 * scale));
-#if defined(HAVE_X11)
- ecore_x_window_shape_input_rectangle_set(elm_win_xwindow_get(toast_window), 0, 0, (480 * scale), (650 * scale));
-#endif
-
- toast_popup = elm_popup_add(toast_window);
-
- elm_object_style_set(toast_popup, "toast");
- evas_object_size_hint_weight_set(toast_popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- elm_object_text_set(toast_popup,message);
-
- if (eina_list_count(toast_list) != 1) {
- elm_popup_timeout_set(toast_popup, 1.0);
- }
- else {
- elm_popup_timeout_set(toast_popup, 3.0);
- }
- evas_object_smart_callback_add(toast_popup, "timeout", popup_timeout_cb, (void *)toast_window);
-
- elm_win_prop_focus_skip_set(toast_window, EINA_TRUE);
-
- evas_object_show(toast_window);
- evas_object_show(toast_popup);
-
- return 0;
-}
-
-int notification_noti_post_toast_message(const char *message)
-{
- char *msg = NULL;
- int count = 0;
-
- msg = (char *)calloc(strlen(message) + 1, sizeof(char));
- strcpy(msg, message);
-
- count = eina_list_count(toast_list);
- if (count == 0) {
- toast_list = eina_list_append(toast_list, msg);
- (void)_post_toast_message(msg);
- }
- else if (count == 1) {
- if (strcmp(msg, (char *)eina_list_nth(toast_list, count - 1)) == 0) {
- elm_popup_timeout_set(toast_popup, 3.0);
- }
- else {
- toast_list = eina_list_append(toast_list, msg);
- elm_popup_timeout_set(toast_popup, 1.0);
- }
- }
- else if (count >= 2) {
- if (strcmp(msg, (char *)eina_list_nth(toast_list, count - 1)) == 0) {
- free(msg);
- return 0;
- }
- else {
- toast_list = eina_list_append(toast_list, msg);
- }
- }
-
- return 0;
-}
-
static void __notification_status_message_dbus_callback(void *data, DBusMessage *msg)
{
int ret = 0;
dbus_error_free(&err);
return;
}
- /*if (!md.callback)
+ if (!md.callback)
return;
if (strlen(message) <= 0){
return;
}
- md.callback(message, md.data);*/
-
- notification_noti_post_toast_message(message);
-}
-
-EXPORT_API
-int notification_status_message_post(const char *message)
-{
- DBusConnection *connection = NULL;
- DBusMessage *signal = NULL;
- DBusError err;
- dbus_bool_t ret;
-
- if (!message) {
- NOTIFICATION_ERR("message is NULL");
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- if (strlen(message) <= 0) {
- NOTIFICATION_ERR("message has only NULL");
- return NOTIFICATION_ERROR_INVALID_PARAMETER;
- }
-
- dbus_error_init(&err);
- connection = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
- if (!connection) {
- NOTIFICATION_ERR("Fail to dbus_bus_get");
- return NOTIFICATION_ERROR_FROM_DBUS;
- }
-
- signal =
- dbus_message_new_signal(PATH_NAME, INTERFACE_NAME,
- MEMBER_NAME);
- if (!signal) {
- NOTIFICATION_ERR("Fail to dbus_message_new_signal");
- return NOTIFICATION_ERROR_FROM_DBUS;
- }
-
- ret = dbus_message_append_args(signal,
- DBUS_TYPE_STRING, &message,
- DBUS_TYPE_INVALID);
- if (ret) {
- ret = dbus_connection_send(connection, signal, NULL);
-
- if (ret) {
- dbus_connection_flush(connection);
- }
- }
-
- dbus_message_unref(signal);
- dbus_connection_unref(connection);
-
- return NOTIFICATION_ERROR_NONE;
+ md.callback(message, md.data);
}
EXPORT_API
return NOTIFICATION_ERROR_NONE;
}
+
+EXPORT_API
+int notification_status_message_post(const char *message)
+{
+ DBusConnection *connection = NULL;
+ DBusMessage *signal = NULL;
+ DBusError err;
+ dbus_bool_t ret;
+
+ if (!message) {
+ NOTIFICATION_ERR("message is NULL");
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ if (strlen(message) <= 0) {
+ NOTIFICATION_ERR("message has only NULL");
+ return NOTIFICATION_ERROR_INVALID_PARAMETER;
+ }
+
+ dbus_error_init(&err);
+ connection = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
+ if (!connection) {
+ NOTIFICATION_ERR("Fail to dbus_bus_get");
+ return NOTIFICATION_ERROR_FROM_DBUS;
+ }
+
+ signal =
+ dbus_message_new_signal(PATH_NAME, INTERFACE_NAME,
+ MEMBER_NAME);
+ if (!signal) {
+ NOTIFICATION_ERR("Fail to dbus_message_new_signal");
+ return NOTIFICATION_ERROR_FROM_DBUS;
+ }
+
+ ret = dbus_message_append_args(signal,
+ DBUS_TYPE_STRING, &message,
+ DBUS_TYPE_INVALID);
+ if (ret) {
+ ret = dbus_connection_send(connection, signal, NULL);
+
+ if (ret) {
+ dbus_connection_flush(connection);
+ }
+ }
+
+ dbus_message_unref(signal);
+ dbus_connection_unref(connection);
+
+ return NOTIFICATION_ERROR_NONE;
+}
+
+
/* notification header */
#include <notification.h>
+#include <notification_internal.h>
#include <notification_status.h>
#include <notification_setting.h>
#include <notification_setting_internal.h>
+#include <notification_text_domain.h>
/*-----------------------------------------------------------------------------------------*/
/* types */
testapp_print (" 5. Delete all notification\n");
testapp_print (" 6. Post a heads notification with a button\n");
testapp_print (" 7. Post a notification with domain text\n");
+ testapp_print (" 8. Load by tag\n");
testapp_print ("------------------------------------------\n");
break;
case TESTAPP_MENU_TYPE_SETTING_TEST_MENU:
testapp_print("Input count : ");
- if (0 >= scanf("%d", &repeat_count))
+ if (0 >= scanf("%d", &repeat_count)) {
testapp_print("Invalid input");
+ goto FINISH_OFF;
+ }
+
+ if (repeat_count > 30) {
+ testapp_print("Too many count");
+ goto FINISH_OFF;
+ }
for (i = 0; i < repeat_count; i++) {
if ((err = testapp_add_a_notification()) != NOTIFICATION_ERROR_NONE) {
}
}
- FINISH_OFF:
+FINISH_OFF:
return err;
}
noti_err = notification_set_text(noti_handle, NOTIFICATION_TEXT_TYPE_TITLE, "I'm Title", "TITLE", NOTIFICATION_VARIABLE_TYPE_NONE);
noti_err = notification_set_text(noti_handle, NOTIFICATION_TEXT_TYPE_CONTENT, "I'm Content", "CONTENT", NOTIFICATION_VARIABLE_TYPE_NONE);
- noti_err = notification_set_display_applist(noti_handle, NOTIFICATION_DISPLAY_APP_HEADS_UP | NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY);
+ noti_err = notification_set_display_applist(noti_handle, NOTIFICATION_DISPLAY_APP_ACTIVE | NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY);
- snprintf(tag, 100, "%d", result);
+ snprintf(tag, 100, "%d", (int)result);
noti_err = notification_set_tag(noti_handle, tag);
{
notification_h noti_handle = NULL;
int noti_err = NOTIFICATION_ERROR_NONE;
- int app_control_err = APP_CONTROL_ERROR_NONE;
- int priv_id = 0;
- int group_id = 0;
- char *app_id = NULL;
time_t result = time(NULL);
char tag[100] = { 0, };
goto FINISH_OFF;
}
- snprintf(tag, 100, "%d", result);
+ snprintf(tag, 100, "%d", (int)result);
noti_err = notification_set_tag(noti_handle, tag);
return noti_err;
}
+static int testapp_test_load_by_tag()
+{
+ notification_h noti_handle = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti_handle = notification_load_by_tag("hfe4fif#$sd$ew");
+
+ if (noti_handle == NULL) {
+ testapp_print("notification_load_by_tag failed");
+ goto FINISH_OFF;
+ }
+
+FINISH_OFF:
+ if (noti_handle)
+ notification_free(noti_handle);
+
+ return noti_err;
+}
+
static gboolean testapp_interpret_command_basic_test (int selected_number)
{
gboolean go_to_loop = TRUE;
testapp_test_post_notification_with_domain_text();
break;
+ case 8:
+ testapp_test_load_by_tag();
+ break;
+
case 0:
go_to_loop = FALSE;
break;
int i = 0;
int count = 0;
char *package_name = NULL;
- bool allow_to_notify = false;
- bool do_not_disturb_except = false;
- bool visibility_class = false;
+ bool allow_to_notify = false;
+ bool do_not_disturb_except = false;
+ int visibility_class = false;
notification_setting_h setting_array = NULL;
notification_setting_get_setting_array(&setting_array, &count);
if ( testapp_initialize_testing() == FALSE ) {
testapp_print ("Initializing failed.\n");
- exit(0);
+ return 1;
}
while (go_to_loop) {
testapp_finalize_testing();
- exit(0);
+ return 0;
}
/* Main } ---------------------------------------------------------------------*/