From 05360d61e610053753df46da1330123aef0edb5c Mon Sep 17 00:00:00 2001 From: lokilee73 Date: Fri, 6 Apr 2018 11:16:24 +0900 Subject: [PATCH 01/16] Change the method for thermal From ChangedCooldownMode to thermal_scenario Change-Id: Ie5dd8ec75a2018b1dc61dee34f37777e9a88a455 Signed-off-by: lokilee73 --- src/thermal/thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thermal/thermal.c b/src/thermal/thermal.c index d1b99e2..17d5857 100755 --- a/src/thermal/thermal.c +++ b/src/thermal/thermal.c @@ -33,7 +33,7 @@ static int noti; /* Dbus Interfaces */ #define THERMAL_PATH "/Org/Tizen/System/Pass/Monitor/Thermal" #define THERMAL_INTERFACE "org.tizen.system.pass.monitor.thermal" -#define THERMAL_METHOD_TEMP_CHANGED "ChangedCooldownMode" +#define THERMAL_METHOD_TEMP_CHANGED "thermal_scenario" /* Action types */ #define RELEASE_ACTION "ReleaseAction" -- 2.7.4 From d61002ca57126a5be4a9b9c7ecddbc58cf683c03 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Fri, 6 Apr 2018 16:26:37 +0900 Subject: [PATCH 02/16] Fix a build problem that occurred with a new version of cmake(3.9.4) Change-Id: I4531dc40550ea2feb29a90abc0329b0557cc1229 Signed-off-by: Hyotaek Shim --- src/devicectl/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/devicectl/CMakeLists.txt b/src/devicectl/CMakeLists.txt index 8f96cab..04f543b 100644 --- a/src/devicectl/CMakeLists.txt +++ b/src/devicectl/CMakeLists.txt @@ -12,7 +12,11 @@ SET(SRCS INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED glib-2.0 gio-2.0 gio-unix-2.0) +pkg_check_modules(pkgs REQUIRED + glib-2.0 + gio-2.0 + gio-unix-2.0 + libgdbus) FOREACH(flag ${pkgs_CFLAGS}) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -- 2.7.4 From f50deea1efd5062415f43eb0722983daae77413f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Szewczyk?= Date: Wed, 4 Apr 2018 12:58:08 +0200 Subject: [PATCH 03/16] Revert "Revert "usb: Remove usb-operation"" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This revert was only temporary solution and with updated HAL implementation deviced should not start any services itself. This reverts commit 64bec949084f2bff0dce333052eda84d0244ee3f. Change-Id: Ifd5ccb3b2bbdf764ef0f3a2a191755494cdb7b64 Signed-off-by: Paweł Szewczyk --- CMakeLists.txt | 2 - conf/usb-operation.conf | 14 ------ packaging/deviced.spec | 1 - src/usb/usb-operation.c | 114 ------------------------------------------------ src/usb/usb.c | 8 ---- src/usb/usb.h | 3 -- 6 files changed, 142 deletions(-) delete mode 100644 conf/usb-operation.conf delete mode 100644 src/usb/usb-operation.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ef248b..7ee72a5 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,8 +243,6 @@ ENDIF() # USB connection IF(USB_MODULE STREQUAL on) - INSTALL_CONF(conf usb-operation) - # USB (Manual setting) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/direct_set_debug.sh DESTINATION bin) IF(${SDB_PRESTART} STREQUAL on) diff --git a/conf/usb-operation.conf b/conf/usb-operation.conf deleted file mode 100644 index da6c71c..0000000 --- a/conf/usb-operation.conf +++ /dev/null @@ -1,14 +0,0 @@ -[sdb] -StartService=sdbd.service -StopService=sdbd.service - -[mtp] -StartService=mtp-responder.service -StopService=mtp-responder.service - -[rndis] -Start=/sbin/ifconfig usb0 192.168.129.3 up -Start=/sbin/route add -net 192.168.129.0 netmask 255.255.255.0 dev usb0 -StartService=sshd.service -StopService=sshd.service -Stop=/sbin/ifconfig usb0 down diff --git a/packaging/deviced.spec b/packaging/deviced.spec index 8c68f05..7adb606 100755 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -218,7 +218,6 @@ mv %{_libdir}/display-tv.so %{_libdir}/deviced/display.so %config %{_sysconfdir}/deviced/power.conf %config %{_sysconfdir}/deviced/battery.conf %config %{_sysconfdir}/deviced/display.conf -%config %{_sysconfdir}/deviced/usb-operation.conf # usbhost_test %{_sysconfdir}/deviced/usb-host-test/test_gadget.gs %{_bindir}/usb-host-ffs-test-daemon diff --git a/src/usb/usb-operation.c b/src/usb/usb-operation.c deleted file mode 100644 index 1bc8efc..0000000 --- a/src/usb/usb-operation.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * deviced - * - * Copyright (c) 2015 Samsung Electronics Co., Ltd. - * - * 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 -#include -#include - -#include "core/log.h" -#include "core/common.h" -#include "core/config-parser.h" -#include "core/launch.h" -#include "shared/deviced-systemd.h" -#include "usb.h" - -#define USB_OPERATION "/etc/deviced/usb-operation.conf" - -#define KEY_START_STR "Start" -#define KEY_STOP_STR "Stop" - -#define BUF_MAX 128 - -typedef enum { - OPERATION_STOP, - OPERATION_START, -} operation_e; - -struct oper_data { - char mode_str[BUF_MAX]; - operation_e type; -}; - -static int load_operation_config(struct parse_result *result, void *user_data) -{ - struct oper_data *data = user_data; - int ret; - operation_e type; - - if (!data || !result) - return -EINVAL; - - if (!strstr(data->mode_str, result->section)) - return 0; - - if (!strncmp(result->name, KEY_START_STR, strlen(KEY_START_STR))) - type = OPERATION_START; - else if (!strncmp(result->name, KEY_STOP_STR, strlen(KEY_STOP_STR))) - type = OPERATION_STOP; - else { - _E("Invalid name (%s)", result->name); - return -EINVAL; - } - - if (type != data->type) - return 0; - - if (strstr(result->name, "Service")) { - if (type == OPERATION_START) - ret = deviced_systemd_start_unit(result->value); - if (type == OPERATION_STOP) - ret = deviced_systemd_stop_unit(result->value); - } else - ret = launch_app_cmd(result->value); - - _I("Execute(%s %s: %d)", result->name, result->value, ret); - - return 0; -} - -static int usb_execute_operation(unsigned int mode, operation_e type) -{ - int ret; - struct oper_data data; - - usb_state_get_mode_str(mode, data.mode_str, sizeof(data.mode_str)); - - data.type = type; - - ret = config_parse(USB_OPERATION, - load_operation_config, &data); - if (ret < 0) - _E("Failed to load usb operation (%d)", ret); - - return ret; -} - -int usb_operation_start(unsigned int mode) -{ - if (is_emulator()) - return 0; - return usb_execute_operation(mode, OPERATION_START); -} - -int usb_operation_stop(unsigned int mode) -{ - if (is_emulator()) - return 0; - return usb_execute_operation(mode, OPERATION_STOP); -} diff --git a/src/usb/usb.c b/src/usb/usb.c index 66ac8b1..db380f5 100644 --- a/src/usb/usb.c +++ b/src/usb/usb.c @@ -315,8 +315,6 @@ int usb_change_mode(unsigned mode) unsigned int curr = usb_state_get_current_mode(); if (curr != USB_FUNCTION_NONE) { - usb_operation_stop(curr); - ret = usb_disable(); if (ret < 0) { _E("Failed to disable current usb mode"); @@ -339,8 +337,6 @@ int usb_change_mode(unsigned mode) _E("Failed to enable usb mode (%d)"); return ret; } - - usb_operation_start(mode); } return 0; @@ -359,15 +355,11 @@ static int usb_connected(void) return ret; } - usb_operation_start(mode); - return 0; } static int usb_disconnected(void) { - usb_operation_stop(usb_state_get_current_mode()); - usb_state_update_state(USB_DISCONNECTED, USB_FUNCTION_NONE); return usb_disable(); diff --git a/src/usb/usb.h b/src/usb/usb.h index ae26162..0e6165b 100644 --- a/src/usb/usb.h +++ b/src/usb/usb.h @@ -67,9 +67,6 @@ void usb_state_set_selected_mode(unsigned int mode); unsigned int usb_state_get_current_mode(void); usb_connection_state_e usb_state_get_connection(void); -int usb_operation_start(unsigned int mode); -int usb_operation_stop(unsigned int mode); - /* dbus methods/signals (usb-dbus.c) */ enum { DISABLED, -- 2.7.4 From 2541da181ba3c2b0b8dfff4c12721b586c1e0816 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Tue, 17 Apr 2018 18:19:21 +0900 Subject: [PATCH 04/16] Revert "To prevent Watchdog Kill during the dbus sync call" This reverts commit 19f28633e69ec61b9bd32d904b89f0b5a6f48aee. Change-Id: I57727e680fa9351fd1a3254f25d10bd639302ab6 Signed-off-by: Hyotaek Shim --- src/display/dpms-wayland-none.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/display/dpms-wayland-none.c b/src/display/dpms-wayland-none.c index 3766df5..cf1db2e 100644 --- a/src/display/dpms-wayland-none.c +++ b/src/display/dpms-wayland-none.c @@ -87,8 +87,6 @@ int dpms_get_power(enum dpms_state *state) if (!state) return -EINVAL; - watchdog_notify(); - ret = dbus_handle_method_sync(ENLIGHTENMENT_BUS_NAME, ENLIGHTENMENT_OBJECT_PATH, ENLIGHTENMENT_INTERFACE_NAME, -- 2.7.4 From c6f2bce7ac599c578db44caff1c9de5310a58251 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Wed, 18 Apr 2018 09:13:21 +0900 Subject: [PATCH 05/16] Revert "Revert "Revert "usb: Remove usb-operation""" This reverts commit f50deea1efd5062415f43eb0722983daae77413f. Change-Id: I3dc62a8c786376039dcc2592ecc61d8f348a6885 Signed-off-by: Hyotaek Shim --- CMakeLists.txt | 2 + conf/usb-operation.conf | 14 ++++++ packaging/deviced.spec | 1 + src/usb/usb-operation.c | 114 ++++++++++++++++++++++++++++++++++++++++++++++++ src/usb/usb.c | 8 ++++ src/usb/usb.h | 3 ++ 6 files changed, 142 insertions(+) create mode 100644 conf/usb-operation.conf create mode 100644 src/usb/usb-operation.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ee72a5..7ef248b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,8 @@ ENDIF() # USB connection IF(USB_MODULE STREQUAL on) + INSTALL_CONF(conf usb-operation) + # USB (Manual setting) INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/direct_set_debug.sh DESTINATION bin) IF(${SDB_PRESTART} STREQUAL on) diff --git a/conf/usb-operation.conf b/conf/usb-operation.conf new file mode 100644 index 0000000..da6c71c --- /dev/null +++ b/conf/usb-operation.conf @@ -0,0 +1,14 @@ +[sdb] +StartService=sdbd.service +StopService=sdbd.service + +[mtp] +StartService=mtp-responder.service +StopService=mtp-responder.service + +[rndis] +Start=/sbin/ifconfig usb0 192.168.129.3 up +Start=/sbin/route add -net 192.168.129.0 netmask 255.255.255.0 dev usb0 +StartService=sshd.service +StopService=sshd.service +Stop=/sbin/ifconfig usb0 down diff --git a/packaging/deviced.spec b/packaging/deviced.spec index 7adb606..8c68f05 100755 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -218,6 +218,7 @@ mv %{_libdir}/display-tv.so %{_libdir}/deviced/display.so %config %{_sysconfdir}/deviced/power.conf %config %{_sysconfdir}/deviced/battery.conf %config %{_sysconfdir}/deviced/display.conf +%config %{_sysconfdir}/deviced/usb-operation.conf # usbhost_test %{_sysconfdir}/deviced/usb-host-test/test_gadget.gs %{_bindir}/usb-host-ffs-test-daemon diff --git a/src/usb/usb-operation.c b/src/usb/usb-operation.c new file mode 100644 index 0000000..1bc8efc --- /dev/null +++ b/src/usb/usb-operation.c @@ -0,0 +1,114 @@ +/* + * deviced + * + * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * + * 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 +#include +#include + +#include "core/log.h" +#include "core/common.h" +#include "core/config-parser.h" +#include "core/launch.h" +#include "shared/deviced-systemd.h" +#include "usb.h" + +#define USB_OPERATION "/etc/deviced/usb-operation.conf" + +#define KEY_START_STR "Start" +#define KEY_STOP_STR "Stop" + +#define BUF_MAX 128 + +typedef enum { + OPERATION_STOP, + OPERATION_START, +} operation_e; + +struct oper_data { + char mode_str[BUF_MAX]; + operation_e type; +}; + +static int load_operation_config(struct parse_result *result, void *user_data) +{ + struct oper_data *data = user_data; + int ret; + operation_e type; + + if (!data || !result) + return -EINVAL; + + if (!strstr(data->mode_str, result->section)) + return 0; + + if (!strncmp(result->name, KEY_START_STR, strlen(KEY_START_STR))) + type = OPERATION_START; + else if (!strncmp(result->name, KEY_STOP_STR, strlen(KEY_STOP_STR))) + type = OPERATION_STOP; + else { + _E("Invalid name (%s)", result->name); + return -EINVAL; + } + + if (type != data->type) + return 0; + + if (strstr(result->name, "Service")) { + if (type == OPERATION_START) + ret = deviced_systemd_start_unit(result->value); + if (type == OPERATION_STOP) + ret = deviced_systemd_stop_unit(result->value); + } else + ret = launch_app_cmd(result->value); + + _I("Execute(%s %s: %d)", result->name, result->value, ret); + + return 0; +} + +static int usb_execute_operation(unsigned int mode, operation_e type) +{ + int ret; + struct oper_data data; + + usb_state_get_mode_str(mode, data.mode_str, sizeof(data.mode_str)); + + data.type = type; + + ret = config_parse(USB_OPERATION, + load_operation_config, &data); + if (ret < 0) + _E("Failed to load usb operation (%d)", ret); + + return ret; +} + +int usb_operation_start(unsigned int mode) +{ + if (is_emulator()) + return 0; + return usb_execute_operation(mode, OPERATION_START); +} + +int usb_operation_stop(unsigned int mode) +{ + if (is_emulator()) + return 0; + return usb_execute_operation(mode, OPERATION_STOP); +} diff --git a/src/usb/usb.c b/src/usb/usb.c index db380f5..66ac8b1 100644 --- a/src/usb/usb.c +++ b/src/usb/usb.c @@ -315,6 +315,8 @@ int usb_change_mode(unsigned mode) unsigned int curr = usb_state_get_current_mode(); if (curr != USB_FUNCTION_NONE) { + usb_operation_stop(curr); + ret = usb_disable(); if (ret < 0) { _E("Failed to disable current usb mode"); @@ -337,6 +339,8 @@ int usb_change_mode(unsigned mode) _E("Failed to enable usb mode (%d)"); return ret; } + + usb_operation_start(mode); } return 0; @@ -355,11 +359,15 @@ static int usb_connected(void) return ret; } + usb_operation_start(mode); + return 0; } static int usb_disconnected(void) { + usb_operation_stop(usb_state_get_current_mode()); + usb_state_update_state(USB_DISCONNECTED, USB_FUNCTION_NONE); return usb_disable(); diff --git a/src/usb/usb.h b/src/usb/usb.h index 0e6165b..ae26162 100644 --- a/src/usb/usb.h +++ b/src/usb/usb.h @@ -67,6 +67,9 @@ void usb_state_set_selected_mode(unsigned int mode); unsigned int usb_state_get_current_mode(void); usb_connection_state_e usb_state_get_connection(void); +int usb_operation_start(unsigned int mode); +int usb_operation_stop(unsigned int mode); + /* dbus methods/signals (usb-dbus.c) */ enum { DISABLED, -- 2.7.4 From 2ba981c32cca7b0e6469e220ad0b6bf1aa15f571 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Wed, 25 Apr 2018 13:52:09 +0900 Subject: [PATCH 06/16] Remove unnecessary "Requires" to avoid build issues regarding noarch Dear All, I came up today with a dependency problem, that blocks verification of SR. The SR submit/tizen/20180424.062711 for tef-simulator (platform/core/security/tef-simulator) failed to create 5 images. Although, there is nothing wrong in changes proposed in tef-simulator. The images that failed to build do not even contain tef-simulator and should not be affected anyway. Here is what happened: 1) tef -simulator builds only for Intel archs, because of this line in tef-simulator.spec: ExcludeArch: armv6l armv7hl armv7l aarch64 2) build of tef-simulator triggers build of key-manager-ta, which triggers build of deviced, but still only for Intel archs. Build is not retriggered for arm (armv7l and aarch64) architectures, because there were no changes in code there. 3) Five of images requires deviced-config-profile-wearable or deviced-config-enable-display-timer package which are part of deviced and is noarch. They have been rebuild in the SR so is published as deviced-config-profile-wearable-5.0.0-20180424.062711.noarch, deviced-config-enable-display-timer-5.0.0-20180424.062711.noarch 4) According to deviced.spec (platform/core/system/deviced) config-profile-wearable, deviced-config-enable-display-timer packages requires deviced package with exactly same version and release: %package config-profile-wearable Summary: Configuration files for wearable profile Group: System/Management Requires: %{name} = %{version}-%{release} BuildArch: noarch %package config-enable-display-timer Summary: Configuration files for display Group: System/Management Requires: %{name} = %{version}-%{release} BuildArch: noarch However deviced package in version and release 5.0.0-20180424.062711 is not found for armv7l architecture, because version from reference snapshot is 5.0.0-36.3. So the problem is that the noarch package (config-profile-wearable) can be rebuild without rebuilding main package (deviced) for arm architectures. And then it is impossible to satisfy "Requires" criteria and match exactly same version during image creation. The proposed solution would be to remove these 2 lines (Requires: %{name} = %{version}-%{release}) from deviced.spec as these packages providing conf does not really depend on deviced package. I verified that it won't break images as deviced itself is also included in meta files for wearable and mobile images which have this issue. Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Change-Id: I95061848b3bb0429840122e01fd72db5adda5f2a Signed-off-by: Hyotaek Shim --- packaging/deviced.spec | 2 -- 1 file changed, 2 deletions(-) diff --git a/packaging/deviced.spec b/packaging/deviced.spec index 8c68f05..ffcd0e7 100755 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -84,7 +84,6 @@ This package can be installed optional for auto dbus test. %package config-profile-wearable Summary: Configuration files for wearable profile Group: System/Management -Requires: %{name} = %{version}-%{release} BuildArch: noarch %description config-profile-wearable @@ -93,7 +92,6 @@ This package is used for wearable profile %package config-enable-display-timer Summary: Configuration files for display Group: System/Management -Requires: %{name} = %{version}-%{release} BuildArch: noarch %description config-enable-display-timer -- 2.7.4 From 4425cc54326396ca773310f5ede0af7b0159bf53 Mon Sep 17 00:00:00 2001 From: lokilee73 Date: Tue, 24 Apr 2018 20:32:55 +0900 Subject: [PATCH 07/16] Modify dbus for DIM Change-Id: I706f6f55accc9858939fc8ae3e621b489f637b15 Signed-off-by: lokilee73 --- CMakeLists.txt | 1 + packaging/deviced.spec | 1 + src/display/device-interface.c | 10 ++++-- src/display/device-interface.h | 2 +- src/display/display-dbus.c | 73 +++++++++++++++++++++++++----------------- src/libdeviced/display.c | 1 - 6 files changed, 55 insertions(+), 33 deletions(-) mode change 100644 => 100755 src/display/device-interface.h mode change 100644 => 100755 src/display/display-dbus.c mode change 100644 => 100755 src/libdeviced/display.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ef248b..7000c7d 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,7 @@ SET(PKG_MODULES hwcommon mount capi-system-info + capi-system-device libsystemd libgdbus ) diff --git a/packaging/deviced.spec b/packaging/deviced.spec index ffcd0e7..a908a6d 100755 --- a/packaging/deviced.spec +++ b/packaging/deviced.spec @@ -36,6 +36,7 @@ BuildRequires: pkgconfig(minizip) BuildRequires: pkgconfig(libkmod) BuildRequires: pkgconfig(libusbgx) BuildRequires: pkgconfig(libgdbus) +BuildRequires: pkgconfig(capi-system-device) Requires: %{name}-tools = %{version}-%{release} %{?systemd_requires} diff --git a/src/display/device-interface.c b/src/display/device-interface.c index 897906f..1aa0c50 100755 --- a/src/display/device-interface.c +++ b/src/display/device-interface.c @@ -104,7 +104,7 @@ static int bl_brt(int brightness, int delay) if (delay > 0) usleep(delay); - if (force_brightness > 0 && brightness != PM_DIM_BRIGHTNESS) { + if (force_brightness > 0) { _I("brightness(%d), force brightness(%d)", brightness, force_brightness); brightness = force_brightness; @@ -281,8 +281,14 @@ static int backlight_off(enum device_flags flags) static int backlight_dim(void) { int ret; + int brightness; - ret = bl_brt(PM_DIM_BRIGHTNESS, 0); + if (vconf_get_int(VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS, &brightness) != 0) { + _E("Failed to get VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS value"); + return -EPERM; + } + + ret = bl_brt(brightness, 0); #ifdef ENABLE_PM_LOG if (!ret) pm_history_save(PM_LOG_LCD_DIM, pm_cur_state); diff --git a/src/display/device-interface.h b/src/display/device-interface.h old mode 100644 new mode 100755 index cd29d23..88e25cf --- a/src/display/device-interface.h +++ b/src/display/device-interface.h @@ -34,13 +34,13 @@ #define PM_MAX_BRIGHTNESS 100 #define PM_MIN_BRIGHTNESS 1 #define PM_DEFAULT_BRIGHTNESS 60 -#define PM_DIM_BRIGHTNESS 0 #define DISP_INDEX_SHIFT 16 #define DISP_CMD(prop, index) ((index << DISP_INDEX_SHIFT) | prop) #define DEFAULT_DISPLAY_COUNT 1 #define DEFAULT_DISPLAY_MAX_BRIGHTNESS 100 +#define DEFAULT_DISPLAY_MAX_DIM_BRIGHTNESS 50 /* * Event type enumeration diff --git a/src/display/display-dbus.c b/src/display/display-dbus.c old mode 100644 new mode 100755 index 3e374cf..04fcbe7 --- a/src/display/display-dbus.c +++ b/src/display/display-dbus.c @@ -41,10 +41,10 @@ #include "dd-display.h" #include "display-actor.h" #include "display-ops.h" +#include #define SIGNAL_HOMESCREEN "HomeScreen" -#define DISPLAY_DIM_BRIGHTNESS 0 #define DUMP_MODE_WATING_TIME 600000 #define EXPIRED_POPUP_TYPE_POWER "power_lock_expired" @@ -338,11 +338,17 @@ GVariant *dbus_getmaxbrightness(GDBusConnection *conn, const gchar *sender, const gchar *path, const gchar *iface, const gchar *name, GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data) { - int ret; + int ret, state; CHECK_POWEROFF(); - ret = DEFAULT_DISPLAY_MAX_BRIGHTNESS; + g_variant_get(param, "(i)", &state); + if (state == DISPLAY_STATE_NORMAL) + ret = DEFAULT_DISPLAY_MAX_BRIGHTNESS; + else if (state == DISPLAY_STATE_SCREEN_DIM) + ret = DEFAULT_DISPLAY_MAX_DIM_BRIGHTNESS; + else + ret = -EINVAL; return g_variant_new("(i)", ret); } @@ -364,11 +370,19 @@ GVariant *dbus_getbrightness(GDBusConnection *conn, const gchar *sender, const gchar *path, const gchar *iface, const gchar *name, GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data) { - int brt, ret; + int brt = -1, state, ret; CHECK_POWEROFF(); - ret = backlight_ops.get_brightness(&brt); + g_variant_get(param, "(i)", &state); + + if (state == DISPLAY_STATE_NORMAL) { + ret = backlight_ops.get_brightness(&brt); + } else if (state == DISPLAY_STATE_SCREEN_DIM) { + ret = vconf_get_int(VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS, &brt); + } else + ret = -EINVAL; + if (ret >= 0) ret = brt; @@ -381,7 +395,7 @@ GVariant *dbus_setbrightness(GDBusConnection *conn, const gchar *sender, const gchar *path, const gchar *iface, const gchar *name, GVariant *param, GDBusMethodInvocation *invocation, gpointer user_data) { - int brt, autobrt, ret, caps; + int state, brt, autobrt, ret = 0, caps; CHECK_POWEROFF(); @@ -393,13 +407,7 @@ GVariant *dbus_setbrightness(GDBusConnection *conn, goto error; } - g_variant_get(param, "(i)", &brt); - - if (brt == DISPLAY_DIM_BRIGHTNESS) { - _E("application can not set this value(DIM VALUE:%d)", brt); - ret = -EPERM; - goto error; - } + g_variant_get(param, "(ii)", &state, &brt); if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &autobrt) != 0) { _E("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value"); @@ -412,11 +420,24 @@ GVariant *dbus_setbrightness(GDBusConnection *conn, goto error; } - ret = backlight_ops.set_brightness(brt); - if (ret < 0) - goto error; - if (vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, brt) != 0) - _E("Failed to set VCONFKEY_SETAPPL_LCD_BRIGHTNESS value"); + if (state == DISPLAY_STATE_NORMAL) { + ret = backlight_ops.set_brightness(brt); + if (ret < 0) + goto error; + + if (vconf_set_int(VCONFKEY_SETAPPL_LCD_BRIGHTNESS, brt) != 0) + _E("Failed to set VCONFKEY_SETAPPL_LCD_BRIGHTNESS value"); + } else if (state == DISPLAY_STATE_SCREEN_DIM) { + if (pm_cur_state == S_LCDDIM) { + ret = backlight_ops.set_brightness(brt); + if (ret < 0) + goto error; + } + + if (vconf_set_int(VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS, brt) != 0) + _E("Failed to set VCONFKEY_SETAPPL_LCD_DIM_BRIGHTNESS value"); + } else + ret = -EINVAL; _I("set brightness %d, %d", brt, ret); @@ -442,12 +463,6 @@ GVariant *dbus_holdbrightness(GDBusConnection *conn, g_variant_get(param, "(i)", &brt); - if (brt == DISPLAY_DIM_BRIGHTNESS) { - _E("application can not set this value(DIM VALUE:%d)", brt); - ret = -EPERM; - goto error; - } - if (vconf_get_int(VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT, &autobrt) != 0) { _E("Failed to get VCONFKEY_SETAPPL_BRIGHTNESS_AUTOMATIC_INT value"); autobrt = SETTING_BRIGHTNESS_AUTOMATIC_OFF; @@ -1018,17 +1033,17 @@ static const dbus_method_s dbus_methods[] = { { "unlockstate", "ss", "i", dbus_unlockstate }, { "changestate", "s", "i", dbus_changestate }, { "ChangeState", "s", "i", dbus_changestate }, - { "getbrightness", NULL, "i", dbus_getbrightness }, /* deprecated */ - { "setbrightness", "i", "i", dbus_setbrightness }, /* deprecated */ + { "getbrightness", "i", "i", dbus_getbrightness }, /* deprecated */ + { "setbrightness", "ii", "i", dbus_setbrightness }, /* deprecated */ { "setframerate", "ii", "i", dbus_setrefreshrate }, /* deprecated */ { "setautobrightnessmin", "i", "i", dbus_setautobrightnessmin }, { "setlcdtimeout", "iii", "i", dbus_setlcdtimeout }, { "LockScreenBgOn", "s", "i", dbus_lockscreenbgon }, { "GetDisplayCount", NULL, "i", dbus_getdisplaycount }, - { "GetMaxBrightness", NULL, "i", dbus_getmaxbrightness }, + { "GetMaxBrightness", "i", "i", dbus_getmaxbrightness }, { "SetMaxBrightness", "i", "i", dbus_setmaxbrightness }, - { "GetBrightness", NULL, "i", dbus_getbrightness }, - { "SetBrightness", "i", "i", dbus_setbrightness }, + { "GetBrightness", "i", "i", dbus_getbrightness }, + { "SetBrightness", "ii", "i", dbus_setbrightness }, { "HoldBrightness", "i", "i", dbus_holdbrightness }, { "ReleaseBrightness", NULL, "i", dbus_releasebrightness }, { "SetRefreshRate", "ii", "i", dbus_setrefreshrate }, diff --git a/src/libdeviced/display.c b/src/libdeviced/display.c old mode 100644 new mode 100755 index 5df5e3f..63a7c5c --- a/src/libdeviced/display.c +++ b/src/libdeviced/display.c @@ -27,7 +27,6 @@ #define DISPLAY_MAX_BRIGHTNESS 100 #define DISPLAY_MIN_BRIGHTNESS 1 -#define DISPLAY_DIM_BRIGHTNESS 0 #define HOLDKEY_BLOCK_BIT 0x1 -- 2.7.4 From 4afe19f35576a7743908aedd3ad61f14bd419da5 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Wed, 9 May 2018 09:07:00 +0900 Subject: [PATCH 08/16] Remove README.error.code Change-Id: I78881d49d62c37f107cc048dc448fed29531bf8d Signed-off-by: Hyotaek Shim --- README.error.code | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 README.error.code diff --git a/README.error.code b/README.error.code deleted file mode 100644 index 61cd9c6..0000000 --- a/README.error.code +++ /dev/null @@ -1,9 +0,0 @@ -DBus Error note - -Functions Defines Values -====================================================================== -dbus_bus_get EPERM 1 -dbus_message_get_args ENOMSG 42 -dbus_connection_send_with_reply_and_block ECOMM 70 -dbus_connection_send ECOMM 70 -dbus_message_new_method_call EBADMSG 74 -- 2.7.4 From 228981a2218315a76a2d9b53bc104ffd4ca79e7f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Szewczyk?= Date: Wed, 7 Mar 2018 14:35:40 +0100 Subject: [PATCH 09/16] usb-host-ffs-test-daemon: Improve error handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - Added ep0 thread for handling disable requests - Errors are handled by simply reseting the threads - Added few race-condition protecting locks and conditions. - Sleep at few critical points (workaround for race conditions that couldn't be identified so far) Change-Id: I9e0f9de975493390251763d6f07eea550b77ed6d Signed-off-by: Paweł Szewczyk --- .../usb-host-ffs-test-daemon.c | 155 +++++++++++++++------ 1 file changed, 110 insertions(+), 45 deletions(-) diff --git a/src/usb-host-ffs-test-daemon/usb-host-ffs-test-daemon.c b/src/usb-host-ffs-test-daemon/usb-host-ffs-test-daemon.c index ecac763..0899f4f 100644 --- a/src/usb-host-ffs-test-daemon/usb-host-ffs-test-daemon.c +++ b/src/usb-host-ffs-test-daemon/usb-host-ffs-test-daemon.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,11 @@ enum { char int_buf[BUFSIZE]; char bulk_buf[BUFSIZE]; +pthread_cond_t enable_cond = PTHREAD_COND_INITIALIZER; +pthread_cond_t disable_cond = PTHREAD_COND_INITIALIZER; +pthread_mutex_t ready_lock; +int connected = 0; + /* Close all ep files */ void cleanup_ffs(int *ep) { @@ -65,42 +71,72 @@ void cleanup_ffs(int *ep) } /* Handle events generated by kernel and provided via ep0 */ -int handle_ep0(int ep0, int *connected) +void *loop_ep0(void *data) { struct usb_functionfs_event event; int ret; + int *ep = data; - ret = read(ep0, &event, sizeof(event)); - if (!ret) { - report_error("unable to read event from ep0"); - return -EIO; - } - - switch (event.type) { - case FUNCTIONFS_SETUP: - /* stall for all setuo requests */ - if (event.u.setup.bRequestType & USB_DIR_IN) { - if (write(ep0, NULL, 0) < 0) - report_error("write error %d", errno); - } else { - if (read(ep0, NULL, 0) < 0) - report_error("read error %d", errno); + while (1) { + ret = read(ep[0], &event, sizeof(event)); + if (!ret) { + report_error("unable to read event from ep0"); + return NULL; } - break; - - case FUNCTIONFS_ENABLE: - *connected = 1; - break; - - case FUNCTIONFS_DISABLE: - *connected = 0; - break; - default: - break; + switch (event.type) { + case FUNCTIONFS_SETUP: + /* stall for all setuo requests */ + if (event.u.setup.bRequestType & USB_DIR_IN) { + if (write(ep[0], NULL, 0) < 0) + report_error("write error %d", errno); + } else { + if (read(ep[0], NULL, 0) < 0) + report_error("read error %d", errno); + } + + fprintf(stderr, "Functionfs setup request\n"); + break; + + case FUNCTIONFS_ENABLE: + usleep(200000); + pthread_mutex_lock(&ready_lock); + fprintf(stderr, "Functionfs enable request\n"); + if (connected) { + report_error("Already enabled!\n"); + pthread_cond_broadcast(&disable_cond); + } + + connected = 1; + pthread_cond_broadcast(&enable_cond); + pthread_mutex_unlock(&ready_lock); + break; + + case FUNCTIONFS_DISABLE: + pthread_mutex_lock(&ready_lock); + fprintf(stderr, "Functionfs disable request\n"); + exit(0); + if (!connected) { + report_error("Already disabled!\n"); + pthread_cond_broadcast(&enable_cond); + } + + connected = 0; + pthread_cond_broadcast(&disable_cond); + pthread_mutex_unlock(&ready_lock); + break; + + case FUNCTIONFS_BIND: + fprintf(stderr, "Functionfs bind request\n"); + break; + + default: + fprintf(stderr, "Functionf unknown request: %d\n", event.type); + break; + } } - return 0; + return NULL; } struct tdata { @@ -114,25 +150,29 @@ void *loop_thread(void *data) struct tdata *d = data; int ret; + pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); + while (1) { ret = read(d->ep_out, d->buf, BUFSIZE); if (ret < 0) { report_error("read error on fd %d: %m\n", d->ep_out); - if (errno != ECONNRESET && errno != ESHUTDOWN) + usleep(200000); + if (errno != ECONNRESET && errno != ESHUTDOWN && errno != EINTR) exit(ret); - return NULL; + pthread_exit(NULL); } fprintf(stderr, "received %d bytes\n", ret); + usleep(200000); ret = write(d->ep_in, d->buf, ret); if (ret < 0) { report_error("write error on fd %d: %m\n", d->ep_in); - if (errno != ECONNRESET && errno != ESHUTDOWN) + if (errno != ECONNRESET && errno != ESHUTDOWN && errno != EINTR) exit(ret); - return NULL; + pthread_exit(NULL); } fprintf(stderr, "sent %d bytes\n", ret); @@ -141,12 +181,20 @@ void *loop_thread(void *data) return NULL; } +void clear_halt(int ep) +{ + int ret; + + ret = ioctl(ep, FUNCTIONFS_CLEAR_HALT); + if (ret < 0) + fprintf(stderr, "could not reset endpoint %d: %m", ep); +} + /* main chat function */ void do_chat(int *ep) { - int connected = 0; int ret; - pthread_t int_thread, bulk_thread; + pthread_t int_thread, bulk_thread, ep0_thread; struct tdata int_data, bulk_data; int_data.ep_in = ep[EP_IN_INT_IDX]; @@ -156,28 +204,45 @@ void do_chat(int *ep) bulk_data.ep_out = ep[EP_OUT_BULK_IDX]; bulk_data.buf = bulk_buf; + pthread_mutex_init(&ready_lock, NULL); + + ret = pthread_create(&ep0_thread, NULL, loop_ep0, ep); + if (ret < 0) + exit(1); + while (1) { - while (!connected) { - ret = handle_ep0(ep[0], &connected); - if (ret < 0) - return; - } + pthread_mutex_lock(&ready_lock); + if (!connected) + pthread_cond_wait(&enable_cond, &ready_lock); + + fprintf(stderr, "Connected\n"); ret = pthread_create(&bulk_thread, NULL, loop_thread, &bulk_data); if (ret < 0) - return; + exit(1); ret = pthread_create(&int_thread, NULL, loop_thread, &int_data); - if (ret < 0) { - pthread_cancel(bulk_thread); - return; - } + if (ret < 0) + exit(1); + pthread_cond_wait(&disable_cond, &ready_lock); + fprintf(stderr, "Disconnected\n"); + + pthread_cancel(bulk_thread); + pthread_cancel(int_thread); pthread_join(bulk_thread, NULL); pthread_join(int_thread, NULL); - connected = 0; + clear_halt(ep[EP_IN_BULK_IDX]); + clear_halt(ep[EP_OUT_BULK_IDX]); + clear_halt(ep[EP_IN_INT_IDX]); + clear_halt(ep[EP_OUT_INT_IDX]); + + pthread_mutex_unlock(&ready_lock); } + + pthread_join(ep0_thread, NULL); + pthread_mutex_destroy(&ready_lock); } int main(int argc, char **argv) -- 2.7.4 From b4852135817bf6fcf247a2dd5c237af5a15a1ee3 Mon Sep 17 00:00:00 2001 From: "sanghyeok.oh" Date: Wed, 16 May 2018 16:02:26 +0900 Subject: [PATCH 10/16] dbus-policy: remove unnecessary rule Change-Id: Ie0520916de700ec531062b99e099546ab9bd0e2c Signed-off-by: sanghyeok.oh --- conf/org.tizen.system.deviced.conf | 3 --- 1 file changed, 3 deletions(-) diff --git a/conf/org.tizen.system.deviced.conf b/conf/org.tizen.system.deviced.conf index 81c31c6..75ad7f6 100644 --- a/conf/org.tizen.system.deviced.conf +++ b/conf/org.tizen.system.deviced.conf @@ -52,8 +52,5 @@ - - -- 2.7.4 From 2be723bc1c2bd2b808348cec74fa30346e70187c Mon Sep 17 00:00:00 2001 From: lokilee73 Date: Fri, 18 May 2018 22:25:12 +0900 Subject: [PATCH 11/16] Remove logs in timeout_handler Change-Id: Ibc35dc73f7cd7615b6d37a9853c0505d6d11bdcd Signed-off-by: lokilee73 --- src/display/core.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/display/core.c b/src/display/core.c index 44f550e..e91264c 100755 --- a/src/display/core.c +++ b/src/display/core.c @@ -674,17 +674,14 @@ gboolean timeout_handler(void *data) { int run_timeout; - _I("Time out state %s\n", states[pm_cur_state].name); /* default setting */ get_run_timeout(&run_timeout); /* for sdk * if the run_timeout is zero, it regards AlwaysOn state */ - if (run_timeout == 0 || display_conf.lcd_always_on) { - _D("run_timeout is always on"); + if (run_timeout == 0 || display_conf.lcd_always_on) return G_SOURCE_CONTINUE; - } if (timeout_src_id) { g_source_remove(timeout_src_id); -- 2.7.4 From a63b2793c19d372649628536b7277f459fd0150c Mon Sep 17 00:00:00 2001 From: lokilee73 Date: Fri, 25 May 2018 16:43:51 +0900 Subject: [PATCH 12/16] Add condition to remove unnecessary logs in timeout_handler Lots of logs in timeout_handler are printed in special condition. LCD always on + changestate of S_LCDOFF by dbus request So, add condition of pm_cur_state to remove timer. Change-Id: Ibaed3baa638097771a53d02028bd0f32694794fb Signed-off-by: lokilee73 --- src/display/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/display/core.c b/src/display/core.c index e91264c..25b8016 100755 --- a/src/display/core.c +++ b/src/display/core.c @@ -674,14 +674,17 @@ gboolean timeout_handler(void *data) { int run_timeout; + _I("Time out state %s\n", states[pm_cur_state].name); /* default setting */ get_run_timeout(&run_timeout); /* for sdk * if the run_timeout is zero, it regards AlwaysOn state */ - if (run_timeout == 0 || display_conf.lcd_always_on) + if (pm_cur_state == S_NORMAL && (run_timeout == 0 || display_conf.lcd_always_on)) { + _D("run_timeout is always on"); return G_SOURCE_CONTINUE; + } if (timeout_src_id) { g_source_remove(timeout_src_id); -- 2.7.4 From 63ac56a1c3945fc2eeec815e5f411adfcff1e502 Mon Sep 17 00:00:00 2001 From: lokilee73 Date: Mon, 28 May 2018 22:17:20 +0900 Subject: [PATCH 13/16] Sychronize internal apis with ones in device Change-Id: I4023ce26db5befde2da12661e0d3bf5191580cc6 Signed-off-by: lokilee73 --- src/libdeviced/display.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libdeviced/display.c b/src/libdeviced/display.c index 63a7c5c..73a2ec5 100755 --- a/src/libdeviced/display.c +++ b/src/libdeviced/display.c @@ -24,6 +24,7 @@ #include "log.h" #include "common.h" #include "dd-display.h" +#include #define DISPLAY_MAX_BRIGHTNESS 100 #define DISPLAY_MIN_BRIGHTNESS 1 @@ -62,11 +63,11 @@ API int display_get_max_brightness(void) { int ret; - ret = dbus_handle_method_sync(DEVICED_BUS_NAME, + ret = dbus_handle_method_sync_var(DEVICED_BUS_NAME, DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY, METHOD_GET_MAX_BRIGHTNESS, - NULL, NULL); + g_variant_new("(i)", DISPLAY_STATE_NORMAL)); if (ret < 0) return DISPLAY_MAX_BRIGHTNESS; @@ -85,7 +86,7 @@ API int display_set_brightness_with_setting(int val) DEVICED_PATH_DISPLAY, DEVICED_INTERFACE_DISPLAY, METHOD_SET_BRIGHTNESS, - g_variant_new("(i)", val)); + g_variant_new("(ii)", DISPLAY_STATE_NORMAL, val)); if (ret < 0) _E("no message : failed to setting"); -- 2.7.4 From 21859f00e5e5a8a76469d5982f8356b6620d8506 Mon Sep 17 00:00:00 2001 From: Donghwan Jeong Date: Fri, 25 May 2018 13:40:25 +0900 Subject: [PATCH 14/16] pm: set powerlock at deviced init time While the powerlock is unlocked, system can fall asleep even at the Normal state. For instance, you can see this problem right after deviced is restarted by suspend-time crash. Change-Id: Ibb5422409de1cf45d7e70df25c58b0f6bea0e049 Signed-off-by: Donghwan Jeong Signed-off-by: Hyotaek Shim --- src/display/core.c | 47 +++++++++++++++++++++--------------------- src/display/core.h | 1 - src/display/device-interface.c | 2 +- src/display/device-interface.h | 4 +--- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/src/display/core.c b/src/display/core.c index 25b8016..f5be97b 100755 --- a/src/display/core.c +++ b/src/display/core.c @@ -2194,7 +2194,6 @@ static int display_probe(void *data) static void display_init(void *data) { int ret, i; - unsigned int flags = (WITHOUT_STARTNOTI | FLAG_X_DPMS); int timeout = 0; bool wm_ready; @@ -2224,7 +2223,7 @@ static void display_init(void *data) case INIT_INTERFACE: if (display_conf.timeout_enable) get_lcd_timeout_from_settings(); - ret = init_sysfs(flags); + ret = init_sysfs(); break; case INIT_POLL: _I("input init"); @@ -2267,33 +2266,33 @@ static void display_init(void *data) trans_table[S_NORMAL][EVENT_TIMEOUT] = S_NORMAL; } - if (flags & WITHOUT_STARTNOTI) { /* start without noti */ - _I("Start Power managing without noti"); - pm_cur_state = S_NORMAL; - set_setting_pmstate(pm_cur_state); - - if (display_conf.timeout_enable) { - timeout = states[S_NORMAL].timeout; - /* check minimun lcd on time */ - if (timeout < SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT)) - timeout = SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT); + _I("Start Power managing without noti"); + if (power_ops.get_power_lock_support()) + power_ops.power_lock(); - reset_timeout(timeout); - } + pm_cur_state = S_NORMAL; + set_setting_pmstate(pm_cur_state); - status = DEVICE_OPS_STATUS_START; - /* - * Lock lcd off until booting is done. - * deviced guarantees all booting script is executing. - * Last script of booting unlocks this suspend blocking state. - */ - pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, - STAY_CUR_STATE, BOOTING_DONE_WATING_TIME); - pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, - STAY_CUR_STATE, BOOTING_DONE_WATING_TIME); + if (display_conf.timeout_enable) { + timeout = states[S_NORMAL].timeout; + /* check minimun lcd on time */ + if (timeout < SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT)) + timeout = SEC_TO_MSEC(DEFAULT_NORMAL_TIMEOUT); + reset_timeout(timeout); } + status = DEVICE_OPS_STATUS_START; + /* + * Lock lcd off until booting is done. + * deviced guarantees all booting script is executing. + * Last script of booting unlocks this suspend blocking state. + */ + pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_OFF, + STAY_CUR_STATE, BOOTING_DONE_WATING_TIME); + pm_lock_internal(INTERNAL_LOCK_BOOTING, LCD_NORMAL, + STAY_CUR_STATE, BOOTING_DONE_WATING_TIME); + if (display_conf.input_support) if (CHECK_OPS(keyfilter_ops, init)) keyfilter_ops->init(); diff --git a/src/display/core.h b/src/display/core.h index 57261de..298a170 100644 --- a/src/display/core.h +++ b/src/display/core.h @@ -28,7 +28,6 @@ #include "device-interface.h" #include "setting.h" -#define WITHOUT_STARTNOTI 0x1 #define MASK_BIT 0x7 /* 111 */ #define MASK_NORMAL 0x1 /* 001 */ #define MASK_DIM 0x2 /* 010 */ diff --git a/src/display/device-interface.c b/src/display/device-interface.c index 1aa0c50..4d77030 100755 --- a/src/display/device-interface.c +++ b/src/display/device-interface.c @@ -665,7 +665,7 @@ int display_service_free(void) return 0; } -int init_sysfs(unsigned int flags) +int init_sysfs() { _init_ops(); return 0; diff --git a/src/display/device-interface.h b/src/display/device-interface.h index 88e25cf..7f2be5c 100755 --- a/src/display/device-interface.h +++ b/src/display/device-interface.h @@ -27,8 +27,6 @@ #include #include "core/devices.h" -#define FLAG_X_DPMS 0x2 - #define DEFAULT_DISPLAY 0 #define PM_MAX_BRIGHTNESS 100 @@ -52,7 +50,7 @@ enum { EVENT_END, }; -int init_sysfs(unsigned int); +int init_sysfs(void); int exit_sysfs(void); int display_service_load(void); int display_service_free(void); -- 2.7.4 From 657fd9b698c0e09a5dde54b7a4247a1b484b6f19 Mon Sep 17 00:00:00 2001 From: "pr.jung" Date: Fri, 1 Jun 2018 11:18:24 +0900 Subject: [PATCH 15/16] libdeviced: Remove unused internal APIs - RequestSecureMount and RequestSecureUnmount doesn't exist. Change-Id: I3fa24b8a4b245f102dca56bf004400ceaa84fa6c Signed-off-by: pr.jung --- src/libdeviced/mmc.c | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/libdeviced/mmc.c b/src/libdeviced/mmc.c index f1c6484..9879325 100644 --- a/src/libdeviced/mmc.c +++ b/src/libdeviced/mmc.c @@ -28,39 +28,12 @@ #include "common.h" #include "dd-mmc.h" -#define METHOD_REQUEST_SECURE_MOUNT "RequestSecureMount" -#define METHOD_REQUEST_SECURE_UNMOUNT "RequestSecureUnmount" - #define ODE_MOUNT_STATE 1 #define FORMAT_TIMEOUT (120*1000) #define STORAGE_MMC 1 #define BUF_MAX 256 -API int mmc_secure_mount(const char *mount_point) -{ - if (mount_point == NULL) - return -EINVAL; - - return dbus_handle_method_sync_var(DEVICED_BUS_NAME, - DEVICED_PATH_MMC, - DEVICED_INTERFACE_MMC, - METHOD_REQUEST_SECURE_MOUNT, - g_variant_new("(s)", mount_point)); -} - -API int mmc_secure_unmount(const char *mount_point) -{ - if (mount_point == NULL) - return -EINVAL; - - return dbus_handle_method_sync_var(DEVICED_BUS_NAME, - DEVICED_PATH_MMC, - DEVICED_INTERFACE_MMC, - METHOD_REQUEST_SECURE_UNMOUNT, - g_variant_new("(s)", mount_point)); -} - static int get_mmc_primary_id() { GVariant *reply; -- 2.7.4 From 31bb400a292fc59beeca245fca4d83bb7f15ef67 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Fri, 8 Jun 2018 10:57:36 +0900 Subject: [PATCH 16/16] Fix dbus policy to allow group users in Tzip Change-Id: Ibc76b9c7c1c562286e82974937bdd54204e68bc1 Signed-off-by: Hyotaek Shim --- conf/org.tizen.system.deviced.conf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/org.tizen.system.deviced.conf b/conf/org.tizen.system.deviced.conf index 75ad7f6..1063ff8 100644 --- a/conf/org.tizen.system.deviced.conf +++ b/conf/org.tizen.system.deviced.conf @@ -14,6 +14,10 @@ + + + + -- 2.7.4