platform/core/system/deviced.git
3 years agoRework reboot/shutdown/poweroff/halt command 00/258400/2
Karol Lewandowski [Mon, 10 May 2021 13:44:22 +0000 (15:44 +0200)]
Rework reboot/shutdown/poweroff/halt command

The provided utilities did not support all cases in which reboot and similar
utilities needs to support, ie.
 - running when dbus service is not running (eg. in upgrade target)
 - being invoked from vip handler when system must reboot immediately

This commit drops deviced custom tools - systemd native tools should be used
instead.

To ensure deviced is used during shutdown following is added:

 - deviced-request-shutdown utility and related service files

   These are installed as dependencies of systemd-standard shutdown
   procedure, causing these to be pulled automatically.

   Separate utility is added as, eg. dbus-send might not be available on
   production images.

 - /run/systemd/reboot-param handling is added

   This file is written by standard systemd reboot tool, so we need to both
   + read this file for reboot param in deviced-shutdown (needed if deviced was not used during shutdown)
   + read this file for deviced PowerOff argument (needed for normal operation)

Change-Id: Ic013e6fa1f4848a17abc025cf99cffeea9916542

3 years agocommon: Make sys_{read,write}_buf public 99/258399/1
Karol Lewandowski [Fri, 14 May 2021 14:15:18 +0000 (16:15 +0200)]
common: Make sys_{read,write}_buf public

In addition to making functions public (non-static) this commit
makes them return amount of bytes written, not 0, in case of
success.

This change is needed by next patch in the series.

Change-Id: I558d13b44999b892bfd6d42ee9e057ee8f4b5d27

3 years agoDelete unused code 31/257831/1
Youngjae Cho [Tue, 4 May 2021 01:30:29 +0000 (10:30 +0900)]
Delete unused code

Change-Id: I5f447ad74320615b40e3b8fd0a95ede0b76053ac
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years ago[ACR-1626] Add usb.host privilege 12/255612/3 accepted/tizen/unified/20210502.124133 submit/tizen/20210430.040132
Hyotaek Shim [Fri, 19 Mar 2021 10:53:21 +0000 (19:53 +0900)]
[ACR-1626] Add usb.host privilege

Check http://tizen.org/privilege/usb.host for org.tizen.system.deviced.Usbhost

Change-Id: I0d97448ebd8907316157feb376eeafd71dd1d0bd
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoChange dbus function name 58/255558/5 accepted/tizen/unified/20210321.225735 submit/tizen/20210319.090004
Hyotaek Shim [Fri, 19 Mar 2021 07:51:32 +0000 (16:51 +0900)]
Change dbus function name

Change-Id: Id55622fd2a822f38328038a9e65cf0fe83960f50
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoImprove variable naming style 85/255185/3 accepted/tizen/unified/20210317.115956 submit/tizen/20210315.085912
taemin.yeom [Mon, 15 Mar 2021 05:09:50 +0000 (14:09 +0900)]
Improve variable naming style

Change-Id: I9453e7a28fb47e08bc6795c4a99cc2adfc7fc5c0
Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
3 years agoApply libsyscommon gdbus api improvement on error handling 18/254618/6 accepted/tizen/unified/20210310.144959 submit/tizen/20210309.090957
taemin.yeom [Fri, 5 Mar 2021 09:31:25 +0000 (18:31 +0900)]
Apply libsyscommon gdbus api improvement on error handling

Change-Id: I2d6eb4e2ada9b15aa058c8691ff4cc576cd19738
Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
3 years agoDo not call hal_device_led_put_backend() 43/254243/2 accepted/tizen/unified/20210225.130511 submit/tizen/20210225.041819
Hyotaek Shim [Thu, 25 Feb 2021 03:53:32 +0000 (12:53 +0900)]
Do not call hal_device_led_put_backend()

Deviced does not repeat loading/unloading plugin modules during runtime.
So, dlopen() is not required, and rather it will cause race condition during exit.

Change-Id: Ice5a4bbdda8afb38e7631d025f682fbc2f85d8fb
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoCheck display feature for iot headless 45/253745/5 accepted/tizen/unified/20210219.041151 submit/tizen/20210218.015647
lokilee73 [Wed, 17 Feb 2021 07:28:21 +0000 (16:28 +0900)]
Check display feature for iot headless

Change-Id: Ib63e628eaf1df39d2bd1a44f36385f22e1a30ff1
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoUse mtp-responder-dummy.socket when there is no mtp-responser.socket 30/253730/1 submit/tizen/20210217.045951 submit/tizen/20210217.051359
INSUN PYO [Wed, 17 Feb 2021 04:36:40 +0000 (13:36 +0900)]
Use mtp-responder-dummy.socket when there is no mtp-responser.socket

The mtp-responder.socket is special in the configfs environment.
If mtp-responder.socket is missing, gadget configuration will fail.
As a result, all usb operations do not work properly.
So in environments that mtp doesn't support, use dummy mtp.

Applied target : RPI TV, RPI headless(32/64)

Change-Id: Ie945b8ecc40ea669c8d2ca7a703e52721775a5a6

3 years agoFix svace 19/253319/1 accepted/tizen/unified/20210210.052227 submit/tizen/20210209.074903
lokilee73 [Tue, 9 Feb 2021 01:06:05 +0000 (10:06 +0900)]
Fix svace

Change-Id: I1dd3b6f4258a13a0bba0109cc018a7d8e5602965
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoUse libsyscommon for ini-parser 95/253195/2
lokilee73 [Fri, 5 Feb 2021 09:56:21 +0000 (18:56 +0900)]
Use libsyscommon for ini-parser

Change-Id: I77f3d1f6cefda2f883e88adbe2895492b95a1fad
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoChange dbus method name for pass SetScenario 44/253144/2 accepted/tizen/unified/20210208.061722 submit/tizen/20210205.011235
lokilee73 [Fri, 5 Feb 2021 01:05:05 +0000 (10:05 +0900)]
Change dbus method name for pass SetScenario

Change-Id: I68a8762f7ba9b947cd77b672c73d306233cfa8f1
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agopmqos: apply next HAL architecture (hal api + backend) 38/252938/17
lokilee73 [Wed, 3 Feb 2021 07:37:18 +0000 (16:37 +0900)]
pmqos: apply next HAL architecture (hal api + backend)

Change-Id: I67a2715d99493d40575d2e9b6428feabb9cc94e3
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoIr : Apply next HAL architecture (hal api + backend) 33/252633/2
lokilee73 [Mon, 1 Feb 2021 04:14:18 +0000 (13:14 +0900)]
Ir : Apply next HAL architecture (hal api + backend)

Change-Id: I92f488f273a1afdf8696c86c312c0a3a3edf6dcc
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoApply next HAL architecture (hal api + backend) 35/251235/14 accepted/tizen/unified/20210129.002257 submit/tizen/20210126.055732 submit/tizen/20210126.064541 submit/tizen/20210126.081759 submit/tizen/20210127.032903
lokilee73 [Tue, 12 Jan 2021 00:54:42 +0000 (09:54 +0900)]
Apply next HAL architecture (hal api + backend)

Change-Id: I0d11e7e89a83846bbb7ab93b17cd3dc066e911e3
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoUse list of libsyscommon 75/250975/5 accepted/tizen/unified/20210111.125504 submit/tizen/20210108.041937
Youngjae Cho [Wed, 6 Jan 2021 08:14:04 +0000 (17:14 +0900)]
Use list of libsyscommon

Change-Id: Icf0ebaa385aa4e0f99bb8c17ffc872b946dbe8c9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoApply screen timeout for iot 39/251039/1 submit/tizen/20210107.071250
Youngjae Cho [Thu, 7 Jan 2021 05:37:39 +0000 (14:37 +0900)]
Apply screen timeout for iot

Change-Id: I6e3597d513616d3d269f6c1a96fe18571fb7e201
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoRemove touch key/led 28/250128/5
lokilee73 [Mon, 21 Dec 2020 05:38:17 +0000 (14:38 +0900)]
Remove touch key/led

Touch key/led is not supported on wearable target.

Change-Id: I521c0e5cdc77a1c29d95dbd1bd339b7a8a17ca96
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoRemove unnecessary dependency 20/250120/4 accepted/tizen/unified/20201222.122549 submit/tizen/20201222.010528
lokilee73 [Mon, 21 Dec 2020 04:07:04 +0000 (13:07 +0900)]
Remove unnecessary dependency

The xattr syscalls are provided by glibc since ages.
So, there is no need to have dependency with libattr-devel

Change-Id: Id2eaf0db2859b48c09e81f87427622f472cc02ad
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoFix build error 02/250102/1 accepted/tizen/unified/20201221.021419 submit/tizen/20201221.014333
lokilee73 [Mon, 21 Dec 2020 01:33:14 +0000 (10:33 +0900)]
Fix build error

[  220s] /home/abuild/rpmbuild/BUILD/deviced-10.0.0/src/tzip/tzip.c:35:10: fatal error: attr/xattr.h: No such file or directory
[  220s]    35 | #include <attr/xattr.h>

Change-Id: I2d753bcedb29f252e8789de0a8203bbdd72592fd
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoAdd null checking code after add_node 80/249680/1
lokilee73 [Wed, 16 Dec 2020 06:39:24 +0000 (15:39 +0900)]
Add null checking code after add_node

Change-Id: Ia8a18630551d988e01a90e3158ba4d42b183b4f9
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoRemove duplicated function call in default_trans 26/249626/3
lokilee73 [Tue, 15 Dec 2020 11:16:43 +0000 (20:16 +0900)]
Remove duplicated function call in default_trans

check_processes is already called via default_check.
ex) default_check -> makeup_trans_condition -> check_processes

Change-Id: Ie867584ce8c3571fbd2c424ea1a715201864d8ad
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoFix typo 79/249579/2
lokilee73 [Tue, 15 Dec 2020 06:34:39 +0000 (15:34 +0900)]
Fix typo

Change-Id: I989aa70be85a684d789b042817871b786712d83e
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoRearrange device_notify(DEVICE_NOTIFIER_LCD_OFF, ..) 76/249376/8 accepted/tizen/unified/20201215.123249 submit/tizen/20201215.060550
Hyotaek Shim [Fri, 11 Dec 2020 01:06:33 +0000 (10:06 +0900)]
Rearrange device_notify(DEVICE_NOTIFIER_LCD_OFF, ..)

And remove ambient_set_state() for other profiles except wearable

device_notify(LCD_OFF) is triggered after ambient_set and LCD_OFF_PRE.

Change-Id: I04c4608334a9627b0804f796056aa84dba5b567e
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoCheck state trans condition strictly when lock expired 70/249570/2
Youngjae Cho [Tue, 15 Dec 2020 05:52:48 +0000 (14:52 +0900)]
Check state trans condition strictly when lock expired

Change-Id: I9090937aeaa31817228127d199b710871c166585
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoFix infinite recursive call for AOD corner case 62/249562/1
Youngjae Cho [Mon, 14 Dec 2020 06:31:59 +0000 (15:31 +0900)]
Fix infinite recursive call for AOD corner case

 The subroutine triggered by lcd_off_procedure() could lead infinite
recursive call. This can happen when the lcd_off_procedure() do not
serve actual DPMS_OFF, remaining display state as DPMS_ON even after
the call.
One of the case is when the clockend signal arrives late. In this
situation, deviced forces to set ambient_state as false, but actual node
of lcd power remains ON. This combination of two state* makes deviced
perceive dpms state as DPMS_ON. As a result, lcd_off_procedure() has
been processed, but deviced still recognize dpms state as DPMS_ON,
triggering recursive call for lcd_off_procedure() to turning off display.
 [*] ambient_state=>false && lcd node=>ON

Possible callstack of recursive call
 del_state_cond
 -> default_trans
 -> default_action
 -> lcd_off_procedure**
 -> ambient_set_state(true)
 -> pm_lock_internal
 -> proc_condition
 -> proc_condition_lock
 -> proc_change_state
 -> lcd_off_procedure [repeat **]

To fix this, leave ambient_state as it is when clockend arrival is
delayed. This makes deviced perceive DPMS state as DPMS_OFF, and it
won't trigger lcd_off_procedure().

Change-Id: I14ccca1ba7718975752389cd409a775fbfe80ada
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
3 years agoFix typo 84/248984/5
lokilee73 [Fri, 4 Dec 2020 05:53:46 +0000 (14:53 +0900)]
Fix typo

Change-Id: I16ff0cf0d03650cdfc909906c9b3e7f959dd6f03
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agoRemove unused function low-power 22/248922/4 accepted/tizen/unified/20201207.123250 submit/tizen/20201204.013436
lokilee73 [Thu, 3 Dec 2020 08:00:46 +0000 (17:00 +0900)]
Remove unused function low-power

low-power.c is not used and duplicated with powersaver.c

Change-Id: I8e93891c41d83710d26e6d4ecbc2c9a5a77bc7bd
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
3 years agousb: change usb initialization - skip usb hal operation when usb is disconnected. 20/248520/5 accepted/tizen/unified/20201202.124927 submit/tizen/20201201.235753
INSUN PYO [Fri, 27 Nov 2020 10:06:00 +0000 (19:06 +0900)]
usb: change usb initialization - skip usb hal operation when usb is disconnected.

If USB is initialized without a USB connection, only initialize the internal usb state and skip usb hal operation.

To support sdb over BT, sdbd.service should start automatically at boot time.
If usb cable is not connected, usb hal stops sdbd.service when initializing usb.

Change-Id: I936d0a62b5d3a0e8229ff02760e1a6d23081a003

3 years agoMake critical-log configurable 24/248224/1 accepted/tizen/unified/20201125.124017 submit/tizen/20201125.031144
Youngjae Cho [Tue, 24 Nov 2020 04:59:59 +0000 (13:59 +0900)]
Make critical-log configurable

Change-Id: I67eb3788a78f5ce02dacb85f8c3398d5f54fd947
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoManage application state: foreground, background, terminated 94/247394/14
Youngjae Cho [Tue, 10 Nov 2020 09:22:45 +0000 (18:22 +0900)]
Manage application state: foreground, background, terminated

Foreground / Background
  An application's lock is managed more strictly from the point when the
  application requires it. Now determine the memeber variable 'background'
  of PmLockNode based on the application's fg/bg state when adding lock
  as a new PmLockNode.

Terminated
  When an application is terminated without releasing lock, deviced unlocks
  it right away. At the same time, deviced decides whether to change state
  or not. At before, for this situation, it was responsible
  for pmlock_check() to release lingering lock of terminated application.

Change-Id: I70e66b69a5f3cdbfa54a2deb2e53ddf15d5456e1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoAdd bitmap functions 42/247242/12
Youngjae Cho [Mon, 9 Nov 2020 06:48:21 +0000 (15:48 +0900)]
Add bitmap functions

Change-Id: I8c39533fa77e6830881062b525b72eec3386342e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoMerge "power: Print warning when `exit' is requested" into tizen accepted/tizen/unified/20201106.130142 submit/tizen/20201103.015640 submit/tizen/20201104.011652
Hyotaek Shim [Tue, 3 Nov 2020 01:15:46 +0000 (01:15 +0000)]
Merge "power: Print warning when `exit' is requested" into tizen

4 years agopower: Print warning when `exit' is requested 15/246115/3
Karol Lewandowski [Fri, 23 Oct 2020 11:08:28 +0000 (13:08 +0200)]
power: Print warning when `exit' is requested

Change-Id: If73feb43cc7c4322fc8aa9d53c8397e2d76ca3d3

4 years agopackaging: Align alternatives setup with fedora-recommended scheme 93/246193/2
Karol Lewandowski [Mon, 26 Oct 2020 14:33:52 +0000 (15:33 +0100)]
packaging: Align alternatives setup with fedora-recommended scheme

Change-Id: I707e0a565322a97c23ce19ec3f5e9dd6aa7b5e8a

4 years agoMerge "Implement shutdown et al. using deviced DBus interface" into tizen
Michal Bloch [Mon, 2 Nov 2020 14:21:26 +0000 (14:21 +0000)]
Merge "Implement shutdown et al. using deviced DBus interface" into tizen

4 years agoImplement shutdown et al. using deviced DBus interface 81/244681/16
Mateusz Majewski [Thu, 17 Sep 2020 11:24:07 +0000 (13:24 +0200)]
Implement shutdown et al. using deviced DBus interface

Change-Id: Idf7cd364bedf7dfcd7024ece67b360745343b984
Co-authored-by: Michal Bloch <m.bloch@samsung.com>
4 years agoFix wrong condition for halt 34/246434/4
lokilee73 [Thu, 29 Oct 2020 08:24:40 +0000 (17:24 +0900)]
Fix wrong condition for halt

halt and poweroff are different command.
exit is the same as halt.
So, change condition.

Change-Id: I837260224d8fe10907f89f435774c8c7d4e46758
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoRearrange PWROFF_FLAG flag setting 26/246226/2
Youngjae Cho [Tue, 27 Oct 2020 06:05:03 +0000 (15:05 +0900)]
Rearrange PWROFF_FLAG flag setting

Set PWROFF_FLAG when the poweroff enters POWEROFF_TRIGGERED stage.

Change-Id: I4129f654792e6ad090774cbc46e0f5a64692e64a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd comments for DEVICE_NOTIFIER_POWEROFF 06/246206/2
lokilee73 [Tue, 27 Oct 2020 02:29:56 +0000 (11:29 +0900)]
Add comments for DEVICE_NOTIFIER_POWEROFF

Change-Id: If4f2dbcbc66a6579612016b16207339bfe14a37b
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoFix restart option to on-failure 56/246156/2
Youngjae Cho [Mon, 26 Oct 2020 06:10:10 +0000 (15:10 +0900)]
Fix restart option to on-failure

This prevents restarting deviced when the deviced is returning main()
through poweroff sequence.

Change-Id: Icbb4a8c306721a1613c04d41060fbbd323c5e62b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoSkip running animation if option is silent 04/245704/1
lokilee73 [Tue, 13 Oct 2020 07:02:06 +0000 (16:02 +0900)]
Skip running animation if option is silent

Change-Id: Iaccd10955d02a129ad352b0a13192ed47042ffa9
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
(cherry picked from commit ca9d81149e324e49efc033810b25ce787f7c4c00)

4 years agoUse definitions of libsyscommon instead of device api 04/244004/4
Youngjae Cho [Mon, 14 Sep 2020 02:49:48 +0000 (11:49 +0900)]
Use definitions of libsyscommon instead of device api

device api now uses libsyscommon library for dbus communication.
To get in line with this change, Deviced is required to use the
callback function of libsyscommon instead of that of api/device.

Change-Id: I5c8f8025ba215ec2fb9a6722ee66ca4b2d8fbea2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoApply dpms cache globally 02/245602/3
Youngjae Cho [Tue, 13 Oct 2020 03:28:30 +0000 (12:28 +0900)]
Apply dpms cache globally

Existing get_lcd_power() accesses to node directly, but it now uses
dpms_get_cached_state() instead. Accessing to the node is separated
into another function, get_lcd_power_node().

Change-Id: Ic05ce15d0fd1ec603c88db470144631a7e1b3ebd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix dbus call of default_pmlock_check() 42/245542/5
Youngjae Cho [Mon, 12 Oct 2020 05:33:32 +0000 (14:33 +0900)]
Fix dbus call of default_pmlock_check()

For non-killable daemons, the return of resourced's CheckAppStatus
is always ignored. Therefore, fix not to call CheckAppStatus when
the pmlock_check is checking non-killable daemon, not app.

Change-Id: Ifeef32754c9d94a18ad302b97927407de91b83d8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoAdopt a dpms cache 54/245554/1
Youngjae Cho [Mon, 5 Oct 2020 08:09:04 +0000 (17:09 +0900)]
Adopt a dpms cache

In the previos structure, deviced sets dpms through Enlightenment,
whereas gets dpms by reading the lcd power node directly. There is
a possibility of a miasmatch between the actual dpms state and the
lcd power node. The cached dpms value is alternatively used for
this situation in replacement of the get_lcd_power().

Change-Id: Id0144cd76cb017694198856f6b40ff7162b61e64
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agosilent reboot: Fix initial DPMS contol 13/245413/1
Youngjae Cho [Thu, 8 Oct 2020 08:18:22 +0000 (17:18 +0900)]
silent reboot: Fix initial DPMS contol

For silent reboot, don't do DPMS_ON, which was done at the
end of init_dpms().

Change-Id: I3692503aa1b7a10085dcc19408148be440f382f7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd get_lcd_power_node() for direct accessing the lcd power node 27/245327/4
Hyotaek Shim [Wed, 7 Oct 2020 06:39:48 +0000 (15:39 +0900)]
Add get_lcd_power_node() for direct accessing the lcd power node

Change-Id: Id47db38af56b2f6b6e4be0e6b46acf79b0564d75
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoDo not handle LCD DIM, when display.Dimming is 0 89/245289/1
lokilee73 [Tue, 6 Oct 2020 11:33:36 +0000 (20:33 +0900)]
Do not handle LCD DIM, when display.Dimming is 0

LCD DIM is not supported in dbus_changestate.

Change-Id: Ie6d1ca66dcf5770492df3331fb71802a089df1af
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoFix compile error 15/245215/1
lokilee73 [Mon, 5 Oct 2020 11:30:36 +0000 (20:30 +0900)]
Fix compile error

display_conf->Dimming can be obtained via get_var_display_config()

Change-Id: I846084962769e2b2e6846552f8724b6bd6d221d5
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoDo not handle LCD DIM, when display.Dimming is 0 81/245181/1
lokilee73 [Mon, 5 Oct 2020 05:03:18 +0000 (14:03 +0900)]
Do not handle LCD DIM, when display.Dimming is 0

LCD DIM lock/unlock is not supported in
dbus_lockstate and dbus_unlockstate.

Change-Id: I51e913b66adf55bb78124185ae5aca19b46ce1a2
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
(cherry picked from commit 8dbf5cc61905833fed475ef0f3bc720ffe0ddc07)

4 years agoAdd S_LCDDIM in process_background and process_foreground 26/245026/2
lokilee73 [Tue, 29 Sep 2020 07:59:38 +0000 (16:59 +0900)]
Add S_LCDDIM in process_background and process_foreground

S_NORMAL is affected by signal, AppStatusChange.
ex) lock status of process with the signal
    node->background: true, LOCK is ignored
    node->background: false, LOCK is valid

Add S_LCDDIM to make it controlled by AppStatusChange as well.

Change-Id: I4f97a07c39bc58c8599a8dae68601849bff12791
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoAdd logs to get pid information for below functions. 50/244550/14
lokilee73 [Mon, 21 Sep 2020 11:55:01 +0000 (20:55 +0900)]
Add logs to get pid information for below functions.

ex) dbus_changestatebyreason
    dbus_customlcdon
    dbus_customlcdoff
    dbus_setbrightness
    dbus_holdbrightness
    dbus_releasebrightness
    dbus_lcdpaneloffmode
    dbus_dimstay_control
    dbus_staytouchscreenoff

Change-Id: I3e692a5b2a407df04ec6e9aeab2f596b88fb7590
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoRemove unused function ciritical_log 63/244263/3 accepted/tizen/6.0/unified/20201030.115431 accepted/tizen/6.0/unified/hotfix/20201103.004154 accepted/tizen/unified/20200922.090819 submit/tizen/20200918.070747 submit/tizen/20200921.022732 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 tizen_6.0.m2_release
lokilee73 [Wed, 16 Sep 2020 11:16:20 +0000 (20:16 +0900)]
Remove unused function ciritical_log
ex) CRITICAL_LOG is used instead of critical_log

Change-Id: Ib47f59e9d3425cd877f978286c4da3501bdb4866
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoDeduplicate below functions 64/244164/3
lokilee73 [Tue, 15 Sep 2020 09:52:18 +0000 (18:52 +0900)]
Deduplicate below functions
ex) update_lock_timer
    process_background
    process_foreground

Change-Id: I396f02f04943a27134c6b7a708f65d386c97edec
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoReplace function name to get variable pointer 28/244028/4
Yunmi Ha [Mon, 14 Sep 2020 07:11:28 +0000 (16:11 +0900)]
Replace function name to get variable pointer

Change-Id: I8c057e2cf393636fcf439b0a6f9d62f5e7254992
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoFix battery link error when battery module is off 17/243817/4
Yunmi Ha [Thu, 10 Sep 2020 08:26:16 +0000 (17:26 +0900)]
Fix battery link error when battery module is off

- When battery_module option is off,
there is link error about undefined function.
- Get battery reference by battery plugin handle.

Change-Id: I4b8649c98d52617bd98f97cfd37f52a355a1d565
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoThe battery plugin is not built, when battery module is off. 12/243212/3
Yunmi Ha [Fri, 4 Sep 2020 03:10:09 +0000 (12:10 +0900)]
The battery plugin is not built, when battery module is off.

Change-Id: I5d3ded1a4708448c77a7bc61a31ed8d4134005ea
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoChange function name 04/243804/2 accepted/tizen/unified/20200914.131459 submit/tizen/20200911.012117
lokilee73 [Thu, 10 Sep 2020 07:14:30 +0000 (16:14 +0900)]
Change function name
ex) dh_get_param_from_var to g_variant_get_safe

Change-Id: Ie8f2efe288b983debe60ec29100a4e146e280827
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoUpdate warning_id when registering lockcheck timer 86/243786/1
Youngjae Cho [Thu, 10 Sep 2020 04:36:35 +0000 (13:36 +0900)]
Update warning_id when registering lockcheck timer

Segfault occurs when the lock node had been deleted during
FORCE_RELEASE_LOCK_INTERVAL and accessed by lockcheck timer callback.

Change-Id: I8defd4fa15a3276588286ef6ae7811d34433241b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit dd12492f83aa2a72e1f580569b81c594e72e042c)

4 years agoGet battery status from battery plugin. 11/243211/4 accepted/tizen/unified/20200911.043138 submit/tizen/20200910.050828
Yunmi Ha [Fri, 4 Sep 2020 02:57:18 +0000 (11:57 +0900)]
Get battery status from battery plugin.

- When battery_module option is off,
there is link error about undefined function.
- Change battery reference to battery plugin same as display.

Change-Id: I75924fd15f81e2485463f0d3eca3f8e798ecaec6
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoDeduplicate display_load_config 27/243527/1
lokilee73 [Tue, 8 Sep 2020 02:05:37 +0000 (11:05 +0900)]
Deduplicate display_load_config

Change-Id: I450a89b1e115a0302101aae95cfd643eb651ff6b
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoSupport multi HDMI + Svace fix 85/242685/22 accepted/tizen/unified/20200908.060816 submit/tizen/20200907.113616 submit/tizen/20200908.010406
lokilee73 [Sat, 29 Aug 2020 08:13:31 +0000 (17:13 +0900)]
Support multi HDMI + Svace fix

1) Support multi HDMI
There are two HDMI ports in RPI4 target
and it can be increased in the future.
So, make a bitmap table for HDMI.
Supported MAX HDMI number is 64 for now.

Below data is listed up.
extcon# : 1 is shifted by #
ex)  type    value    bitmap
    extcon1   1/0    0x10/0x00
    extcon2   1/0    0x100/0x000
    extcon3   1/0    0x1000/0x0000
If one of them is 1, then 1(connected) is broadcasted.
Otherwise, 0(disconnected) is broadcasted.

2) Svace fix
src/power/power-control.c
Below condition is removed,
because .log_type is same or bigger than PM_LOG_MIN
pm_history_log[index].log_type < PM_LOG_MIN

Change-Id: Ib9dbaa374cc5ccbbde1ebac45840befe1fb786d2
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoFix dlsym() caller for get_display_conf 10/242610/2 accepted/tizen/unified/20200903.151740 submit/tizen/20200903.015250
Yunmi Ha [Fri, 28 Aug 2020 08:41:33 +0000 (17:41 +0900)]
Fix dlsym() caller for get_display_conf

Change-Id: If9eac834f99620e52807881c321d2f08e4a6e194

4 years agoEnhance display/power lock managemenent 01/242701/6 accepted/tizen/unified/20200902.145534 submit/tizen/20200902.021453
Youngjae Cho [Mon, 31 Aug 2020 02:38:10 +0000 (11:38 +0900)]
Enhance display/power lock managemenent

Summary:
 - Detect someone who holds lock longer than 30 minutes.
 - If a general application is detected, deviced generates signal
   with time information in addtion to pid.
 - If a specific daemon is detected, deviced tries to kill it directly.

For general applications:
   Added an addition information, lock holding time in second, to the
  signal "pmlock_expired". This makes someone, who is in charge of
  application lifecycle and notification, possible to determine whether
  to kill that application or not.

For some specific killable daemon:
   Added list of killable daemon to conf file and deviced loads that list.
  If a killable daemon holds lock longer than 30 minutes, deviced directly
  sends SIGTERM to that daemon, releasing lock. After for a while, deviced
  checks once more, if the daemon is still alive then, sends SIGKILL.

Change-Id: Ia0d433facdcc7814e19278619a58a111ff7ff7c3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoReturn errno for failing fopen in config_parse 01/242801/1
Youngjae Cho [Tue, 1 Sep 2020 02:12:49 +0000 (11:12 +0900)]
Return errno for failing fopen in config_parse

Change-Id: I23c0e54128f59c9a3b3e533add1670cfb74bf9df
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoDosen't lock becasue it could prevent Suspend-to-RAM 55/242455/6
lokilee73 [Thu, 27 Aug 2020 05:35:56 +0000 (14:35 +0900)]
Dosen't lock becasue it could prevent Suspend-to-RAM

If internal lock by USB-HOST is on, it can prevent going to suspend-to-ram.
So, remove it.

Change-Id: I87852664313d662cf38af120383506bd2116932f
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoDeduplicate Power Manager history functions 96/242296/4
lokilee73 [Tue, 25 Aug 2020 10:51:28 +0000 (19:51 +0900)]
Deduplicate Power Manager history functions

ex)
pm_history_init
pm_history_save
pm_history_print

Change-Id: Ib322155e0091d6f972a833d140beb3c1bd4c890b
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoAdd internal CAPIs to auto test 62/241962/8 accepted/tizen/unified/20200825.142852 submit/tizen/20200824.103034 submit/tizen/20200825.014022
lokilee73 [Fri, 21 Aug 2020 06:48:51 +0000 (15:48 +0900)]
Add internal CAPIs to auto test

ex)
device_touchscreen_disable
device_touchscreen_enable
device_display_get_brightness_state
device_display_get_max_brightness_state
device_display_set_brightness_state
device_display_change_state_by_reason
device_multi_led_get_number
device_multi_led_control
device_battery_get_info_direct
device_pmqos_app_launch_home
device_pmqos_homescreen
device_get_reboot_mode

Change-Id: I3f45437591ed29c9477851b138d51d9fd5864295
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoFix display not to go into AOD when poweroff 22/241422/1
Youngjae Cho [Thu, 20 Aug 2020 04:45:08 +0000 (13:45 +0900)]
Fix display not to go into AOD when poweroff

Change-Id: Ie57cc79a23eb20b948e8bdf54ce6acadcd1474b6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoChange display_conf to static 48/240548/2 accepted/tizen/unified/20200819.100448 submit/tizen/20200818.110444
Yunmi Ha [Fri, 7 Aug 2020 09:29:07 +0000 (18:29 +0900)]
Change display_conf to static

Change-Id: I64cc875bd0fb554f297bf95ba6994ffe429c52ef
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoChange states global variable to static 45/240545/5
Yunmi Ha [Fri, 7 Aug 2020 08:51:23 +0000 (17:51 +0900)]
Change states global variable to static

Change-Id: I86483d65ad63f6ceca0c12111f994ffaf95669eb
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoChange battery global variable to static 35/240535/5
Yunmi Ha [Fri, 7 Aug 2020 07:23:17 +0000 (16:23 +0900)]
Change battery global variable to static

Change-Id: I2d2b3e024e0518bf9f442ec4820c12546085160f
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoFix build warnings 47/241147/1
Hyotaek Shim [Tue, 18 Aug 2020 05:00:00 +0000 (14:00 +0900)]
Fix build warnings

Change-Id: Ibcc05e48990655e0d62e08dc43fa7fe448c1cb9c
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoAdd initialize constructor for backlight init. 62/241062/1 accepted/tizen/unified/20200817.134623 submit/tizen/20200814.095001
Yunmi Ha [Fri, 14 Aug 2020 07:33:47 +0000 (16:33 +0900)]
Add initialize constructor for backlight init.

Change-Id: I592367573b0550d6841b1440ba7e2ea47849471f
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoChange backlight_ops static 90/238590/16
Youngjae Cho [Wed, 15 Jul 2020 09:22:28 +0000 (18:22 +0900)]
Change backlight_ops static

Change-Id: I8d958fc084a74e6272f470bf81a7f1a342c10492
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd initialize constructor for variable init. 55/240955/2
Yunmi Ha [Thu, 13 Aug 2020 06:17:59 +0000 (15:17 +0900)]
Add initialize constructor for variable init.

Change-Id: I0c469e3609f4c99a36531d1a2a9adbcea48aab50
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoMove variable initialization code to probe function 53/240853/2
Yunmi Ha [Wed, 12 Aug 2020 06:21:35 +0000 (15:21 +0900)]
Move variable initialization code to probe function

Change-Id: Ieafb6b73e6a64da572d79b401937cc495bb8fa16
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoFix battery_plgn memory corruption 46/240846/2
Yunmi Ha [Wed, 12 Aug 2020 05:35:11 +0000 (14:35 +0900)]
Fix battery_plgn memory corruption

Change-Id: Ib20a86452e669873cd7b0f1a0ae3ef21f077ac0a
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoFix initializtion for extcon_usbhost 33/240833/2
Hyotaek Shim [Wed, 12 Aug 2020 02:38:58 +0000 (11:38 +0900)]
Fix initializtion for extcon_usbhost

Change-Id: I98e67b10b0f3790b70ee77bbd3d41cb6ee99dc39
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoGuarantee to restore brightness to default on LCDON 47/240647/2
Youngjae Cho [Thu, 6 Aug 2020 02:12:06 +0000 (11:12 +0900)]
Guarantee to restore brightness to default on LCDON

AutoBrightnessChanged with level 0 on LCDON will check brightness. If
the current brightnes is different to default brightness, restore the
brightness to the default brightness. This is especially important for
turning on LCD from AOD clock as the deferred brightness effect is
applied at this point.

Change-Id: Ia82a058c5d462d7739d51d161e2740586d990247
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoChange power related global variables and functions to static 46/240546/4
lokilee73 [Fri, 7 Aug 2020 09:18:51 +0000 (18:18 +0900)]
Change power related global variables and functions to static

Change-Id: I7a1f14ac7d7ebab5a2cefab8b070b246e62dd866
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoChange display_plgn, battery_plgn static 87/238687/10
Youngjae Cho [Thu, 16 Jul 2020 07:02:11 +0000 (16:02 +0900)]
Change display_plgn, battery_plgn static

Change-Id: I3933a70a3f197cf6955b378429aa99c6e1f69150
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd doze_pmqos_request for cpu throttling 52/240152/12 accepted/tizen/unified/20200810.123002 submit/tizen/20200810.073747
lokilee73 [Tue, 4 Aug 2020 04:27:39 +0000 (13:27 +0900)]
Add doze_pmqos_request for cpu throttling

Request for cpu throttling is sent from DEVICED to PASS,
when LCD is ON or OFF

ex) LCD OFF : 1 to enter doze mode
    LCD ON  : 0 to leave doze mode

Change-Id: I4a655be04dd5bbd5198e452bda85cbd9df8f06e7
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoRemove unnecessary dependencies 13/240313/2
Yunmi Ha [Wed, 5 Aug 2020 07:59:56 +0000 (16:59 +0900)]
Remove unnecessary dependencies

- remove 'libdevice-node' package dependencies.

Change-Id: I7e85a9bc54e077923b8d44793e3df7d9e91a7e32
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoWait for 4 sec. before poweroff_prepare() and set LCD_OFF in disable_display() 56/240156/10
Hyotaek Shim [Tue, 4 Aug 2020 05:04:50 +0000 (14:04 +0900)]
Wait for 4 sec. before poweroff_prepare() and set LCD_OFF in disable_display()

To preserve boot animation time and keep black screen even if the animation is killed
To set LCD_NORMAL when "devicectl display stop" is executed

Change-Id: I58a855bc6d3940fc417481523552f24df22731d7
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRevert "Change abnormal health popup lcddim lock to 60s" 78/240178/2
Hyotaek Shim [Tue, 4 Aug 2020 06:56:48 +0000 (06:56 +0000)]
Revert "Change abnormal health popup lcddim lock to 60s"

This reverts commit ec0c8ae86c88d2e5f42b133ff408416e75ebeef3.

Change-Id: I8ad4a44d91601d049f0707e65256c83d49347432

4 years agoAdd DPMS checklist for dependable DPMS control 17/239617/1
Youngjae Cho [Mon, 27 Jul 2020 04:35:58 +0000 (13:35 +0900)]
Add DPMS checklist for dependable DPMS control

For guaranteeing HBMOFF before DPMS OFF, needs for checker has arisen.
There can be corner case that HBM hasn't been offed before DPMS OFF.
To detect such situation, introduced checklist. And check right before
the DPMS request, guaranteeing HBMOFF.

Change-Id: Id490891f98ec2896b5b6b566aedc741c4c7b2f91
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 084c700b17ffdba0b3e3b295ece1867faaf8bb0a)

4 years agoApply new power management feature, Doze mode 49/239249/5 submit/tizen/20200724.060056
Youngjae Cho [Thu, 23 Jul 2020 04:38:11 +0000 (13:38 +0900)]
Apply new power management feature, Doze mode

Change-Id: Ia515c2130c1b68eab6dc5bc2b5a3d2beb62c1114
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoChange abnormal health popup lcddim lock to 60s 29/239229/1
Youngjae Cho [Thu, 23 Jul 2020 01:19:15 +0000 (10:19 +0900)]
Change abnormal health popup lcddim lock to 60s

In the below commit,
6b0553796377417ea333f246742dc302e024cc6e
it is missed that update macro to 1 min.

Change-Id: I3c761d3107ff62e6137505d6fca38b5f6dec92bc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 1eb746baa6176ba20528236afc1a28e1000ff421)

4 years agoDo not control sw bezel on changing display state 22/239022/1 accepted/tizen/unified/20200723.161309 submit/tizen/20200721.112435
Youngjae Cho [Tue, 21 Jul 2020 04:34:24 +0000 (13:34 +0900)]
Do not control sw bezel on changing display state

sw bezel is only controlled by vconf.

Change-Id: I44a75eed17ccd3cd5115bce810cd15a017bfdf9f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit b8151da7cb2cc94a21b99aaebfe1ba9ac31e603b)

4 years agoDevide pm_status_flag into set and clear functions 04/238504/2
lokilee73 [Tue, 14 Jul 2020 12:34:50 +0000 (21:34 +0900)]
Devide pm_status_flag into set and clear functions
to remove global variable

set_pm_status_flag is to add flag in pm_status_flag
clear_pm_status_flag is to clear flag in pm_status_flag

Change-Id: If3d9b6969c5a86338b66ca96f1b65fac7efff3a7
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoAdd missing NULL check of calling HAL 61/238561/1
Youngjae Cho [Wed, 15 Jul 2020 05:35:20 +0000 (14:35 +0900)]
Add missing NULL check of calling HAL

Change-Id: I85454fd6ce2bebd041025240e0b7c1606b9e6ec4
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd null checking code before calling a bezel HAL 54/238554/1
Youngjae Cho [Wed, 15 Jul 2020 04:20:50 +0000 (13:20 +0900)]
Add null checking code before calling a bezel HAL

Change-Id: Idb80accdaefb7820a0776ca55415d2ffd115d83f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
(cherry picked from commit 3809eaa73c98dbc14fae730352fc877e19622f7c)

4 years agoMove pm_old_state to display.c to remove global variable 79/238379/2
lokilee73 [Mon, 13 Jul 2020 07:02:17 +0000 (16:02 +0900)]
Move pm_old_state to display.c to remove global variable

Change-Id: Id366233f17a0ab7cee367775ce5758a8df21854d
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoMove pm_cur_state to display.c to remove global variable 68/238068/5
lokilee73 [Wed, 8 Jul 2020 06:06:42 +0000 (15:06 +0900)]
Move pm_cur_state to display.c to remove global variable

Change-Id: If9eb70c2b8fdeff1f4248983fa5d8b07bd6de86b
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoChange global variable to static one 13/238013/3
lokilee73 [Tue, 7 Jul 2020 10:46:49 +0000 (19:46 +0900)]
Change global variable to static one

Change-Id: I371c2bb10dd31fd0080c6c87a62b27be9891a5fa
Signed-off-by: lokilee73 <changjoo.lee@samsung.com>
4 years agoFix coverity issue 46/238046/2
Youngjae Cho [Wed, 8 Jul 2020 02:18:09 +0000 (11:18 +0900)]
Fix coverity issue

Change-Id: Ia09f20d916d8128c07aea903dca24a5afa5a562e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix coverity issue 07/238007/1
Youngjae Cho [Tue, 7 Jul 2020 09:17:32 +0000 (18:17 +0900)]
Fix coverity issue

Change-Id: Ia9a1a6aa32514a482ce64345088ad99be59e9634
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>