platform/core/system/deviced.git
5 years agoAdd information about the relationship between unit dependencies 49/208749/1
INSUN PYO [Fri, 28 Jun 2019 01:47:45 +0000 (10:47 +0900)]
Add information about the relationship between unit dependencies

Change-Id: Ia6f196c854933e5323ef6e7f4011541bd42494c1

5 years agoAdd protection code to prevent crash 49/208649/1 accepted/tizen/unified/20190627.115203 submit/tizen/20190627.050132
lokilee73 [Thu, 27 Jun 2019 04:48:23 +0000 (13:48 +0900)]
Add protection code to prevent crash

If there are not HAL for display_dev->get_state, crash occurs.
So, add protection code for it.

Change-Id: Ibe14f9dfa049dfbe3fd7f7cac1ad4b0cfc608ecf
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix build warning 04/208504/2
INSUN PYO [Tue, 25 Jun 2019 08:35:00 +0000 (17:35 +0900)]
Fix build warning

Change-Id: Ieb07f2399a87bba41c1f519791cb7172aa8f7764

5 years agoAdd display(dpms) reply handling and retry 76/208476/7 accepted/tizen/unified/20190625.222159 submit/tizen/20190625.083700
Hyotaek Shim [Tue, 25 Jun 2019 02:51:39 +0000 (11:51 +0900)]
Add display(dpms) reply handling and retry

Change-Id: I2a1c8dd3646c6b215b1c95c3fb53e5cf07561136
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoChange dpms_get_state to use HAL for lcd get state 02/208502/2
lokilee73 [Tue, 25 Jun 2019 08:11:24 +0000 (17:11 +0900)]
Change dpms_get_state to use HAL for lcd get state

Change-Id: I465f01f4e8b2f4119fc8b2828ea2a909305d4bd2
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoAdd battery_health_changed to keep dim in case of bad battery health 22/207222/3 accepted/tizen/unified/20190625.051522 submit/tizen/20190624.124304
lokilee73 [Thu, 30 May 2019 12:13:52 +0000 (21:13 +0900)]
Add battery_health_changed to keep dim in case of bad battery health

LCD dim has to be kept for bad battery health like HEALTH_LOW, HEALTH_HIGH, HEALTH_OVP.
Battery_health_changed adds DIMSTAY_FLAG to pm_status_flag.
It protects LCD change from dim to LCD_OFF by request of other applications or daemons.
ex) lockstate, changestate in dbus-send

Change-Id: I544259e07eb36967df11c1d709508651c214f079
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoAdd display_staydim_check for commonly used code 14/208214/3
lokilee73 [Thu, 20 Jun 2019 02:46:34 +0000 (11:46 +0900)]
Add display_staydim_check for commonly used code

Change-Id: Ib3a5f23b2a93f48eafecb9fe5f1f7a43f19f6bf2
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoTemporarily allow org.tizen.system.deviced.Board in dbus policy 15/208015/1
Hyotaek Shim [Mon, 17 Jun 2019 04:33:31 +0000 (13:33 +0900)]
Temporarily allow org.tizen.system.deviced.Board in dbus policy

Change-Id: I5ce697624c93a03bc8ae9af5184ec2456c21ee7a
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoInitialize dpms_connected in disconnect_interface_with_dpms to protect crash 81/207981/1 accepted/tizen/unified/20190618.045939 submit/tizen/20190617.014724
lokilee73 [Fri, 14 Jun 2019 10:35:24 +0000 (19:35 +0900)]
Initialize dpms_connected in disconnect_interface_with_dpms to protect crash

Display can be controlled by devicectl command.
ex) devicectl display stop/start
After disconnect_interface_with_dpms is called by devicectl command,
LCD_ON can be requested via dbus-send.
At this time, dpms related functions and variables are initialized.
So, crash can occur.

Change-Id: I9fdbc0c27e612bbdc9d11309f2a0be6102112d66
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoUpdate battery.health_s in check_health_status 16/207716/2
lokilee73 [Tue, 11 Jun 2019 09:11:14 +0000 (18:11 +0900)]
Update battery.health_s in check_health_status

battery.health_s is not synchronized with battery.health.
So, update battery.health_s in check_health_status to synchronize them.

Change-Id: I779b1c91e202198be62ef858d2fa774a067a2c7d
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agodbus-policy: modified to use default deny - allow signal 96/206796/1 accepted/tizen/unified/20190530.043151 submit/tizen/20190529.021941 submit/tizen/20190529.103108
sanghyeok.oh [Mon, 27 May 2019 06:41:21 +0000 (15:41 +0900)]
dbus-policy: modified to use default deny - allow signal

Change-Id: Ic9eeb5a7df8b35dacad0d2a8488efc249cd12104
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoMove same files in each profile to display folder 35/206635/2
lokilee73 [Wed, 22 May 2019 09:23:29 +0000 (18:23 +0900)]
Move same files in each profile to display folder

Change-Id: I8dac3442da66e23dfb3ce53b925c2af45bb8395d
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange lcd control method from dbus-send to using internal APIs supported by dpms 89/206389/13
lokilee73 [Fri, 17 May 2019 07:55:06 +0000 (16:55 +0900)]
Change lcd control method from dbus-send to using internal APIs supported by dpms

Change-Id: I69e62ebbc8083a40fc383d2c2f36a63d7c975ebe
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix segment fault in control_handler and get_control_handler 33/206133/5
lokilee73 [Tue, 14 May 2019 12:29:07 +0000 (21:29 +0900)]
Fix segment fault in control_handler and get_control_handler

There are segment fault because of argc.
Buffer size of argv is 2 or 3, but it can exceed limitation by argc.
So, change conditions as below.
1. Check conditions and return -EINAL when it's not satisfied
   ex) if argc is 3 in dbus_control_handler
       if argc is 2 in dbus_get_control_handler
2. Remove argc check in control_handler and get_control_handler,
   because it's wrong

Change-Id: I22c4c89d59deeeb5181dd7787ed9ca60ea2af50d
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix signature mis-match in expired_deliver_result 70/206070/5
lokilee73 [Tue, 14 May 2019 05:15:15 +0000 (14:15 +0900)]
Fix signature mis-match in expired_deliver_result

Expected signature is 'i', but returned value is 'si'.
So, fix it.

Change-Id: I9e476983a7bef55dcc94fd8bd1fc83b98563bbcd
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agousbhost: dbus: modified to reply error type message if failed 45/205945/5
sanghyeok.oh [Fri, 10 May 2019 11:39:01 +0000 (20:39 +0900)]
usbhost: dbus: modified to reply error type message if failed

gdbus method handler should reply g_variant with valid signature or error type message.

Change-Id: I7acf504685fd37db343ad756e06b5446f426c264
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoRevert "Fix dbus error by no reply timeout" 22/206022/1
Hyotaek Shim [Mon, 13 May 2019 08:53:01 +0000 (08:53 +0000)]
Revert "Fix dbus error by no reply timeout"

This reverts commit 5d18bc167445fd3f238ff13421963bbd4db393bd.

Change-Id: Ieb797fecd0230dea2d4558dd7ea629fdfded2ccb

5 years agoFix dbus error by no reply timeout 73/205973/1
lokilee73 [Mon, 13 May 2019 02:16:51 +0000 (11:16 +0900)]
Fix dbus error by no reply timeout

There is a dbus error, when dbus_lockTimeoutExpired is called.
So, change it to reply.

Change-Id: Ica0dda733d5b8e8da6fa45cc6328a6a1a2f5cd60
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix invalid return value of dbus 79/205879/1
lokilee73 [Fri, 10 May 2019 05:20:03 +0000 (14:20 +0900)]
Fix invalid return value of dbus

Return value in dbus_locktimeout_expired has to be integer.
So, fix it.

Change-Id: Ie34853948852bca28f87bf0c984c59ea07a86fdd
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoAdd low_bat_old to nofify when low_bat changes 96/205796/1
lokilee73 [Thu, 9 May 2019 08:00:27 +0000 (17:00 +0900)]
Add low_bat_old to nofify when low_bat changes

Currently, DEVICE_NOTIFIER_LOWBAT is notified periodically.
So, add low_bat_old to notify when low_bat is changed.

Change-Id: I70b1730a993f4f1783e20c719970223901b752b4
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange function name 72/205772/2 accepted/tizen/unified/20190510.111102 submit/tizen/20190509.071747
lokilee73 [Thu, 9 May 2019 05:57:01 +0000 (14:57 +0900)]
Change function name

dbus_get_charge_level is used to get vconf value of
VCONFKEY_SYSMAN_BATTERY_STATUS_LOW.
It's not intuitive. So, change it.

Change-Id: Ieb62b6fcd9baabbb7a746782f2146bc397d80432
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoMove vconf setting for capacity from lowbat_process to process_power_supply 50/205750/1
lokilee73 [Thu, 9 May 2019 03:14:29 +0000 (12:14 +0900)]
Move vconf setting for capacity from lowbat_process to process_power_supply

Lowbat_process has to deal with low battery related parameters.
It's better to set capcity related vconf in process_power_supply.

Change-Id: I46d3feb977824e90bc32f74050382637af8b63d6
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoRemove unused function print_lowbat_state 38/205738/1
lokilee73 [Thu, 9 May 2019 02:17:07 +0000 (11:17 +0900)]
Remove unused function print_lowbat_state

Change-Id: I43419bc75a0f3b7d2cc06592dce3fabb0585459b
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoAdd protection code and insert a log for broadcasting same signal and status 63/205663/3
lokilee73 [Wed, 8 May 2019 08:53:51 +0000 (17:53 +0900)]
Add protection code and insert a log for broadcasting same signal and status

Change-Id: I67dd7f9f0660bc432cc3cc193328c46fb1d132e1
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange power_supply_status_init 30/205430/4
lokilee73 [Fri, 3 May 2019 08:28:15 +0000 (17:28 +0900)]
Change power_supply_status_init

Add battery_changed in power_supply_status_init,
because previous code is too complicated.
Battery_changed can replace it.

Change-Id: Id06d3b9d9db391040b5fe176e421e1c322b92aea
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange battery_state to prevent duplicated work 86/205386/2 accepted/tizen/unified/20190503.075109 submit/tizen/20190503.045829
lokilee73 [Fri, 3 May 2019 02:53:45 +0000 (11:53 +0900)]
Change battery_state to prevent duplicated work

Usage of battery_state was to print battery information.
But change it to prevent duplicated work in battery_changed.
Battery related information will be printed in process_power_supply.

Change-Id: I313fd6c2ecad348b7ce228b20592b09ab1f9c09d
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoAdd variable ret for dbus_handle_broadcast_dbus_signal_var 56/205356/2
lokilee73 [Thu, 2 May 2019 11:59:25 +0000 (20:59 +0900)]
Add variable ret for dbus_handle_broadcast_dbus_signal_var

eturned value of dbus_handle_broadcast_dbus_signal_var is integer.
So, add ret to print error log when it fails.

Change-Id: I6bc57894bed68fdeedc92a19a2de9e7b090e6874
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange condition to return and notifying input in health_timer_cb 96/205296/1
lokilee73 [Thu, 2 May 2019 05:18:09 +0000 (14:18 +0900)]
Change condition to return and notifying input in health_timer_cb

1. Change condition to take actions in case of HEALTH_LOW and HEALTH_HIGH
2. Fix a bug to take over battery.health with an input instead of value

Change-Id: Ia491a08e7184b60c788276a51dee0d1aa67aac80
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoUnify ovp_type and temp_type to health_type 40/205140/4 accepted/tizen/unified/20190430.113509 submit/tizen/20190430.075735
lokilee73 [Mon, 29 Apr 2019 11:01:54 +0000 (20:01 +0900)]
Unify ovp_type and temp_type to health_type
and add temperature in battery_status

1. Ovp_type and temp type is a kind of battery health_type.
   So, unify ovp_type and temp_type to health_type
2. Remove temp in battery_status.
   Because it is unified to health_type.
   Instead, add temperature for value in celsius.

Change-Id: Ie595c4154530f7a187de7d25481562689170764e
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoModify check_power_supply_noti to refer to blockmode_wearable only 04/205104/1
lokilee73 [Mon, 29 Apr 2019 06:40:27 +0000 (15:40 +0900)]
Modify check_power_supply_noti to refer to blockmode_wearable only

Below vconf is not used anymore.
ex) memory/shealth/sleep/do_not_disturb
So, change check_power_supply_noti to refer to db/setting/blockmode_wearable only.

Basically, battery full notification policy is different according to profiles.
 - Wearable : refers to vconf value called blockmode_wearable
   ex) db/setting/blockmode_wearable
       if it's true, notification is blocked,
               false, notification is allowed.
 - iot, tv : don't care
 - mobile : not decided yet, so apply default value as tv and iot
We can keep the policy by setting default value of blockmode_wearable to false.
It can be changed via setting menu.
And Setting menu for blockmode_wearable is only available on wearable profile.

Change-Id: I981a31e70cba59ccd544f6fce8a784de601f339d
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix misused function of g_timeout_add_seconds 49/204749/1 accepted/tizen/unified/20190429.103708 submit/tizen/20190426.060759
lokilee73 [Fri, 26 Apr 2019 05:34:05 +0000 (14:34 +0900)]
Fix misused function of g_timeout_add_seconds

Input value of g_timeout_add_seconds() should be integer.
But the input is float in some cases.
So, change g_timeout_add_seconds to g_timeout_add on this cases.

Change-Id: I95b843b46e13c078398f39bac374f7faa5d03917
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoRemove power off related code in lowbat_popup 60/204560/4
lokilee73 [Wed, 24 Apr 2019 09:56:03 +0000 (18:56 +0900)]
Remove power off related code in lowbat_popup

power off by low battery is executed without popup.
So, power off related code in lowbat_popup is useless.

Change-Id: Ia2443aa3ea8e2a3b964286c085234921cb1cd0b4
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoRemove useless scenario 96/204396/4
lokilee73 [Tue, 23 Apr 2019 10:41:09 +0000 (19:41 +0900)]
Remove useless scenario

If current battery percentage is power off level(0),
we don't have to consider other scenario.
ex) realoff -> normal
    realoff -> warning
    realoff -> critical
    realoff -> poweroff
    realoff -> realoff
Because target will execute powering off immediately.

Change-Id: I7e75d16a8b75edbc357a7024981ff72e3cbea8db
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoRemove popup and timer before powering off 53/204353/1 accepted/tizen/unified/20190423.113457 submit/tizen/20190423.082506
lokilee73 [Tue, 23 Apr 2019 08:14:16 +0000 (17:14 +0900)]
Remove popup and timer before powering off

1. Remove popup before powering off
Low and critical popups are shown beforehand according to battery level.
So, to show popup before powering off is duplicated action.

2. Remove poweroff timer
The purpose of power off timer is to have time to show popup before powering off.
But we don't need it any more.
Morever, popup can be shown or not shown by remained battery capacity.
It can confuse users.

Change-Id: I8cc67999cfe7be56e4c882012b4be29800cd4159
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix a bug on conditon of sending an event to libeventsystem 86/204286/1
lokilee73 [Tue, 23 Apr 2019 02:57:16 +0000 (11:57 +0900)]
Fix a bug on conditon of sending an event to libeventsystem

The condition to send EVT_VAL_BATTERY_LEVEL_FULL is wrong,
Because bat_percent cannot exceed 100.
So, change conditon as below.
ex) bat_percent >= 100 && battery.charge_full : EVT_VAL_BATTERY_LEVEL_FULL
    bat_percent >= 100 : EVT_VAL_BATTERY_LEVEL_HIGH

Change-Id: I4aa408811fb4353d4c1f9251045fb056f8bac687
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix unreachable code error on usb-host policy 72/203972/2 accepted/tizen/unified/20190419.110552 submit/tizen/20190419.023113
lokilee73 [Thu, 18 Apr 2019 08:36:37 +0000 (17:36 +0900)]
Fix unreachable code error on usb-host policy

Change-Id: Ia56cf7cbdc9087d38efcaed873ad9e5abadb2afc
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange kmod_module_remove_module with remove_module 18/203918/1
lokilee73 [Thu, 18 Apr 2019 06:13:46 +0000 (15:13 +0900)]
Change kmod_module_remove_module with remove_module

kmod_module_remove_module doesn't remove all modules that have dependency.
So, change it with remove_module to remove all related modules.

Change-Id: I58048977d60159ba04bc2dc2398e776988179019
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix LCDAlwaysOn and powerkey behaviors 79/203579/10
lokilee73 [Tue, 16 Apr 2019 05:18:10 +0000 (14:18 +0900)]
Fix LCDAlwaysOn and powerkey behaviors

Do not affect powerkey behaviors even when LCDAlwaysOn is 'yes' in display.conf.

Mobile
 - LCD on/off by short pressed powerkey
 - Popup by long pressed powerkey
Wearable
 - Menu by short pressed powerkey
 - Popup by long pressed powerkey
TV, Iot
 - Powering off by short or long pressed powerkey

Change-Id: Ic80a31638a65ed8187d83e2e0e66d7d2f78655bd
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoChange load_module function 48/203648/2 accepted/tizen/unified/20190417.050105 submit/tizen/20190417.012939
lokilee73 [Tue, 16 Apr 2019 11:04:05 +0000 (20:04 +0900)]
Change load_module function

usb_f_fs can have dependency according to targets.
So, when it is loaded, we have to consider to load related modules as well.
ex) libcomposite.ko has to be loaded with usb_f_fs in RPI3

Change-Id: I6864de55461bfe5041642fe6787e536e5487889a
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoAdd error logs for vconf_get_int and vconf_set_int 91/203191/3
lokilee73 [Wed, 10 Apr 2019 11:08:13 +0000 (20:08 +0900)]
Add error logs for vconf_get_int and vconf_set_int

Change-Id: I0f3031575659f93a941a1c592bca9a6a9409caac
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange libgdbus library name to libsyscommon. 63/203163/1 accepted/tizen/unified/20190412.124538 submit/tizen/20190410.090025
Yunmi Ha [Wed, 10 Apr 2019 08:27:47 +0000 (17:27 +0900)]
Change libgdbus library name to libsyscommon.

Call common check_system_boot_finished function, instaed of local implement.

Change-Id: Iafec48599499be4263e9e6383e8bdfc21ded0e87
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agoMerge "Fix during_poweroff check" into tizen
Hyotaek Shim [Wed, 10 Apr 2019 01:24:09 +0000 (01:24 +0000)]
Merge "Fix during_poweroff check" into tizen

5 years agoSet VCONFKEY_SYSMAN_POWER_OFF_STATUS once during poweroff/reboot 79/203079/3
Hyotaek Shim [Tue, 9 Apr 2019 11:03:57 +0000 (20:03 +0900)]
Set VCONFKEY_SYSMAN_POWER_OFF_STATUS once during poweroff/reboot

Change-Id: I7f8601f47417b4ffd3e322e3a964b44f709cb94a
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoFix during_poweroff check 81/203081/2
Hyotaek Shim [Tue, 9 Apr 2019 11:16:48 +0000 (20:16 +0900)]
Fix during_poweroff check

Change-Id: Ib65d46406d032d6aac15ff4702910911c723c6a6
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoFix poweroff/reboot sequence 26/203026/5
Hyotaek Shim [Tue, 9 Apr 2019 05:54:21 +0000 (14:54 +0900)]
Fix poweroff/reboot sequence

Change-Id: I493f59b5a4c33a679aa2f4b8d88d8cbe764498be
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoAdd image effect for display 66/202866/5 accepted/tizen/unified/20190410.002230 submit/tizen/20190409.053926
lokilee73 [Fri, 5 Apr 2019 08:22:17 +0000 (17:22 +0900)]
Add image effect for display

Change-Id: I9de4dec681193b93b18e5d98289dd5ab35a25837
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoAdd dbus path and interface for Coreapps 35/202635/2 accepted/tizen/unified/20190402.144729 submit/tizen/20190402.054126
lokilee73 [Tue, 2 Apr 2019 05:24:47 +0000 (14:24 +0900)]
Add dbus path and interface for Coreapps

Change-Id: I9ca144e84bb2024a30c7fb41a5daa541edfb971a
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoAdd a new function to control touchscreen while swimming 03/202603/2
lokilee73 [Mon, 1 Apr 2019 10:49:17 +0000 (19:49 +0900)]
Add a new function to control touchscreen while swimming

Change-Id: I3e4426cbec7e0b9b5ee6c57a204a22be6499148a
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoRename booting_finished() to check_booting_finished() 63/202463/1
Hyotaek Shim [Fri, 29 Mar 2019 01:32:36 +0000 (10:32 +0900)]
Rename booting_finished() to check_booting_finished()

Change-Id: If101de088b807c042db8442bf707512192af17ba
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoRename systemd_stop_unit_sync() to systemd_stop_unit_wait_stopped() 68/202168/1 accepted/tizen/unified/20190326.024552 submit/tizen/20190325.102033
Hyotaek Shim [Mon, 25 Mar 2019 10:14:52 +0000 (19:14 +0900)]
Rename systemd_stop_unit_sync() to systemd_stop_unit_wait_stopped()

Change-Id: I603c83be2e504010da735a9ec428db401fae0d1d
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoRename systemd_start_unit_sync() to systemd_start_unit_wait_started() 91/202091/2 submit/tizen/20190325.092207
Hyotaek Shim [Fri, 22 Mar 2019 11:23:33 +0000 (20:23 +0900)]
Rename systemd_start_unit_sync() to systemd_start_unit_wait_started()

Change-Id: I904b86beb3a4cf34bcb66fae1aec01cf74bef8ac
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoRemove unused #define value(MAX_RETRY) 45/202045/1
Hyotaek Shim [Fri, 22 Mar 2019 06:14:14 +0000 (15:14 +0900)]
Remove unused #define value(MAX_RETRY)

Change-Id: Ib392ec4b59c8096e63cd31212211529202545080
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoRemove dbus method, ChangedCooldownMode for cooldown 39/201739/1 accepted/tizen/unified/20190320.082316 submit/tizen/20190319.073441
lokilee73 [Tue, 19 Mar 2019 06:42:54 +0000 (15:42 +0900)]
Remove dbus method, ChangedCooldownMode for cooldown

Deviced don't have to receive cooldown related signals or dbus methods.
It only supports dbus methods for siop.

Change-Id: Ief92af6776c325fb41b111c117ee45df7b0e4f0e
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoRefactoring: remove unnecessary local variable 50/201450/2
INSUN PYO [Thu, 14 Mar 2019 08:08:43 +0000 (17:08 +0900)]
Refactoring: remove unnecessary local variable

Change-Id: I1d2f9dc7a6ed147e24261c20f2a0b6478820a276

5 years agoReorganize cool-down structure 89/201489/8
lokilee73 [Fri, 15 Mar 2019 01:49:42 +0000 (10:49 +0900)]
Reorganize cool-down structure

Cool-down algorithm is changed as below.
1. Cool-down is changed from broadcasting signal to sending dbus method.
2. Deviced don't have to request pop-ups to system-servant.
   Because SIOP or PASS will do it according to it's own scenarios.

Change-Id: I8cf6c949911533c77620dd38087836b4eaaf36f8
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agocoverity fix 70/201470/3
sanghyeok.oh [Thu, 14 Mar 2019 10:29:07 +0000 (19:29 +0900)]
coverity fix

Change-Id: I20c613f763a46473d0ed3eb4f12bf8d6cc014e98
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoSupport plugin module. 28/200928/4 accepted/tizen/unified/20190312.113024 submit/tizen/20190311.073132 submit/tizen/20190311.073229 submit/tizen/20190311.073252
Yunmi Ha [Wed, 6 Mar 2019 06:06:52 +0000 (15:06 +0900)]
Support plugin module.

Deviced will load "/usr/lib/deviced/*.so".
If someone wants to add their own device,
make plugin with DEVICE_PRIORITY_HIGH and place it in the lib folder.

Change-Id: I58b95b55a4c297c93b4f1e5bb17c9927d8d5d3c4
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agopower: re-enable exit option 71/201171/1 submit/tizen/20190311.062132
sanghyeok.oh [Mon, 11 Mar 2019 05:56:27 +0000 (14:56 +0900)]
power: re-enable exit option

Change-Id: I7aca911ea44c1e896c06d504e888cf1544363afa
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agosvace: power-shutdown: fix leak 01/200901/1 accepted/tizen/unified/20190311.072436 submit/tizen/20190308.023010
sanghyeok.oh [Tue, 5 Mar 2019 12:04:20 +0000 (21:04 +0900)]
svace: power-shutdown: fix leak

Change-Id: Ieadd4f8a25c78775877847a065d811d4d83a5314
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agopower: change to case-sensitive name 93/200893/1 submit/tizen/20190305.120315 submit/tizen/20190306.005724
sanghyeok.oh [Tue, 5 Mar 2019 11:28:42 +0000 (20:28 +0900)]
power: change to case-sensitive name

Change-Id: I98b61040294f367a96674b7b02e2bf68fb8cc115
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agopower: remove duplicated dbus methods 72/200572/6 submit/tizen/20190305.100545
sanghyeok.oh [Wed, 27 Feb 2019 02:31:45 +0000 (11:31 +0900)]
power: remove duplicated dbus methods

Change-Id: Ib4b1b94559cf702a1f6823414a5379861146cb8e
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoauto-test: battery: fix bug 63/200663/3
sanghyeok.oh [Wed, 27 Feb 2019 23:16:03 +0000 (08:16 +0900)]
auto-test: battery: fix bug

Change-Id: Iea6d5dd82f705585b0ffd1d4c9f279148fdae287
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoFix build warnings 97/200697/1
lokilee73 [Thu, 28 Feb 2019 10:20:58 +0000 (19:20 +0900)]
Fix build warnings

Change-Id: I99e12cc644daeaf8d3d9debeec8815d1e35a26d7
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix display plugin build 88/200688/1
Hyotaek Shim [Thu, 28 Feb 2019 07:32:56 +0000 (16:32 +0900)]
Fix display plugin build

Change-Id: Ie685d3a9fa2037fae96e2468e21abb039f9edbc1
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoTo give permission to 3rd party 49/200649/1
lokilee73 [Wed, 27 Feb 2019 11:52:55 +0000 (20:52 +0900)]
To give permission to 3rd party

If there is no permission for 3rd party, Dbus request by temperature API can be failed

Change-Id: I48cae55a1331020c4291be4ce683da2abb039246
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agopower: cleanup 67/200567/4
sanghyeok.oh [Wed, 27 Feb 2019 01:03:56 +0000 (10:03 +0900)]
power: cleanup

Change-Id: I10a9f006d08535f9c5d8eba77d3e073733e6c180
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoAdd bezel for wearable target 39/200539/6
lokilee73 [Tue, 26 Feb 2019 08:59:01 +0000 (17:59 +0900)]
Add bezel for wearable target

Change-Id: Iee31a5a0d8b37feb8cd162caadd8ee73fc931968
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoRestore permission of source files. 46/200546/1
Yunmi Ha [Tue, 26 Feb 2019 09:40:07 +0000 (18:40 +0900)]
Restore permission of source files.

Change-Id: I02a1c1324215a0e0d887c3c8434b22607e05e38f
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agoApply consistent log messages. 74/200374/1
Yunmi Ha [Fri, 22 Feb 2019 09:31:58 +0000 (18:31 +0900)]
Apply consistent log messages.

1. First letter to uppercase.
2. Period at the end.
3. Rearrange parameters.

Change-Id: I957a3e820eb713128add0a787270f9c0cc083031
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agoApply consistent log messages. 57/200357/1
Yunmi Ha [Fri, 22 Feb 2019 06:21:39 +0000 (15:21 +0900)]
Apply consistent log messages.

1. First letter to uppercase.
2. Period at the end.
3. Rearrange parameters.

Change-Id: Ic28e18d4f09a2b3a89517db25498c7b8c191a61f
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agoApply consistent log messages. 98/200298/1
Yunmi Ha [Thu, 21 Feb 2019 08:13:50 +0000 (17:13 +0900)]
Apply consistent log messages.

1. First letter to uppercase.
2. Period at the end.
3. Rearrange parameters.

Change-Id: I187a357a5b7670dd62e5e1d84883e0df75b4063a
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agoApply consistent log messages. 09/200209/1
Yunmi Ha [Wed, 20 Feb 2019 05:51:07 +0000 (14:51 +0900)]
Apply consistent log messages.

1. First letter to uppercase.
2. Period at the end.
3. Rearrange parameters.

Change-Id: I8d037b3c7001ad9a41262a30f47cdf05332949d1
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
5 years agocoverity: fix SIGSEGV warning 94/200194/1 accepted/tizen/unified/20190221.165759 submit/tizen/20190220.055111 submit/tizen/20190220.073046
sanghyeok.oh [Wed, 20 Feb 2019 02:35:27 +0000 (11:35 +0900)]
coverity: fix SIGSEGV warning

Change-Id: I401b65eda545123127659fe557565827c4369482
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoshutdown: Ensure messages are printed as fast as possible 56/200056/2
Karol Lewandowski [Mon, 18 Feb 2019 12:18:20 +0000 (13:18 +0100)]
shutdown: Ensure messages are printed as fast as possible

Change-Id: I568816d81b357592f279638404292b7c299e10f9

5 years agopower: Introduce 'exit' reboot option 29/199929/3
Karol Lewandowski [Fri, 15 Feb 2019 15:27:07 +0000 (16:27 +0100)]
power: Introduce 'exit' reboot option

This option will cause system to perform complete shutdown
without final 'reboot' syscall.  Such feature was requested
by test team.

Test by calling:

  dbus-send --system --print-reply --dest=org.tizen.system.deviced --type=method_call /Org/Tizen/System/DeviceD/Reboot org.tizen.system.deviced.reboot.reboot string:exit int32:0

The system will execute shutdown sequence but most processes
will remain running (eg. when tested on odroid, the shell from
which command was invoked was not terminated).

To confirm it works see thatt PID1 binary is replaced by systemd-shutdown:

root@localhost:~# ps auxww
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  8.3  0.1   3828  2164 ?        Ss   00:37   0:06 /usr/lib/systemd/systemd-shutdown exit --log-level 6 --log-target kmsg --log-color --exit-code 0

Change-Id: I91112c535c80713f2d35081edeaa7c0e1d772c3b

5 years agopower: Remove erronous DIRECT poweroff type 28/199928/2
Karol Lewandowski [Thu, 14 Feb 2019 15:47:00 +0000 (16:47 +0100)]
power: Remove erronous DIRECT poweroff type

Commit 51849e1cad ("power: Rework handling of repeated poweroff/reboot
request") mistakenly introduced POWEROFF type.  Before that commit
"DIRECT" type was used to mean POWEROFF.

This commit reverts to original behaviour, dropping DIRECT type
for all new uses but retains constant for compatiblity.

Change-Id: I4ddd5fa7fe45dd54bd9a597ed36b989b93a2f3f8

5 years agoAdd dbus_get_temperature for method, GetTemperature 55/196355/3 accepted/tizen/unified/20190219.154139 submit/tizen/20190218.105211
lokilee73 [Thu, 27 Dec 2018 11:42:01 +0000 (20:42 +0900)]
Add dbus_get_temperature for method, GetTemperature

Change-Id: I732241d0d3c57deba03e0beaf6caf949ddf7009f
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agodbus: systemd: change api - start/stop systemd unit 35/197635/8 accepted/tizen/unified/20190211.060141 submit/tizen/20190208.064159 submit/tizen/20190208.083757
sanghyeok.oh [Mon, 14 Jan 2019 23:35:12 +0000 (08:35 +0900)]
dbus: systemd: change api - start/stop systemd unit

move systemd related dbus api to libgdbus(libsyscommon)

Change-Id: I6ae0c125dc5293fbc38df7ca3a0ba7cde12a8f38
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoApply device_notify_once() 57/199257/2
Hyotaek Shim [Fri, 8 Feb 2019 02:02:25 +0000 (11:02 +0900)]
Apply device_notify_once()

Change-Id: Ic56422e699bd3b1bae9174d31b271c40c7c5e907
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoRevert "Do not unnecessarily check booting-done" 55/199255/2
Hyotaek Shim [Fri, 8 Feb 2019 01:55:58 +0000 (01:55 +0000)]
Revert "Do not unnecessarily check booting-done"

This reverts commit 53256c665e90251b688e277d6ea8673476d317cf.

Change-Id: Ic9ddcec6a9b7a2e7832901d296e3eb6d4a9b99d3

5 years agoAdd notifier_device_ops for late or no booting done signal 24/199224/4 accepted/tizen/unified/20190208.061643 submit/tizen/20190207.112658
lokilee73 [Thu, 7 Feb 2019 09:51:25 +0000 (18:51 +0900)]
Add notifier_device_ops for late or no booting done signal

Systemd can't confirm booting done signal in valid time.
So, add notifier_device_ops to broadcast booting done siganl after 30 seconds,
if there is no booting done signal in it.

Change-Id: I535f8a848239b75fcd8e92f1ff13cd8ce895868a
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoDo not unnecessarily check booting-done 22/199222/1
Hyotaek Shim [Thu, 7 Feb 2019 09:40:59 +0000 (18:40 +0900)]
Do not unnecessarily check booting-done

Change-Id: I5680777ac0b907a6a8e394d1659e0e5b48d1192f
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoAdd device_notify_once() to avoid multiple invocation 16/199216/3
Hyotaek Shim [Thu, 7 Feb 2019 09:18:15 +0000 (18:18 +0900)]
Add device_notify_once() to avoid multiple invocation

Change-Id: I355dbe2d937e5ebdc5ffa8c59228763900e34568
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoFix deviced-shutdown installation 67/199067/1 submit/tizen/20190207.012533
Hyotaek Shim [Fri, 1 Feb 2019 08:32:24 +0000 (17:32 +0900)]
Fix deviced-shutdown installation

The location should be /usr/lib/systemd/deviced-shutdown (for both 32-bit and 64-bit build)

Change-Id: Ic31de51f4b2f848d2602f1dbc42d34283cc0f624
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoPlugin Architecture - for device module adaptation 64/199064/1
Hyotaek Shim [Fri, 1 Feb 2019 08:13:56 +0000 (17:13 +0900)]
Plugin Architecture - for device module adaptation

Change-Id: I5aef481d44b13c9cd3f8529cc04596d56a683f1c
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoAdd dump module to get debug infomation for devices 46/199046/2
lokilee73 [Fri, 1 Feb 2019 04:54:32 +0000 (13:54 +0900)]
Add dump module to get debug infomation for devices

When dump signal is received, dump logs are saved under /var/log/deviced.log

Change-Id: Idde9ce3bb02430e5373dbd953134e8e4acf46616
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoCoverity: 'handle' going out of scope 34/199034/1
Hyotaek Shim [Fri, 1 Feb 2019 02:15:50 +0000 (11:15 +0900)]
Coverity: 'handle' going out of scope

Change-Id: Ib055cb0f12fd23d6c9750ef977b76c3d166203f8
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoRemove unused edbus-handler 82/198982/1
Hyotaek Shim [Thu, 31 Jan 2019 11:21:30 +0000 (20:21 +0900)]
Remove unused edbus-handler

Change-Id: I5a95dc4c181ca2c22793264f98198340cd0cfb40
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoFix 64-bit build errors, /lib64/systemd/ 48/198948/1 accepted/tizen/unified/20190201.061331 submit/tizen/20190131.080207
Hyotaek Shim [Thu, 31 Jan 2019 08:01:24 +0000 (17:01 +0900)]
Fix 64-bit build errors, /lib64/systemd/

Change-Id: I7170c14e46cdd8ccbbcfcede18232bb10a62c8e9
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoVersion 5.5.0 06/198906/1
Hyotaek Shim [Thu, 31 Jan 2019 02:58:47 +0000 (11:58 +0900)]
Version 5.5.0

Change-Id: I5bfa2097c864342fccd20c0660524a0c35ac5580
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agopower: Add deviced-shutdown 24/197324/11 submit/tizen/20190131.021840
Karol Lewandowski [Thu, 10 Jan 2019 00:17:22 +0000 (00:17 +0000)]
power: Add deviced-shutdown

This commit provides special binary that is going to handle
Tizen system shutdown.

This utility is called by systemd, not deviced.

The final shutdown scheme is going to look like following:

 1. deviced receivies request to shutdown/reboot the system,

    - preparation is performed (send signals, etc)

    - operation start is marked in /run/

    - hardcoded actions are started

    - depending on shutdown type following is performed:
      + direct shutdown: system is rebooted immidietly (end of flow)
      + other: dbus request to systemd is sent

 2. systemd receives the "poweroff" request

    - supported requests are Reboot, PowerOff & Halt

    - systemd (pid1) replaces it's own process with shutdown binary
      (execve("/usr/lib/systemd/systemd-shutdown"))

    - shutdown binary is provided by deviced package by alternatives
      mechanism

# ls -l systemd-shutdown
systemd-shutdown -> /etc/alternatives/systemd-shutdown
# ls -l /etc/alternatives/systemd-shutdown
/etc/alternatives/systemd-shutdown -> /usr/lib/systemd/deviced-shutdown

      (alternatives allow both systemd and deviced to "provide" same
       binary, with deviced having higher priority being selected as
       the one to use)

 3. /usr/lib/systemd/systemd-shutdown becomes pid1

    - original systemd1 manager is no longer available, meaning no restart,
      watchdog, socket/path/etc activation is handled.

    - depending on systemd-provided params it performs reboot or poweroff

Change-Id: I46b4d0f375a1a6e7fc3e1d74b0530d7ec73ccb12
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agopower: Rework handling of repeated poweroff/reboot request 23/197323/8
Karol Lewandowski [Thu, 10 Jan 2019 00:11:44 +0000 (00:11 +0000)]
power: Rework handling of repeated poweroff/reboot request

This commit generalizes "repeated poweroff/reboot" code path
to use same state variables as dbus requests (poweroff_opt var).

Additionally, multiple constructs are simplified.

Change-Id: I989c7fdbf021da0d69d9062507a05fd8692846a5
Signed-off-by: Paweł Szewczyk <p.szewczyk@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
5 years agoRemove extcon_count.c and extcon_count.h 09/198809/5
lokilee73 [Wed, 30 Jan 2019 02:16:26 +0000 (11:16 +0900)]
Remove extcon_count.c and extcon_count.h

Because they have dependency with products

Change-Id: I1fe49f9b0089f85ad09d4d7c21e5c609195be7eb
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoChange the way to make display.conf 41/198041/1 submit/tizen/20190118.054503
lokilee73 [Fri, 18 Jan 2019 02:47:46 +0000 (11:47 +0900)]
Change the way to make display.conf

To make display.conf by using 'cat' can add duplicated contents in it.
So, change the way by file replacement

Change-Id: I69215787e89012ac8183899cea16b4215c73d65b
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix integer overflow in extcon_count.c 56/197956/2 accepted/tizen/unified/20190118.055736 submit/tizen/20190117.103942
lokilee73 [Thu, 17 Jan 2019 09:02:44 +0000 (18:02 +0900)]
Fix integer overflow in extcon_count.c

Change-Id: I83ac1617238aa664f1c5c6d1cff0c6945f5b1940
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoApply conf file and change thermal structure 67/197367/8
lokilee73 [Thu, 10 Jan 2019 12:08:51 +0000 (21:08 +0900)]
Apply conf file and change thermal structure

Firstly, thermal value depends on hardware.
So, we have to apply different temp table for each targets.

Secondly, change the name on temp table as products.
ex) Critical -> Limt
    Danger -> Shutdown

Lastly, change condition in thermal_get_temp_enum

Change-Id: If25be071e000dfaa1d5e68d205538cd2332d1d9b
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agodbus: modify to use send with reply 22/197022/1 accepted/tizen/unified/20190114.060204 submit/tizen/20190114.010204
lokilee73 [Wed, 9 Jan 2019 02:22:49 +0000 (11:22 +0900)]
dbus: modify to use send with reply

change dbus function to fix errors in media and battery

Change-Id: I4d91ad3419dab43c74d72fd58d767c5fdbe91d21
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agosensitivity: merge sensitivity 73/196673/2 accepted/tizen/unified/20190108.062317 submit/tizen/20190107.023946 submit/tizen/20190107.113744
sanghyeok.oh [Thu, 3 Jan 2019 10:23:51 +0000 (19:23 +0900)]
sensitivity: merge sensitivity

Change-Id: I3a6e0336d699f9a006cbe47fa920603e33d2d956
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
5 years agoRemove executable flag from non-executable files 64/196264/2 accepted/tizen/unified/20181231.125000 submit/tizen/20181227.070601 submit/tizen/20181231.010834 submit/tizen/20181231.070821
lokilee73 [Thu, 27 Dec 2018 01:42:47 +0000 (10:42 +0900)]
Remove executable flag from non-executable files

Change-Id: I6b848799d6a5f568350becac14c3d85c10b6b3e9
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
5 years agoFix build error 46/196246/1 accepted/tizen/unified/20181227.062046 submit/tizen/20181226.112600
lokilee73 [Wed, 26 Dec 2018 11:21:24 +0000 (20:21 +0900)]
Fix build error

Change-Id: I8de7b15bdc3b921e2bb8e09e60e7a128deb3d198
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>