Replace com.samsung with org.tizen 35/20235/3 submit/tizen/20140513.011028 submit/tizen/20140513.011216
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 30 Apr 2014 02:07:37 +0000 (11:07 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Tue, 13 May 2014 01:05:37 +0000 (10:05 +0900)
Prefix is not valid for the Tizen.
Dynamic Box Database Schema is updated.

From now, each box size is able to define its status for mouse event.

Change-Id: I6b28e630f8ba2d6f5947ee8da91d0763fcfeadd7

18 files changed:
CMakeLists.txt
data/CMakeLists.txt
data/baltic.conf.ini [deleted file]
data/wayland.mobile.conf.ini [moved from data/wayland.conf.ini with 100% similarity]
data/wayland.mobile.resolution.ini [moved from data/resolution.ini with 100% similarity]
data/wayland.wearable.conf.ini [new file with mode: 0644]
data/wayland.wearable.resolution.ini [new file with mode: 0644]
data/x11.mobile.conf.ini [moved from data/private.conf.ini with 100% similarity]
data/x11.mobile.resolution.ini [new file with mode: 0644]
data/x11.wearable.conf.ini [new file with mode: 0644]
data/x11.wearable.resolution.ini [new file with mode: 0644]
packaging/data-provider-master.changes
packaging/data-provider-master.spec
pkgmgr_livebox/src/service_register.c
res/edje/CMakeLists.txt
src/setting.c
src/utility_service.c
util_liveinfo/src/liveinfo.c

index 2f79da4..4e8ef84 100644 (file)
@@ -76,6 +76,12 @@ ADD_DEFINITIONS("-DNDEBUG")
 
 ADD_DEFINITIONS("-D_USE_ECORE_TIME_GET")
 
+IF (MOBILE)
+       ADD_DEFINITIONS("-DMOBILE")
+ELSEIF (WEARABLE)
+       ADD_DEFINITIONS("-DWEARABLE")
+ENDIF (MOBILE)
+
 SET(BUILD_SOURCE
        src/main.c
        src/util.c
@@ -141,7 +147,7 @@ INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/abi.ini DESTINATION /usr/share/data-provi
 
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/${PRODUCT}.conf.ini DESTINATION /usr/share/data-provider-master RENAME "conf.ini" PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
 
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/resolution.ini DESTINATION /usr/share/data-provider-master PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/${PRODUCT}.resolution.ini DESTINATION /usr/share/data-provider-master PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/LICENSE DESTINATION /usr/share/license RENAME "${PROJECT_NAME}")
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 
index 772eac6..215bb58 100644 (file)
@@ -1,2 +1,3 @@
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/data-provider-master DESTINATION /etc/rc.d/init.d/ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+#INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/data-provider-master DESTINATION /etc/rc.d/init.d/ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
 INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/data-provider-master.service DESTINATION /usr/lib/systemd/user/ PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/data/dump_livebox.sh DESTINATION /opt/etc/dump.d/module.d/ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
diff --git a/data/baltic.conf.ini b/data/baltic.conf.ini
deleted file mode 100644 (file)
index 644b940..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-base_width=720
-base_height=1280
-minimum_period=1.0
-script=edje
-default_abi=c
-default_group=disclosure
-default_period=-1.0
-default_packet_time=0.0001
-default_content=default
-minimum_space=104857600
-replace_tag=/APPID/
-slave_ttl=30.0
-slave_activate_time=30.0
-slave_relaunch_time=3.0
-slave_relaunch_count=3
-max_log_line=1000
-max_log_file=3
-sqilte_flush_max=1048576
-db_path=/opt/dbspace/.livebox.db
-share_path=/opt/usr/share/live_magazine/
-log_path=/tmp/.dbox.service
-always_path=/opt/usr/share/live_magazine/always
-reader_path=/opt/usr/share/live_magazine/reader
-script_port_path=/usr/share/data-provider-master/plugin-script/
-ping_interval=240.0
-slave_max_load=30
-use_sw_backend=false
-provider_method=shm
-debug_mode=false
-overwrite_content=false
-com_core_thread=true
-use_xmonitor=false
-input=/dev/input/event1
-pd_request_timeout=5.0
diff --git a/data/wayland.wearable.conf.ini b/data/wayland.wearable.conf.ini
new file mode 100644 (file)
index 0000000..2866b74
--- /dev/null
@@ -0,0 +1,37 @@
+base_width=320
+base_height=320
+minimum_period=1.0
+#script=edje
+#default_abi=c
+#default_group=disclosure
+default_period=-1.0
+default_packet_time=0.0001
+#default_content=default
+minimum_space=104857600
+#replace_tag=/APPID/
+slave_ttl=0.0
+slave_activate_time=30.0
+slave_relaunch_time=3.0
+slave_relaunch_count=3
+max_log_line=1000
+max_log_file=3
+sqilte_flush_max=1048576
+#db_path=/opt/dbspace/.livebox.db
+#share_path=/opt/usr/share/live_magazine/
+log_path=/tmp/.dbox.service
+#always_path=/opt/usr/share/live_magazine/always
+#reader_path=/opt/usr/share/live_magazine/reader
+#script_port_path=/usr/share/data-provider-master/plugin-script/
+ping_interval=240.0
+slave_max_load=30
+use_sw_backend=false
+provider_method=shm
+debug_mode=false
+overwrite_content=false
+com_core_thread=true
+use_xmonitor=false
+#input=/dev/input/event2
+pd_request_timeout=5.0
+premultiplied=0
+#emergency_disk=source=tmpfs;type=tmpfs;option=size=6M
+services=[livebox],[shortcut],[badge]
diff --git a/data/wayland.wearable.resolution.ini b/data/wayland.wearable.resolution.ini
new file mode 100644 (file)
index 0000000..b9e7561
--- /dev/null
@@ -0,0 +1,14 @@
+1x1=320x320
+2x1=0x0
+2x2=320x320
+4x1=0x0
+4x2=0x0
+4x3=0x0
+4x4=0x0
+4x5=0x0
+4x6=0x0
+21x21=0x0
+23x21=0x0
+23x23=0x0
+0x0=320x320
+base=320x320
diff --git a/data/x11.mobile.resolution.ini b/data/x11.mobile.resolution.ini
new file mode 100644 (file)
index 0000000..e2b5a17
--- /dev/null
@@ -0,0 +1,13 @@
+1x1=175x175
+2x1=354x175
+2x2=354x354
+4x1=712x175
+4x2=712x354
+4x3=712x533
+4x4=712x712
+4x5=712x891
+4x6=712x1070
+21x21=224x215
+23x21=680x215
+23x23=680x653
+0x0=720x1280
diff --git a/data/x11.wearable.conf.ini b/data/x11.wearable.conf.ini
new file mode 100644 (file)
index 0000000..260dadb
--- /dev/null
@@ -0,0 +1,37 @@
+base_width=320
+base_height=320
+minimum_period=1.0
+#script=edje
+#default_abi=c
+#default_group=disclosure
+default_period=-1.0
+default_packet_time=0.0001
+#default_content=default
+minimum_space=104857600
+#replace_tag=/APPID/
+slave_ttl=0.0
+slave_activate_time=30.0
+slave_relaunch_time=3.0
+slave_relaunch_count=3
+max_log_line=1000
+max_log_file=3
+sqilte_flush_max=1048576
+#db_path=/opt/dbspace/.livebox.db
+#share_path=/opt/usr/share/live_magazine/
+log_path=/tmp/.dbox.service
+#always_path=/opt/usr/share/live_magazine/always
+#reader_path=/opt/usr/share/live_magazine/reader
+#script_port_path=/usr/share/data-provider-master/plugin-script/
+ping_interval=240.0
+slave_max_load=30
+use_sw_backend=false
+provider_method=pixmap
+debug_mode=false
+overwrite_content=false
+com_core_thread=true
+use_xmonitor=false
+#input=/dev/input/event2
+pd_request_timeout=5.0
+premultiplied=0
+#emergency_disk=source=tmpfs;type=tmpfs;option=size=6M
+services=[livebox],[shortcut],[badge]
diff --git a/data/x11.wearable.resolution.ini b/data/x11.wearable.resolution.ini
new file mode 100644 (file)
index 0000000..b9e7561
--- /dev/null
@@ -0,0 +1,14 @@
+1x1=320x320
+2x1=0x0
+2x2=320x320
+4x1=0x0
+4x2=0x0
+4x3=0x0
+4x4=0x0
+4x5=0x0
+4x6=0x0
+21x21=0x0
+23x21=0x0
+23x23=0x0
+0x0=320x320
+base=320x320
index 5e22b27..77316bb 100644 (file)
@@ -1,3 +1,6 @@
+* Tue May 13 2014 Sung-jae Park <nicesj.park@samsung.com> submit/tizen/20140430.015858@ed99761
+- Replace com.samsung with org.tizen
+
 * Wed Sep 11 2013 Rusty Lynch <rusty.lynch@intel.com> accepted/tizen/20130620.160431@d15ede1
 - Add support for systemd socket activation for notification service
 
index 875684c..6e06371 100644 (file)
@@ -2,9 +2,9 @@
 
 Name: data-provider-master
 Summary: Master service provider for liveboxes
-Version: 0.42.1
+Version: 0.43.1
 Release: 1
-Group: HomeTF/Livebox
+Group: Web Framework/Service
 License: Flora
 Source0: %{name}-%{version}.tar.gz
 Source1001: %{name}.manifest
@@ -74,12 +74,6 @@ export FFLAGS="${FFLAGS} -DTIZEN_ENGINEER_MODE"
 export ENGINEER=true
 %endif
 
-%if 0%{?sec_product_feature_livebox_shm}
-export LIVEBOX_SHM=baltic
-%else
-export LIVEBOX_SHM=private
-%endif
-
 %if %{with wayland}
 export WAYLAND_SUPPORT=On
 export X11_SUPPORT=Off
@@ -87,10 +81,20 @@ export LIVEBOX_SHM=wayland
 %else
 export WAYLAND_SUPPORT=Off
 export X11_SUPPORT=On
+export LIVEBOX_SHM=x11
 %endif
 
-%cmake . -DPRODUCT=${LIVEBOX_SHM} -DENGINEER_BINARY=${ENGINEER} -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT}
+%if "%{_repository}" == "wearable"
+export LIVEBOX_SHM="${LIVEBOX_SHM}.wearable"
+export MOBILE=Off
+export WEARABLE=On
+%else
+export LIVEBOX_SHM="${LIVEBOX_SHM}.mobile"
+export MOBILE=On
+export WEARABLE=Off
+%endif
 
+%cmake . -DPRODUCT=${LIVEBOX_SHM} -DENGINEER_BINARY=${ENGINEER} -DWAYLAND_SUPPORT=${WAYLAND_SUPPORT} -DX11_SUPPORT=${X11_SUPPORT} -DMOBILE=${MOBILE} -DWEARABLE=${WEARABLE}
 CFLAGS="${CFLAGS} -Wall -Winline -Werror" LDFLAGS="${LDFLAGS}" make %{?jobs:-j%jobs}
 
 %install
@@ -105,18 +109,18 @@ mkdir -p %{buildroot}/opt/usr/devel/usr/bin
 mkdir -p %{buildroot}/opt/dbspace
 #mkdir -p %{buildroot}/%{_sysconfdir}/rc.d/rc3.d
 mkdir -p %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants
-mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants
+#mkdir -p %{buildroot}%{_unitdir_user}/sockets.target.wants
 touch %{buildroot}/opt/dbspace/.livebox.db
 touch %{buildroot}/opt/dbspace/.livebox.db-journal
 #ln -sf %{_sysconfdir}/rc.d/init.d/data-provider-master %{buildroot}/%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
 ln -sf %{_unitdir_user}/data-provider-master.service %{buildroot}%{_unitdir_user}/tizen-middleware.target.wants/data-provider-master.service
-ln -sf %{_unitdir_user}/data-provider-master.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/data-provider-master.socket
+#ln -sf %{_unitdir_user}/data-provider-master.socket %{buildroot}%{_unitdir_user}/sockets.target.wants/data-provider-master.socket
 if [ ! -s %{buildroot}/opt/dbspace/.livebox.db ]; then
 echo "LiveBox DB file is not exists, initiate it"
 sqlite3 %{buildroot}/opt/dbspace/.livebox.db <<EOF
 CREATE TABLE version ( version INTEGER );
-CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, touch_effect INTEGER, need_frame INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
-CREATE TABLE client (pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, pd_size TEXT, content TEXT, nodisplay INTEGER, setup TEXT, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, touch_effect INTEGER, need_frame INTEGER, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
+CREATE TABLE client (pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, pd_size TEXT, content TEXT, nodisplay INTEGER, setup TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
 CREATE TABLE groupinfo ( id INTEGER PRIMARY KEY AUTOINCREMENT, cluster TEXT NOT NULL, category TEXT NOT NULL, pkgid TEXT NOT NULL, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
 CREATE TABLE groupmap (option_id INTEGER PRIMARY KEY AUTOINCREMENT, id INTEGER, pkgid TEXT NOT NULL, ctx_item TEXT NOT NULL, FOREIGN KEY(id) REFERENCES groupinfo(id), FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
 CREATE TABLE i18n ( pkgid TEXT NOT NULL, lang TEXT COLLATE NOCASE, name TEXT, icon TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE);
@@ -154,15 +158,15 @@ echo "%{_sysconfdir}/init.d/data-provider-master start"
 %files -n data-provider-master
 %manifest %{name}.manifest
 %defattr(-,root,root,-)
-%{_sysconfdir}/rc.d/init.d/data-provider-master
+#%{_sysconfdir}/rc.d/init.d/data-provider-master
 #%{_sysconfdir}/rc.d/rc3.d/S99data-provider-master
 %{_bindir}/data-provider-master
 %{_prefix}/etc/package-manager/parserlib/*
 %{_datarootdir}/data-provider-master/*
 %{_unitdir_user}/data-provider-master.service
-%{_unitdir_user}/data-provider-master.socket
+#%{_unitdir_user}/data-provider-master.socket
 %{_unitdir_user}/tizen-middleware.target.wants/data-provider-master.service
-%{_unitdir_user}/sockets.target.wants/data-provider-master.socket
+#%{_unitdir_user}/sockets.target.wants/data-provider-master.socket
 
 %{_datarootdir}/license/*
 /opt/usr/share/live_magazine/*
@@ -172,6 +176,6 @@ echo "%{_sysconfdir}/init.d/data-provider-master start"
 %endif
 /opt/dbspace/.livebox.db
 /opt/dbspace/.livebox.db-journal
-/opt/etc/smack/accesses.d/*
+#/opt/etc/smack/accesses.d/*
 
 # End of a file
index b9ed3f9..9f6eb2e 100644 (file)
@@ -50,7 +50,7 @@
 #define ErrPrintWithConsole(format, arg...)    do { fprintf(stderr, "[%s/%s:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); SECURE_LOGE("[\e[32m%s/%s\e[0m:%d] " format, basename(__FILE__), __func__, __LINE__, ##arg); } while (0)
 #endif
 
-#define CUR_VER 2
+#define CUR_VER 3
 #define DEFAULT_CATEGORY       "http://tizen.org/category/default"
 
 /*!
  *
  *
  * client
- * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+
- * | pkgid | Icon |  Name   | auto_launch | pd_size | content | nodisplay | setup | mouse_event |
- * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+
- * |   -   |   -  |    -    |      -      |    -    |    -    |     -     |   -   |      -      }
- * +-------+------+---------+-------------+---------+---------+-----------+-------+-------------+
- * CREATE TABLE client ( pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, pd_size TEXT, content TEXT, nodisplay INTEGER, setup TEXT, mouse_event, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) )
+ * +-------+------+---------+-------------+---------+---------+-----------+-------+
+ * | pkgid | Icon |  Name   | auto_launch | pd_size | content | nodisplay | setup |
+ * +-------+------+---------+-------------+---------+---------+-----------+-------+
+ * |   -   |   -  |    -    |      -      |    -    |    -    |     -     |   -   |
+ * +-------+------+---------+-------------+---------+---------+-----------+-------+
+ * CREATE TABLE client ( pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, auto_launch TEXT, pd_size TEXT, content TEXT, nodisplay INTEGER, setup TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) )
  *
  * = auto_launch = UI-APPID
  * = pd_size = WIDTHxHEIGHT
  *
  *
  * box_size
- * +-------+-----------+---------+--------------+------------+
- * | pkgid | size_type | preview | touch_effect | need_frame |
- * +-------+-----------+---------+--------------+------------+
- * |   -   |     -     |    -    |       -      |     -      |
- * +-------+-----------+---------+--------------+------------+
- * CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, INTEGER, touch_effect INTEGER, need_frame INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) )
+ * +-------+-----------+---------+--------------+------------+-------------------------+
+ * | pkgid | size_type | preview | touch_effect | need_frame | mouse_event(from ver 3) |
+ * +-------+-----------+---------+--------------+------------+-------------------------+
+ * |   -   |     -     |    -    |       -      |     -      |            -            |
+ * +-------+-----------+---------+--------------+------------+-------------------------+
+ * CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, INTEGER, touch_effect INTEGER, need_frame INTEGER, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) )
  *
  * = box_size_list = { WIDTHxHEIGHT; WIDTHxHEIGHT; ... }
  *
@@ -195,8 +195,8 @@ struct livebox {
        int pinup; /* Is this support the pinup feature? */
        int primary; /* Is this primary livebox? */
        int nodisplay;
-       int mouse_event; /* Mouse event processing option for livebox */
 
+       int default_mouse_event; /* Mouse event processing option for livebox */
        int default_touch_effect;
        int default_need_frame;
 
@@ -208,6 +208,7 @@ struct livebox {
        xmlChar *preview[NR_OF_SIZE_LIST];
        int touch_effect[NR_OF_SIZE_LIST]; /* Touch effect of a livebox */
        int need_frame[NR_OF_SIZE_LIST]; /* Box needs frame which should be cared by viewer */
+       int mouse_event[NR_OF_SIZE_LIST];
 
        enum pd_type pd_type;
        xmlChar *pd_src;
@@ -431,6 +432,117 @@ static void upgrade_pkgmap_for_category(void)
        return;
 }
 
+/*!
+ * \note
+ * From version 2 to 3
+ * mouse_event is deleted from client table
+ * mouse_event is added to box_size table
+ *
+ * Every size has their own configuration for mouse_event flag.
+ */
+static void upgrade_to_version_3(void)
+{
+       char *err;
+       static const char *ddl;
+       static const char *dml;
+       sqlite3_stmt *select_stmt;
+       int ret;
+
+       /*
+        * Step 1
+        * Create a new column for mouse_event to box_size table.
+        */
+       ddl = "ALTER TABLE box_size ADD COLUMN mouse_event INTEGER DEFAULT 0";
+       if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+               ErrPrint("Failed to execute the DDL (%s)\n", err);
+               return;
+       }
+
+       if (sqlite3_changes(s_info.handle) == 0) {
+               ErrPrint("No changes to DB\n");
+       }
+
+       /*
+        * Step 2
+        * Copy mouse_event values from the client to the box_size table.
+        */
+       dml = "SELECT pkgid, mouse_event FROM client";
+       ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &select_stmt, NULL);
+       if (ret == SQLITE_OK) {
+               sqlite3_stmt *update_stmt;
+
+               dml = "UPDATE box_size SET mouse_event = ? WHERE pkgid = ?";
+               ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &update_stmt, NULL);
+               if (ret == SQLITE_OK) {
+                       int mouse_event;
+                       const char *pkgid;
+
+                       while (sqlite3_step(select_stmt) == SQLITE_ROW) {
+                               pkgid = (const char *)sqlite3_column_text(select_stmt, 0);
+                               if (!pkgid) {
+                                       ErrPrint("Package Id is not valid\n");
+                                       continue;
+                               }
+
+                               mouse_event = sqlite3_column_int(select_stmt, 1);
+
+                               ret = sqlite3_bind_int(update_stmt, 1, mouse_event);
+                               if (ret != SQLITE_OK) {
+                                       ErrPrint("Failed to bind mouse_event [%s], [%d]\n", pkgid, mouse_event);
+                                       sqlite3_reset(update_stmt);
+                                       sqlite3_clear_bindings(update_stmt);
+                                       continue;
+                               }
+
+                               ret = sqlite3_bind_text(update_stmt, 2, pkgid, -1, SQLITE_TRANSIENT);
+                               if (ret != SQLITE_OK) {
+                                       ErrPrint("Failed to bind pkgid [%s], [%d]\n", pkgid, mouse_event);
+                                       sqlite3_reset(update_stmt);
+                                       sqlite3_clear_bindings(update_stmt);
+                                       continue;
+                               }
+
+                               ret = sqlite3_step(update_stmt);
+                               if (ret != SQLITE_DONE) {
+                                       ErrPrint("Failed to execute DML: %d\n", ret);
+                                       sqlite3_reset(update_stmt);
+                                       sqlite3_clear_bindings(update_stmt);
+                                       continue;
+                               }
+
+                               sqlite3_reset(update_stmt);
+                               sqlite3_clear_bindings(update_stmt);
+                       }
+
+                       sqlite3_finalize(update_stmt);
+               } else {
+                       ErrPrint("Failed to execute DML\n");
+               }
+
+               sqlite3_reset(select_stmt);
+               sqlite3_clear_bindings(select_stmt);
+               sqlite3_finalize(select_stmt);
+       } else {
+               ErrPrint("Failed to prepare the initial DML(%s)\n", sqlite3_errmsg(s_info.handle));
+       }
+
+       /*
+        * Step 3
+        * Drop a column from the client table
+        */
+       ddl = "ALTER TABLE client DROP COLUMN mouse_event";
+       if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
+               ErrPrint("Failed to execute the DDL (%s)\n", err);
+               return;
+       }
+
+       if (sqlite3_changes(s_info.handle) == 0) {
+               ErrPrint("No changes to DB\n");
+       }
+
+       return;
+}
+
 static void do_upgrade_db_schema(void)
 {
        int version;
@@ -446,16 +558,17 @@ static void do_upgrade_db_schema(void)
                        ErrPrint("Failed to set version\n");
                }
                /* Need to set version */
-       case CUR_VER:
-               break;
        case 1:
                upgrade_pkgmap_for_category();
+       case 2:
+               upgrade_to_version_3();
        default:
                /* Need to update version */
                DbgPrint("Old version: %d\n", version);
                if (update_version(CUR_VER) < 0) {
                        ErrPrint("Failed to update version\n");
                }
+       case CUR_VER:
                break;
        }
 }
@@ -790,7 +903,7 @@ static inline int db_create_client(void)
 
        ddl = "CREATE TABLE client (" \
                "pkgid TEXT PRIMARY KEY NOT NULL, icon TEXT, name TEXT, " \
-               "auto_launch TEXT, pd_size TEXT, content TEXT, nodisplay INTEGER, setup TEXT, mouse_event INTEGER, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE)";
+               "auto_launch TEXT, pd_size TEXT, content TEXT, nodisplay INTEGER, setup TEXT, FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE)";
        if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
                ErrPrint("Failed to execute the DDL (%s)\n", err);
                return -EIO;
@@ -809,7 +922,7 @@ static inline int db_insert_client(struct livebox *livebox)
        int ret;
        sqlite3_stmt *stmt;
 
-       dml = "INSERT INTO client ( pkgid, icon, name, auto_launch, pd_size, content, nodisplay, setup, mouse_event ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)";
+       dml = "INSERT INTO client ( pkgid, icon, name, auto_launch, pd_size, content, nodisplay, setup ) VALUES (?, ?, ?, ?, ?, ?, ?, ?)";
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
@@ -872,13 +985,6 @@ static inline int db_insert_client(struct livebox *livebox)
                goto out;
        }
 
-       ret = sqlite3_bind_int(stmt, 9, livebox->mouse_event);
-       if (ret != SQLITE_OK) {
-               ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
-               ret = -EIO;
-               goto out;
-       }
-
        ret = 0;
        if (sqlite3_step(stmt) != SQLITE_DONE) {
                ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
@@ -1449,7 +1555,7 @@ static inline int db_create_box_size(void)
        char *err;
        static const char *ddl;
 
-       ddl = "CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, touch_effect INTEGER, need_frame INTEGER, " \
+       ddl = "CREATE TABLE box_size ( pkgid TEXT NOT NULL, size_type INTEGER, preview TEXT, touch_effect INTEGER, need_frame INTEGER, mouse_event INTEGER " \
                "FOREIGN KEY(pkgid) REFERENCES pkgmap(pkgid) ON DELETE CASCADE)";
        if (sqlite3_exec(s_info.handle, ddl, NULL, NULL, &err) != SQLITE_OK) {
                ErrPrint("Failed to execute the DDL (%s)\n", err);
@@ -1463,14 +1569,14 @@ static inline int db_create_box_size(void)
        return 0;
 }
 
-static int db_insert_box_size(const char *pkgid, int size_type, const char *preview, int touch_effect, int need_frame)
+static int db_insert_box_size(const char *pkgid, int size_type, const char *preview, int touch_effect, int need_frame, int mouse_event)
 {
        static const char *dml;
        int ret;
        sqlite3_stmt *stmt;
 
        DbgPrint("box size: %s - %d (%s) is added\n", pkgid, size_type, preview);
-       dml = "INSERT INTO box_size ( pkgid, size_type, preview, touch_effect, need_frame ) VALUES (?, ?, ?, ?, ?)";
+       dml = "INSERT INTO box_size ( pkgid, size_type, preview, touch_effect, need_frame, mouse_event ) VALUES (?, ?, ?, ?, ?, ?)";
        ret = sqlite3_prepare_v2(s_info.handle, dml, -1, &stmt, NULL);
        if (ret != SQLITE_OK) {
                ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
@@ -1505,7 +1611,14 @@ static int db_insert_box_size(const char *pkgid, int size_type, const char *prev
                goto out;
        }
 
-       ret =  sqlite3_bind_int(stmt, 5, need_frame);
+       ret = sqlite3_bind_int(stmt, 5, need_frame);
+       if (ret != SQLITE_OK) {
+               ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
+               ret = -EIO;
+               goto out;
+       }
+
+       ret = sqlite3_bind_int(stmt, 6, mouse_event);
        if (ret != SQLITE_OK) {
                ErrPrintWithConsole("Error: %s\n", sqlite3_errmsg(s_info.handle));
                ret = -EIO;
@@ -1974,6 +2087,20 @@ static void update_size_info(struct livebox *livebox, int idx, xmlNodePtr node)
        } else {
                livebox->touch_effect[idx] = livebox->default_touch_effect;
        }
+
+       if (xmlHasProp(node, (const xmlChar *)"mouse_event")) {
+               xmlChar *mouse_event;
+
+               mouse_event = xmlGetProp(node, (const xmlChar *)"mouse_event");
+               if (mouse_event) {
+                       livebox->mouse_event[idx] = !xmlStrcasecmp(mouse_event, (const xmlChar *)"true");
+                       xmlFree(mouse_event);
+               } else {
+                       livebox->mouse_event[idx] = livebox->default_mouse_event;
+               }
+       } else {
+               livebox->mouse_event[idx] = livebox->default_mouse_event;
+       }
 }
 
 static inline void update_box(struct livebox *livebox, xmlNodePtr node)
@@ -2003,16 +2130,16 @@ static inline void update_box(struct livebox *livebox, xmlNodePtr node)
        }
 
        if (!xmlHasProp(node, (const xmlChar *)"mouse_event")) {
-               livebox->mouse_event = 0;
+               livebox->default_mouse_event = 0;
        } else {
                xmlChar *mouse_event;
 
                mouse_event = xmlGetProp(node, (const xmlChar *)"mouse_event");
                if (!mouse_event) {
                        ErrPrint("mouse_event is NIL\n");
-                       livebox->mouse_event = 0;
+                       livebox->default_mouse_event = 0;
                } else {
-                       livebox->mouse_event = !xmlStrcasecmp(mouse_event, (const xmlChar *)"true");
+                       livebox->default_mouse_event = !xmlStrcasecmp(mouse_event, (const xmlChar *)"true");
                        xmlFree(mouse_event);
                }
        }
@@ -2412,91 +2539,91 @@ static int db_insert_livebox(struct livebox *livebox, const char *appid)
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_1x1) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_1x1, (char *)livebox->preview[0], livebox->touch_effect[0], livebox->need_frame[0]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_1x1, (char *)livebox->preview[0], livebox->touch_effect[0], livebox->need_frame[0], livebox->mouse_event[0]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_2x1) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_2x1, (char *)livebox->preview[1], livebox->touch_effect[1], livebox->need_frame[1]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_2x1, (char *)livebox->preview[1], livebox->touch_effect[1], livebox->need_frame[1], livebox->mouse_event[1]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_2x2) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_2x2, (char *)livebox->preview[2], livebox->touch_effect[2], livebox->need_frame[2]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_2x2, (char *)livebox->preview[2], livebox->touch_effect[2], livebox->need_frame[2], livebox->mouse_event[2]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_4x1) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x1, (char *)livebox->preview[3], livebox->touch_effect[3], livebox->need_frame[3]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x1, (char *)livebox->preview[3], livebox->touch_effect[3], livebox->need_frame[3], livebox->mouse_event[3]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_4x2) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x2, (char *)livebox->preview[4], livebox->touch_effect[4], livebox->need_frame[4]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x2, (char *)livebox->preview[4], livebox->touch_effect[4], livebox->need_frame[4], livebox->mouse_event[4]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_4x3) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x3, (char *)livebox->preview[5], livebox->touch_effect[5], livebox->need_frame[5]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x3, (char *)livebox->preview[5], livebox->touch_effect[5], livebox->need_frame[5], livebox->mouse_event[5]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_4x4) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x4, (char *)livebox->preview[6], livebox->touch_effect[6], livebox->need_frame[6]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x4, (char *)livebox->preview[6], livebox->touch_effect[6], livebox->need_frame[6], livebox->mouse_event[6]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_4x5) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x5, (char *)livebox->preview[7], livebox->touch_effect[7], livebox->need_frame[7]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x5, (char *)livebox->preview[7], livebox->touch_effect[7], livebox->need_frame[7], livebox->mouse_event[7]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_4x6) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x6, (char *)livebox->preview[8], livebox->touch_effect[8], livebox->need_frame[8]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_4x6, (char *)livebox->preview[8], livebox->touch_effect[8], livebox->need_frame[8], livebox->mouse_event[8]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_EASY_1x1) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_1x1, (char *)livebox->preview[9], livebox->touch_effect[9], livebox->need_frame[9]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_1x1, (char *)livebox->preview[9], livebox->touch_effect[9], livebox->need_frame[9], livebox->mouse_event[9]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_EASY_3x1) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_3x1, (char *)livebox->preview[10], livebox->touch_effect[10], livebox->need_frame[10]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_3x1, (char *)livebox->preview[10], livebox->touch_effect[10], livebox->need_frame[10], livebox->mouse_event[10]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_EASY_3x3) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_3x3, (char *)livebox->preview[11], livebox->touch_effect[11], livebox->need_frame[11]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_EASY_3x3, (char *)livebox->preview[11], livebox->touch_effect[11], livebox->need_frame[11], livebox->mouse_event[11]);
                if (ret < 0) {
                        goto errout;
                }
        }
 
        if (livebox->size_list & LB_SIZE_TYPE_0x0) {
-               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_0x0, (char *)livebox->preview[12], livebox->touch_effect[12], livebox->need_frame[12]);
+               ret = db_insert_box_size((char *)livebox->pkgid, LB_SIZE_TYPE_0x0, (char *)livebox->preview[12], livebox->touch_effect[12], livebox->need_frame[12], livebox->mouse_event[12]);
                if (ret < 0) {
                        goto errout;
                }
index 9eda604..ec7f868 100644 (file)
@@ -4,6 +4,6 @@
 #      DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/master.edc
 #)
 #ADD_DEPENDENCIES(${PROJECT_NAME} master.edj)
-#INSTALL(FILES master.edj DESTINATION "/opt/apps/com.samsung.${PROJECT_NAME}/res/edje")
+#INSTALL(FILES master.edj DESTINATION "/opt/apps/org.tizen.${PROJECT_NAME}/res/edje")
 
 # End of a file
index 4e75ab4..a21e549 100644 (file)
@@ -143,80 +143,6 @@ static void lang_changed_cb(keynode_t *node, void *user_data)
        DbgFree(lang);
 }
 
-static void ail_info_cb(keynode_t *node, void *user_data)
-{
-       Eina_List *inst_list;
-       Eina_List *pkg_list;
-       struct inst_info *inst;
-       Eina_List *l;
-       Eina_List *n;
-       Eina_List *j;
-       struct pkg_info *info;
-       char *event;
-       char *appid;
-       char *pkgname;
-       int len;
-       int enabled;
-
-       event = vconf_get_str(VCONFKEY_AIL_INFO_STATE);
-       if (!event) {
-               return;
-       }
-
-       len = strlen("update:");
-       if (!strncasecmp(event, "update:", len)) {
-               goto out;
-       }
-
-       appid = event + len;
-       DbgPrint("AppId: [%s]\n", appid);
-
-       enabled = package_is_enabled(appid);
-
-       DbgPrint("AppId: %s, %d\n", appid, enabled);
-       if (enabled != 0) {
-               /*
-                * \note
-                * reload?
-                */
-               goto out;
-       }
-
-       len = strlen(appid);
-
-       pkg_list = (Eina_List *)package_list();
-       EINA_LIST_FOREACH(pkg_list, l, info) {
-               inst_list = NULL;
-               pkgname = livebox_service_mainappid(package_name(info));
-               if (!pkgname) {
-                       /*!
-                        * Even if we failed to get package name,
-                        * Try to use the ordinal package name first.
-                        */
-                       pkgname = strdup(package_name(info));
-                       DbgPrint("Try to use the pkgname: %s\n", pkgname);
-                       if (!pkgname) {
-                               continue;
-                       }
-               }
-
-               if (strcmp(appid, pkgname)) {
-                       DbgFree(pkgname);
-                       continue;
-               }
-               DbgPrint("Package disabled: %s (%s)\n", pkgname, appid);
-               DbgFree(pkgname);
-
-               inst_list = package_instance_list(info);
-               EINA_LIST_FOREACH_SAFE(inst_list, j, n, inst) {
-                       instance_destroy(inst, INSTANCE_DESTROY_DEFAULT);
-               }
-       }
-
-out:
-       DbgFree(event);
-}
-
 static void low_mem_cb(keynode_t *node, void *user_data)
 {
        int val;
@@ -265,11 +191,6 @@ HAPI int setting_init(void)
                ErrPrint("Failed to add vconf for region change: %d\n", ret);
        }
 
-       ret = vconf_notify_key_changed(VCONFKEY_AIL_INFO_STATE, ail_info_cb, NULL);
-       if (ret < 0) {
-               ErrPrint("Failed to add vconf for ail info state: %d\n", ret);
-       }
-
        ret = vconf_notify_key_changed(VCONFKEY_SYSMAN_LOW_MEMORY, low_mem_cb, NULL);
        if (ret < 0) {
                ErrPrint("Failed to add vconf for low mem monitor: %d\n", ret);
@@ -309,11 +230,6 @@ HAPI int setting_fini(void)
                ErrPrint("Failed to ignore vconf key (%d)\n", ret);
        }
 
-       ret = vconf_ignore_key_changed(VCONFKEY_AIL_INFO_STATE, ail_info_cb);
-       if (ret < 0) {
-               ErrPrint("Failed to ignore vconf key (%d)\n", ret);
-       }
-
        return ret;
 }
 
index f19aaf0..31eb577 100644 (file)
@@ -33,7 +33,7 @@
 #include "conf.h"
 
 #ifndef SVC_PKG
-#define SVC_PKG                "com.samsung.data-provider-slave.icon"
+#define SVC_PKG                "org.tizen.data-provider-slave.icon"
 #endif
 
 #ifndef LAUNCH_TIMEOUT
index 5102738..86d109c 100644 (file)
@@ -734,9 +734,6 @@ static inline int do_stat(const char *cmd)
                printf("%s)\n", tmp);
                free(tmp);
 
-               i = livebox_service_mouse_event(node_name(node));
-               printf("Mouse event: %s\n", i ? "enabled" : "disabled");
-
                break;
        case PROVIDER:
                printf("Not supported yet\n");