Remove notification display service 30/51930/1 accepted/tizen/tv/20151119.033239 submit/tizen/20151118.101908
authorjinwoo.shin <jw0227.shin@samsung.com>
Tue, 17 Nov 2015 10:18:27 +0000 (19:18 +0900)
committerjinwoo.shin <jw0227.shin@samsung.com>
Tue, 17 Nov 2015 10:19:34 +0000 (19:19 +0900)
Change-Id: I7cc17e3294543fa6469a017294d4421af6917cb3
Signed-off-by: jinwoo.shin <jw0227.shin@samsung.com>
CMakeLists.txt
daemon/CMakeLists.txt [deleted file]
daemon/notification-display.path [deleted file]
daemon/notification-display.service [deleted file]
daemon/notification_display_service.c [deleted file]
packaging/org.tizen.infosquare.spec

index 399f7f3..ff778cc 100644 (file)
@@ -78,4 +78,3 @@ INSTALL(FILES ${PACKAGE_NAME}.xml DESTINATION ${MANIFESTDIR})
 INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/images DESTINATION ${RESDIR})
 
 ADD_SUBDIRECTORY(data)
-ADD_SUBDIRECTORY(daemon)
diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt
deleted file mode 100644 (file)
index 7d8c765..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (c) 2014 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.
-#
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT("notification-display" C)
-
-MESSAGE(STATUS "PREFIX: " ${CMAKE_INSTALL_PREFIX})
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(SERVICE_PKGS REQUIRED
-               glib-2.0
-               notification
-               app-utils)
-
-SET(SERVICE_SRCS
-               notification_display_service.c)
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include)
-
-FOREACH(flag ${SERVICE_PKGS_CFLAGS})
-       SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
-ENDFOREACH(flag)
-
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-
-ADD_EXECUTABLE(${PROJECT_NAME} ${SERVICE_SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SERVICE_PKGS_LDFLAGS})
-INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${SERVICEDIR})
diff --git a/daemon/notification-display.path b/daemon/notification-display.path
deleted file mode 100644 (file)
index 6adbaaa..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-[Unit]
-Description=This path will tell you that service is ready to launch
-
-[Path]
-PathExists=/run/.wm_ready
diff --git a/daemon/notification-display.service b/daemon/notification-display.service
deleted file mode 100644 (file)
index 07cfdc6..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-[Unit]
-Description=Notifications Display daemon
-
-[Service]
-Type=simple
-EnvironmentFile=/run/tizen-system-env
-ExecStart=/usr/bin/notification-display
-Restart=always
-
-[Install]
-WantedBy=default.target
diff --git a/daemon/notification_display_service.c b/daemon/notification_display_service.c
deleted file mode 100644 (file)
index ebc890b..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-#include <stdio.h>
-#include <unistd.h>
-#include <glib.h>
-#include <Elementary.h>
-#include <app_debug.h>
-#include <notification.h>
-#include <notification_internal.h>
-
-#define SERVICE_NAME "notification-display"
-#define HIDE_TIME 3.0
-
-SET_TAG(SERVICE_NAME)
-
-struct _priv {
-       Evas_Object *win;
-       Evas_Object *popup;
-
-       time_t last_time;
-};
-
-static void _hide(void *data, Evas_Object *obj, void *event_info)
-{
-       evas_object_hide(data);
-}
-
-void _show_notification(struct _priv *priv, notification_h noti)
-{
-       char *title = NULL;
-       char *content = NULL;
-
-       notification_get_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, &title);
-       notification_get_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, &content);
-
-       elm_object_text_set(priv->popup, content);
-       elm_object_part_text_set(priv->popup, "title,text", title);
-       evas_object_show(priv->popup);
-       evas_object_show(priv->win);
-}
-
-void _notification_changed_cb(void *data, notification_type_e notif_type)
-{
-       struct _priv *priv;
-       time_t latest_time;
-       notification_h noti = NULL;
-       notification_list_h noti_list = NULL;
-
-       if (notif_type != NOTIFICATION_TYPE_NOTI)
-               return;
-
-       if (!data) {
-               _ERR("failed to get data");
-               return;
-       }
-       priv = data;
-
-       notification_get_list(NOTIFICATION_TYPE_NOTI, -1, &noti_list);
-       if (noti_list) {
-               noti = notification_list_get_data(noti_list);
-               if (noti) {
-                       notification_get_insert_time(noti, &latest_time);
-
-                       if (latest_time > priv->last_time) {
-                               _show_notification(priv, noti);
-                               priv->last_time = latest_time;
-                       }
-               }
-       }
-
-       notification_free_list(noti_list);
-}
-
-time_t _get_last_time(void)
-{
-       time_t last_time = 0;
-       notification_h noti = NULL;
-       notification_list_h noti_list = NULL;
-
-       notification_get_list(NOTIFICATION_TYPE_NOTI, -1, &noti_list);
-       if (noti_list) {
-               noti = notification_list_get_data(noti_list);
-               if (noti)
-                       notification_get_insert_time(noti, &last_time);
-       }
-
-       notification_free_list(noti_list);
-
-       return last_time;
-}
-
-int _create_popup(struct _priv *priv)
-{
-       Evas_Object *btn;
-
-       priv->win = elm_win_add(NULL, "popup", ELM_WIN_BASIC);
-       if (!priv->win) {
-               _ERR("elm_win_add failed");
-               return -1;
-       }
-       elm_win_autodel_set(priv->win, EINA_TRUE);
-       elm_win_alpha_set(priv->win, EINA_TRUE);
-
-       priv->popup = elm_popup_add(priv->win);
-       if (!priv->popup) {
-               evas_object_del(priv->win);
-               _ERR("elm_win_add failed");
-               return -1;
-       }
-       elm_popup_orient_set(priv->popup, ELM_POPUP_ORIENT_BOTTOM_LEFT);
-
-       btn = elm_button_add(priv->popup);
-       elm_object_text_set(btn, "OK");
-       elm_object_part_content_set(priv->popup, "button1", btn);
-       evas_object_smart_callback_add(btn, "clicked", _hide, priv->win);
-
-       return 0;
-}
-
-void _destroy_popup(struct _priv *priv)
-{
-       evas_object_del(priv->popup);
-       evas_object_del(priv->win);
-}
-
-int main(int argc, char **argv)
-{
-       struct _priv *priv;
-       notification_error_e error_n;
-
-       elm_init(0, NULL);
-
-       priv = calloc(1, sizeof(*priv));
-       if (!priv) {
-               _ERR("failed to allocate priv");
-               return 0;
-       }
-
-       if (_create_popup(priv) < 0) {
-               _ERR("failed to create popup");
-               free(priv);
-               return 0;
-       }
-
-       priv->last_time = _get_last_time();
-
-       error_n = NOTIFICATION_ERROR_SERVICE_NOT_READY;
-       while (error_n != NOTIFICATION_ERROR_NONE) {
-               error_n = notification_resister_changed_cb(
-                               _notification_changed_cb, priv);
-               _DBG("Could not register with notifications server");
-               sleep(5);
-       }
-
-       elm_run();
-
-       _destroy_popup(priv);
-       free(priv);
-
-       elm_shutdown();
-
-       return 0;
-}
index 9ca3548..cb7f9da 100644 (file)
@@ -23,7 +23,6 @@ BuildRequires: edje-bin
 %define _resdir %{_pkgdir}/res
 %define _datadir %{_pkgdir}/data
 %define _edjedir %{_resdir}/edje
-%define _servicedir %{_prefix}/bin
 %define _manifestdir %{_datarootdir}/packages
 
 %description
@@ -40,7 +39,6 @@ cmake \
        -DBINDIR=%{_bindir} \
        -DEDJEDIR=%{_edjedir} \
        -DMANIFESTDIR=%{_manifestdir} \
-       -DSERVICEDIR=%{_servicedir} \
        -DVERSION=%{version}
 
 make %{?jobs:-j%jobs}
@@ -48,10 +46,6 @@ make %{?jobs:-j%jobs}
 %install
 %make_install
 install --directory %{buildroot}/%{_datadir}
-mkdir -p %{buildroot}/%{_unitdir_user}/default.target.wants
-install -m 0644 daemon/notification-display.service %{buildroot}/%{_unitdir_user}/notification-display.service
-install -m 0644 daemon/notification-display.path %{buildroot}/%{_unitdir_user}/notification-display.path
-ln -sf ../notification-display.path %{buildroot}/%{_unitdir_user}/default.target.wants/notification-display.path
 
 %clean
 rm -rf %{buildroot}
@@ -61,9 +55,5 @@ rm -rf %{buildroot}
 %defattr(-,root,root,-)
 %{_bindir}/*
 %{_resdir}/*
-%{_servicedir}/*
 %{_datadir}
 %{_manifestdir}/%{name}.xml
-%{_unitdir_user}/default.target.wants/notification-display.path
-%{_unitdir_user}/notification-display.service
-%{_unitdir_user}/notification-display.path