From 436bd0887235a9153d6c56e91964b9c25bb867ae Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Wed, 30 Dec 2015 09:07:01 +0900 Subject: [PATCH 01/16] license: add license BSD 2-clause and BSD-1.0 to spec file - newfs-msdos and fsck-msdos use BSD 2-clause and BSD-1.0. Thus the license should be noticed on the spec file Change-Id: I7d4cddee00ab4c3d482ce90b1be4c0f3cddee2dc Signed-off-by: Taeyoung Kim --- packaging/deviced.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/deviced.spec b/packaging/deviced.spec index c5d94ea..fc97e28 100644 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -50,7 +50,7 @@ Summary: Deviced Version: 1.0.0 Release: 1 Group: System/Management -License: Apache-2.0 +License: Apache-2.0 and BSD 2-clause and BSD-1.0 Source0: %{name}-%{version}.tar.gz Source1: deviced.manifest Source2: libdeviced.manifest -- 2.7.4 From 65cdfeff20dfd30993e9b0a213af0bb09b688892 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Tue, 29 Dec 2015 17:46:48 +0900 Subject: [PATCH 02/16] license: update license files for fsck-msdos and newfs-msdos Change-Id: Ie77ca3b9c4b4599733f0ad56ad1ea233a2e79503 Signed-off-by: Taeyoung Kim --- src/fsck-msdos/LICENSE.BSD-1.0 | 29 +++++++++++++++++++++++++++++ src/newfs-msdos/LICENSE.BSD-2-Clause | 24 ++++++++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/src/fsck-msdos/LICENSE.BSD-1.0 b/src/fsck-msdos/LICENSE.BSD-1.0 index e69de29..e3c375e 100644 --- a/src/fsck-msdos/LICENSE.BSD-1.0 +++ b/src/fsck-msdos/LICENSE.BSD-1.0 @@ -0,0 +1,29 @@ +Copyright (C) 1995, 1996, 1997 Wolfgang Solfrank +Copyright (c) 1995 Martin Husemann + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + This product includes software developed by Martin Husemann + and Wolfgang Solfrank. +4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/newfs-msdos/LICENSE.BSD-2-Clause b/src/newfs-msdos/LICENSE.BSD-2-Clause index e69de29..d7c4c36 100644 --- a/src/newfs-msdos/LICENSE.BSD-2-Clause +++ b/src/newfs-msdos/LICENSE.BSD-2-Clause @@ -0,0 +1,24 @@ +Copyright (c) 1998 Robert Nordier +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -- 2.7.4 From 7bfa16950e0c8a6d1dc1388cc874974d7f5a6c37 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Wed, 30 Dec 2015 20:53:37 +0900 Subject: [PATCH 03/16] license: change license name - BSD-1.0 -> BSD-4-Clause - BSD 2-clause -> BSD-2-Clause Change-Id: Iea4c9b33a1c0d35c01fa37b17e8750837d8c1aa8 Signed-off-by: Taeyoung Kim --- packaging/deviced.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/deviced.spec b/packaging/deviced.spec index fc97e28..01099ff 100644 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -50,7 +50,7 @@ Summary: Deviced Version: 1.0.0 Release: 1 Group: System/Management -License: Apache-2.0 and BSD 2-clause and BSD-1.0 +License: Apache-2.0 and BSD-2-Clause and BSD-4-Clause Source0: %{name}-%{version}.tar.gz Source1: deviced.manifest Source2: libdeviced.manifest -- 2.7.4 From e844055f0b56894eba51d230585dfecf0739fc92 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Thu, 31 Dec 2015 08:41:42 +0900 Subject: [PATCH 04/16] sysman: fix _E macro to ERR macro _E is used in the deviced, not int the sysman. Thus the macro is fixed to ERR which is defined in sysman Change-Id: I34dc363fc6f6ef203cb506dab957bd835a64dca6 Signed-off-by: Taeyoung Kim --- src/libsysman/sysman-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsysman/sysman-util.c b/src/libsysman/sysman-util.c index 69ebf1b..91f52cd 100644 --- a/src/libsysman/sysman-util.c +++ b/src/libsysman/sysman-util.c @@ -94,7 +94,7 @@ API int sysman_get_cmdline_name(pid_t pid, char *cmdline, size_t cmdline_size) close(fd); if (ret < 0) { ret = -errno; - _E("read() failed (%d)", ret); + ERR("read() failed (%d)", ret); return ret; } buf[PATH_MAX] = '\0'; -- 2.7.4 From 4965ae92bbec26f473b88709d588cd10cf2dba45 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Thu, 31 Dec 2015 08:41:42 +0900 Subject: [PATCH 05/16] sysman: fix _E macro to ERR macro _E is used in the deviced, not int the sysman. Thus the macro is fixed to ERR which is defined in sysman Change-Id: I34dc363fc6f6ef203cb506dab957bd835a64dca6 Signed-off-by: Taeyoung Kim --- src/libsysman/sysman-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsysman/sysman-util.c b/src/libsysman/sysman-util.c index 69ebf1b..91f52cd 100644 --- a/src/libsysman/sysman-util.c +++ b/src/libsysman/sysman-util.c @@ -94,7 +94,7 @@ API int sysman_get_cmdline_name(pid_t pid, char *cmdline, size_t cmdline_size) close(fd); if (ret < 0) { ret = -errno; - _E("read() failed (%d)", ret); + ERR("read() failed (%d)", ret); return ret; } buf[PATH_MAX] = '\0'; -- 2.7.4 From c8855c9f8a5203bc3cc4e8ddba563d796ecdc06e Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Tue, 29 Dec 2015 14:02:45 +0900 Subject: [PATCH 06/16] sysman: fix warnings which are occurred during compiling - Log macros are changed to its own macro - Return values are checked for write() operaiton Change-Id: If5eab574172757ccd69b8ff8afa12e58a100c85f Signed-off-by: Taeyoung Kim --- src/libsysman/sysconf.c | 1 + src/libsysman/sysnoti.c | 33 +++++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/libsysman/sysconf.c b/src/libsysman/sysconf.c index 856faa7..726097e 100644 --- a/src/libsysman/sysconf.c +++ b/src/libsysman/sysconf.c @@ -18,6 +18,7 @@ #include +#include #include #include "sysman-priv.h" diff --git a/src/libsysman/sysnoti.c b/src/libsysman/sysnoti.c index d272461..b2faead 100644 --- a/src/libsysman/sysnoti.c +++ b/src/libsysman/sysnoti.c @@ -44,18 +44,35 @@ static inline int send_int(int fd, int val) static inline int send_str(int fd, char *str) { - int len; + int len = 0; int ret; + if (str == NULL) { - len = 0; ret = write(fd, &len, sizeof(int)); - } else { - len = strlen(str); - if (len > SYSMAN_MAXSTR) - len = SYSMAN_MAXSTR; - write(fd, &len, sizeof(int)); - ret = write(fd, str, len); + if (ret < 0) { + ret = -errno; + ERR("write() failed (%d)", ret); + } + return ret; + } + + len = strlen(str); + if (len > SYSMAN_MAXSTR) + len = SYSMAN_MAXSTR; + + ret = write(fd, &len, sizeof(int)); + if (ret < 0) { + ret = -errno; + ERR("write() failed (%d)", ret); + return ret; + } + + ret = write(fd, str, len); + if (ret < 0) { + ret = -errno; + ERR("write() failed (%d)", ret); } + return ret; } -- 2.7.4 From 4efcb5808abe096bf3c891455f455aba4bc8fe70 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Tue, 29 Dec 2015 14:14:07 +0900 Subject: [PATCH 07/16] power: add header file to use launch_app function Change-Id: Id0a078c4e4a558bd4a0f133902a8c2626288e416 Signed-off-by: Taeyoung Kim --- src/core/launch.h | 1 + src/power/power-handler.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/core/launch.h b/src/core/launch.h index bdd2304..7c6d0dd 100644 --- a/src/core/launch.h +++ b/src/core/launch.h @@ -27,5 +27,6 @@ int launch_evenif_exist(const char *execpath, const char *arg, ...); int launch_after_kill_if_exist(const char *execpath, const char *arg, ...); int launch_app_cmd(const char *cmdline); +int launch_app_cmd_with_nice(const char *cmdline, int _nice); #endif /* __LAUNCH_H__ */ diff --git a/src/power/power-handler.c b/src/power/power-handler.c index ec32192..d2956d9 100644 --- a/src/power/power-handler.c +++ b/src/power/power-handler.c @@ -43,6 +43,7 @@ #include "core/device-idler.h" #include "core/common.h" #include "core/devices.h" +#include "core/launch.h" #include "display/poll.h" #include "display/setting.h" #include "core/edbus-handler.h" -- 2.7.4 From 24a4906995c1d60a40ed66ed1220835aa6529ffe Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Tue, 29 Dec 2015 14:56:36 +0900 Subject: [PATCH 08/16] libdevman: check return values for IO apis Change-Id: I2e54606ad44b75d0b6cd40666009d98b786dfda0 Signed-off-by: Taeyoung Kim --- src/libdevman/src/devman_internal.c | 12 ++++++++---- src/libdevman/src/display_wd.c | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/libdevman/src/devman_internal.c b/src/libdevman/src/devman_internal.c index 64bb629..b2a53dc 100644 --- a/src/libdevman/src/devman_internal.c +++ b/src/libdevman/src/devman_internal.c @@ -90,7 +90,9 @@ API int display_register_postjob(void) unlink(fifo_path); return -1; } - read(fifo_pollfd.fd, buf, sizeof(buf)); + ret = read(fifo_pollfd.fd, buf, sizeof(buf)); + if (ret < 0) + DEVERR("read() failed (%d)", ret); fifo_fd = fifo_pollfd.fd; @@ -100,7 +102,7 @@ API int display_register_postjob(void) API int display_cancel_postjob(void) { char buf[PATH_MAX]; - int ret; + int ret, disp; snprintf(buf, PATH_MAX, "%s.%d", DISPLAY_WD_FIFO, getpid()); if (access(buf, F_OK) != 0) { @@ -115,8 +117,10 @@ API int display_cancel_postjob(void) DEVLOG("fifo file path is %s", buf); return -1; } - ret = DISPLAY_WD_CANCEL; - write(fifo_fd, &ret, sizeof(int)); + disp = DISPLAY_WD_CANCEL; + ret = write(fifo_fd, &disp, sizeof(int)); + if (ret <= 0) + DEVERR("write() failed (%d)", ret); close(fifo_fd); unlink(buf); fifo_fd = -1; diff --git a/src/libdevman/src/display_wd.c b/src/libdevman/src/display_wd.c index 52b5f6d..e1e10e8 100644 --- a/src/libdevman/src/display_wd.c +++ b/src/libdevman/src/display_wd.c @@ -47,7 +47,7 @@ static void sig_quit(int signo) int main(void) { - int fd = -1; + int r = -1; int ret = -1; int val = -1; int auto_brightness_state = -1; @@ -87,7 +87,9 @@ int main(void) return -1; } if (fifo_pollfd.revents & POLLIN) { - read(fifo_pollfd.fd, &ret, sizeof(int)); + r = read(fifo_pollfd.fd, &ret, sizeof(int)); + if (r < 0) + DEVERR("read() failed(%d)", r); if (ret == DISPLAY_WD_CANCEL) { DEVERR("[DISPLAY_WD] Canceled. - %s, %d", fifo_path, ret); close(fifo_pollfd.fd); -- 2.7.4 From d7a8c9b7199d2e50046160aec49d5c65456ba2f6 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Tue, 29 Dec 2015 17:01:03 +0900 Subject: [PATCH 09/16] block: remove notification library - notification library is upper level apis and deviced cannot use it. It can be changed to other manner to show notices Change-Id: I7e19684417c7471be3c3bfa3252cb71fe58e9576 Signed-off-by: Taeyoung Kim --- CMakeLists.txt | 1 - packaging/deviced.spec | 1 - src/block/ext4.c | 7 +------ src/core/common.c | 18 ------------------ src/core/common.h | 1 - 5 files changed, 1 insertion(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57216be..66ad29c 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,7 +163,6 @@ SET(PKG_MODULES gio-2.0 eventsystem libtzplatform-config - notification hwcommon ) diff --git a/packaging/deviced.spec b/packaging/deviced.spec index 01099ff..f990b8e 100644 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -74,7 +74,6 @@ BuildRequires: pkgconfig(libudev) BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(eventsystem) BuildRequires: pkgconfig(libtzplatform-config) -BuildRequires: pkgconfig(notification) BuildRequires: pkgconfig(hwcommon) %if %{?display_module} == on %if %{with x} diff --git a/src/block/ext4.c b/src/block/ext4.c index 847b62a..4c78271 100644 --- a/src/block/ext4.c +++ b/src/block/ext4.c @@ -116,12 +116,7 @@ static int mmc_check_smack(const char *mount_point) static int check_smack_popup(void) { - int ret = -1; - - ret = manage_notification("MMC", "Check smack"); - if (ret == -1) - return -1; - + /* TODO: show smack popup */ return 0; } diff --git a/src/core/common.c b/src/core/common.c index 81d181a..e1cdad0 100644 --- a/src/core/common.c +++ b/src/core/common.c @@ -33,7 +33,6 @@ #include #include #include -#include #include "log.h" #include "common.h" @@ -381,20 +380,3 @@ void print_time(const char *prefix) _D("%s --> %d:%02d:%02d %d", prefix, tm->tm_hour, tm->tm_min, tm->tm_sec, tv.tv_usec); } - -int manage_notification(char *title, char *content) -{ - notification_h noti; - - noti = notification_create(NOTIFICATION_TYPE_NOTI); - if (noti == NULL) { - _E("fail to create %s notification (content:%s)", title, content); - return -1; - } - - notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE, title, NULL, NOTIFICATION_TYPE_NONE); - notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT, content, NULL, NOTIFICATION_TYPE_NONE); - notification_insert(noti, NULL); - notification_free(noti); - return 0; -} diff --git a/src/core/common.h b/src/core/common.h index 530710c..027a233 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -146,7 +146,6 @@ int sys_set_str(char *fname, char *val); int terminate_process(const char *partition, bool force); int mount_check(const char* path); void print_time(const char *prefix); -int manage_notification(char *title, char *content); #endif /* __CORE_COMMON_H__ */ -- 2.7.4 From 5868566ba6c0ed7897775389cdf2a358dde9eec6 Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Mon, 4 Jan 2016 15:54:05 +0900 Subject: [PATCH 10/16] block: Fix timing issue If the device is removed before INSERT operation is handled, when thread handle INSERT operation, it could't get out loop. Change-Id: Ifcd69fcf3dfa918f637ff57c363b148dc3c928af Signed-off-by: pr.jung --- src/block/block.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- src/core/list.h | 2 ++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/src/block/block.c b/src/block/block.c index 3843bc2..6fa9c97 100644 --- a/src/block/block.c +++ b/src/block/block.c @@ -1325,6 +1325,54 @@ static void block_send_dbus_reply(DBusMessage *msg, int result) _E("Failed to send reply"); } +static bool check_removed(struct block_device *bdev, dd_list **queue, struct operation_queue **op) +{ + struct operation_queue *temp; + dd_list *l; + char name[16]; + bool removed = false; + + if (!bdev) + return removed; + + if (!queue) + return removed; + + if (!op) + return removed; + + pthread_mutex_lock(&bdev->mutex); + DD_LIST_FOREACH(*queue, l, temp) { + if (temp->op == BLOCK_DEV_REMOVE) { + removed = true; + _D("Operation queue has remove operation"); + break; + } + } + pthread_mutex_unlock(&bdev->mutex); + + if (!removed) + return removed; + + pthread_mutex_lock(&bdev->mutex); + + DD_LIST_FOREACH(*queue, l, temp) { + if (temp->op == BLOCK_DEV_REMOVE) { + *op = temp; + break; + } + temp->done = true; + block_send_dbus_reply((*op)->msg, 0); + + if (pipe_trigger(BLOCK_DEV_DEQUEUE, bdev, 0) < 0) + _E("fail to trigger pipe"); + } + + pthread_mutex_unlock(&bdev->mutex); + + return removed; +} + static void trigger_operation(struct block_device *bdev) { struct operation_queue *op; @@ -1334,6 +1382,7 @@ static void trigger_operation(struct block_device *bdev) char devnode[PATH_MAX]; char name[16]; enum block_dev_operation operation; + bool removed = false; assert(bdev); @@ -1356,6 +1405,15 @@ static void trigger_operation(struct block_device *bdev) _D("Trigger operation (%s, %s)", get_operation_char(operation, name, sizeof(name)), devnode); + if (operation == BLOCK_DEV_INSERT) { + removed = check_removed(bdev, &queue, &op); + if (removed) { + operation = op->op; + _D("Trigger operation again (%s, %s)", + get_operation_char(operation, name, sizeof(name)), devnode); + } + } + switch (operation) { case BLOCK_DEV_INSERT: ret = block_insert_device(bdev, op->data); @@ -1390,7 +1448,7 @@ static void trigger_operation(struct block_device *bdev) block_send_dbus_reply(op->msg, ret); - queue = g_list_next(queue); + queue = DD_LIST_NEXT(queue); continue_th = true; if (!queue || DD_LIST_LENGTH(queue) == 0 || diff --git a/src/core/list.h b/src/core/list.h index a67d8a1..bac4bbd 100644 --- a/src/core/list.h +++ b/src/core/list.h @@ -54,5 +54,7 @@ typedef GList dd_list; for (elem = g_list_last(head), elem_next = g_list_previous(elem), node = NULL; \ elem && ((node = elem->data) != NULL); \ elem = elem_next, elem_next = g_list_previous(elem), node = NULL) +#define DD_LIST_NEXT(a) \ + g_list_next(a) #endif -- 2.7.4 From 2c74343c98d2d77c7af8e2e14a10e6c2b40bd404 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Tue, 5 Jan 2016 18:48:06 +0900 Subject: [PATCH 11/16] usb: enable usb configuration by usb module of deviced - Previously, usb configuration is set by udev rule since usb uevent is delivered by different subsystem - Now, udev rule is removed and usb configuration is set by usb module of deviced since uevent is delivered by HAL for TM1 device Change-Id: If2fd2ca8522c704dee6deee9f6612cd4b6ec1bf3 Signed-off-by: Taeyoung Kim --- packaging/deviced.spec | 11 +---------- rules/99-deviced-sdb-enable.rules | 2 -- scripts/direct_set_debug.sh | 6 ++---- src/usb/usb-operation.conf | 2 ++ src/usb/usb-setting.conf | 4 ++-- 5 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 rules/99-deviced-sdb-enable.rules diff --git a/packaging/deviced.spec b/packaging/deviced.spec index f990b8e..e64f119 100644 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -20,7 +20,7 @@ %define usbhost_module off #Just For debugging -%define sdb_prestart on +%define sdb_prestart off %if "%{?profile}" == "mobile" %define battery_module on @@ -289,11 +289,6 @@ rm -rf %{buildroot} %install_service basic.target.wants sdb-prestart.service %endif -%if "%{?tizen_target_name}" == "TM1" -mkdir -p %{buildroot}%{_prefix}/lib/udev/rules.d/ -install -m 644 rules/99-deviced-sdb-enable.rules %{buildroot}%{_prefix}/lib/udev/rules.d/ -%endif - %post #memory type vconf key init users_gid=$(getent group %{TZ_SYS_USER_GROUP} | cut -f3 -d':') @@ -376,10 +371,6 @@ systemctl daemon-reload %{_unitdir}/basic.target.wants/sdb-prestart.service %endif -%if "%{?tizen_target_name}" == "TM1" -%{_prefix}/lib/udev/rules.d/99-deviced-sdb-enable.rules -%endif - %files tools %manifest %{name}.manifest %{_bindir}/devicectl diff --git a/rules/99-deviced-sdb-enable.rules b/rules/99-deviced-sdb-enable.rules deleted file mode 100644 index 8d460c8..0000000 --- a/rules/99-deviced-sdb-enable.rules +++ /dev/null @@ -1,2 +0,0 @@ -SUBSYSTEM=="switch", ENV{SWITCH_NAME}=="usb_cable", ENV{SWITCH_STATE}=="1", RUN+="/usr/bin/direct_set_debug.sh --sdb-set" -SUBSYSTEM=="switch", ENV{SWITCH_NAME}=="usb_cable", ENV{SWITCH_STATE}=="0", RUN+="/usr/bin/direct_set_debug.sh --sdb-unset" diff --git a/scripts/direct_set_debug.sh b/scripts/direct_set_debug.sh index c32ef41..1bc131f 100755 --- a/scripts/direct_set_debug.sh +++ b/scripts/direct_set_debug.sh @@ -17,10 +17,9 @@ unload_usb_gadget() { } sdb_set() { - load_usb_gadget "6860" "mtp" "mtp,acm,sdb" - /usr/bin/systemctl start mtp-responder.service + load_usb_gadget "6860" "" "sdb" /usr/bin/systemctl start sdbd.service - /usr/bin/vconftool set -t int memory/sysman/usb_status 1 -f + /usr/bin/vconftool set -t int memory/sysman/usb_status 2 -f echo "SDB enabled" } @@ -28,7 +27,6 @@ sdb_unset() { unload_usb_gadget /usr/bin/vconftool set -t int memory/sysman/usb_status 0 -f /usr/bin/systemctl stop sdbd.service - /usr/bin/systemctl stop mtp-responder.service echo "SDB disabled" } diff --git a/src/usb/usb-operation.conf b/src/usb/usb-operation.conf index 8db280d..89d6088 100644 --- a/src/usb/usb-operation.conf +++ b/src/usb/usb-operation.conf @@ -1,3 +1,5 @@ [SDB] +start=/usr/bin/systemctl start mtp-responder.service start=/usr/bin/systemctl start sdbd.service stop=/usr/bin/systemctl stop sdbd.service +stop=/usr/bin/systemctl stop mtp-responder.service diff --git a/src/usb/usb-setting.conf b/src/usb/usb-setting.conf index 7ab4ff7..988b77b 100644 --- a/src/usb/usb-setting.conf +++ b/src/usb/usb-setting.conf @@ -6,8 +6,8 @@ default=SDB [SDB] idVendor=04e8 idProduct=6860 -funcs_fconf= -funcs_sconf=sdb +funcs_fconf=mtp +funcs_sconf=mtp,acm,sdb bDeviceClass=239 bDeviceSubClass=2 bDeviceProtocol=1 -- 2.7.4 From 52420241cad705b4db458ed23bf2fe1b5a63cb80 Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Thu, 7 Jan 2016 13:22:48 +0900 Subject: [PATCH 12/16] block: Remove build warning Change-Id: I2fa993cb94c2821a6e982a22a5bf7184b59b0795 Signed-off-by: pr.jung --- src/block/block.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/block/block.c b/src/block/block.c index 6fa9c97..6b5a7c8 100644 --- a/src/block/block.c +++ b/src/block/block.c @@ -1329,7 +1329,6 @@ static bool check_removed(struct block_device *bdev, dd_list **queue, struct ope { struct operation_queue *temp; dd_list *l; - char name[16]; bool removed = false; if (!bdev) -- 2.7.4 From 7532f20cafc850aca4da264f53b180f5c8d82229 Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Tue, 5 Jan 2016 19:01:27 +0900 Subject: [PATCH 13/16] usb: update vconf keys for legacy usages - VCONFKEY_USB_CUR_MODE and VCONFKEY_SETAPPL_USB_MODE_INT are legacy vconf keys to notice usb state. The keys are used at the legacy codes such as mtp, and so on. Thus they are added for the other modules Change-Id: I25441a66a9466480ef4b0c93bc4177f4cf5ba778 Signed-off-by: Taeyoung Kim --- src/usb/usb.c | 43 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/src/usb/usb.c b/src/usb/usb.c index 9381424..2e2c45b 100644 --- a/src/usb/usb.c +++ b/src/usb/usb.c @@ -137,10 +137,41 @@ static int usb_config_disable(void) return config_plugin->disable(NULL); } +static void usb_change_state(int val) +{ + static int old_status = -1; + static int old_mode = -1; + int mode, legacy_mode; + + switch (val) { + case VCONFKEY_SYSMAN_USB_DISCONNECTED: + case VCONFKEY_SYSMAN_USB_CONNECTED: + mode = SET_USB_NONE; + legacy_mode = SETTING_USB_NONE_MODE; + break; + case VCONFKEY_SYSMAN_USB_AVAILABLE: + mode = SET_USB_DEFAULT; + legacy_mode = SETTING_USB_DEFAULT_MODE; + break; + default: + return; + } + + if (old_status != val) { + vconf_set_int(VCONFKEY_SYSMAN_USB_STATUS, val); + old_status = val; + } + + if (old_mode != mode) { + vconf_set_int(VCONFKEY_USB_CUR_MODE, mode); + vconf_set_int(VCONFKEY_SETAPPL_USB_MODE_INT, legacy_mode); + old_mode = mode; + } +} + static int usb_state_changed(int status) { static int old = -1; /* to update at the first time */ - int vconf_state; int ret; _I("USB state is changed from (%d) to (%d)", old, status); @@ -151,19 +182,22 @@ static int usb_state_changed(int status) switch (status) { case USB_CONNECTED: _I("USB cable is connected"); + usb_change_state(VCONFKEY_SYSMAN_USB_CONNECTED); ret = usb_config_enable(); if (ret != 0) { - vconf_state = VCONFKEY_SYSMAN_USB_CONNECTED; + _E("Failed to enable usb config (%d)", ret); break; } - vconf_state = VCONFKEY_SYSMAN_USB_AVAILABLE; + usb_change_state(VCONFKEY_SYSMAN_USB_AVAILABLE); pm_lock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE, 0); break; case USB_DISCONNECTED: _I("USB cable is disconnected"); + usb_change_state(VCONFKEY_SYSMAN_USB_DISCONNECTED); ret = usb_config_disable(); - vconf_state = VCONFKEY_SYSMAN_USB_DISCONNECTED; + if (ret != 0) + _E("Failed to disable usb config (%d)", ret); pm_unlock_internal(INTERNAL_LOCK_USB, LCD_OFF, STAY_CUR_STATE); break; @@ -176,7 +210,6 @@ static int usb_state_changed(int status) else old = status; - vconf_set_int(VCONFKEY_SYSMAN_USB_STATUS, vconf_state); return ret; } -- 2.7.4 From 69f5d919573387f27e1a4a5ef61603fc5310c2fd Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Thu, 7 Jan 2016 09:46:11 +0900 Subject: [PATCH 14/16] display: remove extreme signal handler - The signal is not used anymore It was used to check user input to change display state to DIM when battery status is very low. Change-Id: I97a4f14f8efa5f3b8d18df26eacfb244857195bd Signed-off-by: Taeyoung Kim --- src/display/display-dbus.c | 58 ---------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/src/display/display-dbus.c b/src/display/display-dbus.c index 33d84e2..0788f16 100644 --- a/src/display/display-dbus.c +++ b/src/display/display-dbus.c @@ -42,15 +42,6 @@ #define SIGNAL_SIM_STATUS "Status" #define SIM_CARD_NOT_PRESENT (0x01) -#define SIGNAL_HOMESCREEN "HomeScreen" -#define SIGNAL_EXTREME "Extreme" -#define SIGNAL_NOTEXTREME "NotExtreme" - -#define BLIND_MASK(val) ((val) & 0xFFFF) -#define BLIND_RED(val) BLIND_MASK((val) >> 32) -#define BLIND_GREEN(val) BLIND_MASK((val) >> 16) -#define BLIND_BLUE(val) BLIND_MASK((val)) - #define DISPLAY_DIM_BRIGHTNESS 0 #define DUMP_MODE_WATING_TIME 600000 @@ -1030,40 +1021,6 @@ static void sim_signal_handler(void *data, DBusMessage *msg) } } -static void extreme_signal_handler(void *data, DBusMessage *msg) -{ - int ret; - - ret = dbus_message_is_signal(msg, POPUP_INTERFACE_LOWBAT, - SIGNAL_EXTREME); - if (!ret) { - _E("there is no extreme signal"); - return; - } - - pm_status_flag &= ~BRTCH_FLAG; - backlight_ops.update(); - _D("extreme mode : enter dim state!"); - if (vconf_set_int(VCONFKEY_PM_KEY_IGNORE, TRUE) != 0) - _E("failed to set vconf status"); -} - -static void not_extreme_signal_handler(void *data, DBusMessage *msg) -{ - int ret; - - ret = dbus_message_is_signal(msg, POPUP_INTERFACE_LOWBAT, - SIGNAL_NOTEXTREME); - if (!ret) { - _E("there is no extreme signal"); - return; - } - - _D("release extreme mode"); - if (vconf_set_int(VCONFKEY_PM_KEY_IGNORE, FALSE) != 0) - _E("failed to set vconf status"); -} - /* * Default capability * api := LCDON | LCDOFF | BRIGHTNESS @@ -1106,21 +1063,6 @@ int init_pm_dbus(void) _E("Failed to register signal handler! %d", ret); return ret; } - - ret = register_edbus_signal_handler(POPUP_PATH_LOWBAT, - POPUP_INTERFACE_LOWBAT, SIGNAL_EXTREME, - extreme_signal_handler); - if (ret < 0 && ret != -EEXIST) { - _E("Failed to register signal handler! %d", ret); - return ret; - } - ret = register_edbus_signal_handler(POPUP_PATH_LOWBAT, - POPUP_INTERFACE_LOWBAT, SIGNAL_NOTEXTREME, - not_extreme_signal_handler); - if (ret < 0 && ret != -EEXIST) { - _E("Failed to register signal handler! %d", ret); - return ret; - } return 0; } -- 2.7.4 From dfa8a955ab92bd9f4bd2ed6514350f33f8a2d3ef Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Thu, 14 Jan 2016 09:53:06 +0900 Subject: [PATCH 15/16] display: remove unused macros Change-Id: Ifacc29b5da20139621ab4091912299ecc75174ef Signed-off-by: Taeyoung Kim --- src/display/core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/display/core.c b/src/display/core.c index d3cb7f5..e1cdd12 100644 --- a/src/display/core.c +++ b/src/display/core.c @@ -128,8 +128,6 @@ static int trans_table[S_END][EVENT_END] = { }; #define SHIFT_UNLOCK 4 -#define MASK_RESET_TIMEOUT 0x8 /* 1000 */ -#define MASK_MARGIN_TIMEOUT (0x1 << 8) #define SHIFT_CHANGE_STATE 7 #define CHANGE_STATE_BIT 0xF00 /* 1111 0000 0000 */ #define SHIFT_LOCK_FLAG 16 @@ -143,7 +141,6 @@ static int trans_table[S_END][EVENT_END] = { #define S_COVER_TIMEOUT 8000 #define GET_HOLDKEY_BLOCK_STATE(x) ((x >> SHIFT_LOCK_FLAG) & HOLD_KEY_BLOCK_BIT) #define GET_STANDBY_MODE_STATE(x) ((x >> SHIFT_LOCK_FLAG) & STANDBY_MODE_BIT) -#define MASK32 0xffffffff #define BOOTING_DONE_WATING_TIME 60000 /* 1 minute */ #define LOCK_TIME_WARNING 60 /* 60 seconds */ -- 2.7.4 From e37f9ba2841a450b2e4936fbda216a58efabdc0f Mon Sep 17 00:00:00 2001 From: Taeyoung Kim Date: Thu, 14 Jan 2016 09:56:56 +0900 Subject: [PATCH 16/16] display: SMAST is removed - SMAST is not supported from the platform deviced. Thus macro and related codes are removed Change-Id: I345d3cb14e755dd4ed85e7043246b30cdf88ef0b Signed-off-by: Taeyoung Kim --- src/display/core.c | 22 ++++------------------ src/display/core.h | 3 +-- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/src/display/core.c b/src/display/core.c index e1cdd12..0bb007b 100644 --- a/src/display/core.c +++ b/src/display/core.c @@ -643,17 +643,10 @@ static void update_display_time(void) /* third priority : lock state */ if ((get_lock_screen_state() == VCONFKEY_IDLE_LOCK) && !get_lock_screen_bg_state()) { - if (pm_status_flag & SMAST_FLAG) { - /* smart stay is on, timeout is always 5 seconds. */ - states[S_NORMAL].timeout = LOCK_SCREEN_CONTROL_TIMEOUT; - _I("LOCK : timeout is set, smart stay timeout(%d ms)", - LOCK_SCREEN_CONTROL_TIMEOUT); - } else { - /* timeout is different according to key or event. */ - states[S_NORMAL].timeout = lock_screen_timeout; - _I("LOCK : timeout is set by normal(%d ms)", - lock_screen_timeout); - } + /* timeout is different according to key or event. */ + states[S_NORMAL].timeout = lock_screen_timeout; + _I("LOCK : timeout is set by normal(%d ms)", + lock_screen_timeout); return; } @@ -1486,13 +1479,6 @@ static int default_trans(int evt) } } - /* smart stay */ - if (display_info.face_detection && - (pm_status_flag & SMAST_FLAG) && hallic_open) { - if (display_info.face_detection(evt, pm_cur_state, next_state)) - return 0; - } - /* state transition */ pm_old_state = pm_cur_state; pm_cur_state = next_state; diff --git a/src/display/core.h b/src/display/core.h index 4ac485e..6ad78cb 100644 --- a/src/display/core.h +++ b/src/display/core.h @@ -38,10 +38,9 @@ #define LOWBT_FLAG 0x00000100 #define CHRGR_FLAG 0x00000200 #define PWRSV_FLAG 0x00000400 -#define SMAST_FLAG 0x00001000 #define BRTCH_FLAG 0x00002000 #define PWROFF_FLAG 0x00004000 -#define DIMSTAY_FLAG 0x00008000 +#define DIMSTAY_FLAG 0x00008000 #define DEFAULT_NORMAL_TIMEOUT 30 -- 2.7.4