platform/core/system/deviced.git
2 years agoextcon: rename enable to initialized 27/266127/1
INSUN PYO [Mon, 8 Nov 2021 06:33:37 +0000 (15:33 +0900)]
extcon: rename enable to initialized

Change-Id: I9febfb6a57267bd42812c165d52de29aaa7dd3d2

2 years agoextcon: initialize on calling extcon_enable_device() 29/266029/2 accepted/tizen/unified/20211105.130437 submit/tizen/20211104.080231
Youngjae Cho [Thu, 4 Nov 2021 06:52:52 +0000 (15:52 +0900)]
extcon: initialize on calling extcon_enable_device()

Change-Id: Id128ded4a79fc63172cd35aeb00fa940c5c00709
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: support powerkey shortpress for iot-headless 71/265571/3 submit/tizen/20211103.072537 submit/tizen/20211104.031932
Youngjae Cho [Fri, 22 Oct 2021 07:32:21 +0000 (16:32 +0900)]
input: support powerkey shortpress for iot-headless

Change-Id: I0451471b0b17746e30e159c7ac5e0e7395fd39e1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: make input module initialize plugin input-handler 69/265869/1
Youngjae Cho [Mon, 1 Nov 2021 06:31:39 +0000 (15:31 +0900)]
input: make input module initialize plugin input-handler

Change-Id: Ia72cd8f207b782da369e4161e1bd9269045e19e6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRemove unnecessaries from iot-headless plugin package 58/265858/1
Youngjae Cho [Mon, 1 Nov 2021 01:21:53 +0000 (10:21 +0900)]
Remove unnecessaries from iot-headless plugin package

Change-Id: I89bf3db908b078c1609284e1c650cda7a02ead4a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agotests: move tests to the topmost directory 40/265640/3
Youngjae Cho [Tue, 26 Oct 2021 01:36:25 +0000 (10:36 +0900)]
tests: move tests to the topmost directory

Change-Id: I96af0cd9a652d2f5d1ed5467d73e57de8c63850e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoshared: add test for libdeviced-common-private 35/265635/4
Youngjae Cho [Mon, 25 Oct 2021 10:59:13 +0000 (19:59 +0900)]
shared: add test for libdeviced-common-private

This test runs automatically at build time. If the test fails, build
will fail. In addition to adding the test, collect existing
usb-host-test under src/tests directory.

Change-Id: Id825b5747c0e9144d390687bf7d0bf9293075b72
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoFix warning on 64bit build environment 73/265573/1
Youngjae Cho [Fri, 22 Oct 2021 07:45:27 +0000 (16:45 +0900)]
Fix warning on 64bit build environment

Change-Id: Ibb001db94bd0ec1b29efab43e1e38fc0ff802150
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput-handler: fix powerkey longpress timeout 58/265558/1
Youngjae Cho [Fri, 22 Oct 2021 03:42:20 +0000 (12:42 +0900)]
input-handler: fix powerkey longpress timeout

Change-Id: Ib6e97e5d291ca30311e4c28f680e820b4b3812b8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRemove duplicated call of gdbus_register_object_all() 26/265526/1
Hyotaek Shim [Thu, 21 Oct 2021 10:00:37 +0000 (19:00 +0900)]
Remove duplicated call of gdbus_register_object_all()

All of the added dbus interfaces should be registered all at once by devices_init().

Change-Id: I251049b6d1757b381eccc93cbe1117d94d47bf6d
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agodevices: change dev_head to global 68/265468/2
Youngjae Cho [Wed, 20 Oct 2021 06:29:14 +0000 (15:29 +0900)]
devices: change dev_head to global

Sorting dev_head, which is returned by get_device_list_head(),
changes the dev_head. But it is not applied to the original dev_head
in shared/devices.c. Therefore the original dev_head is not the head
of the list anymore. To avoid it, make dev_head global so that result
of list operation can be applied to the original dev_head.

Change-Id: I2e6ee2b3ea0ad91cb6de44c5e9f6e2d718eb727c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoshared: move devices from core to shared 24/265424/3
Youngjae Cho [Tue, 19 Oct 2021 06:12:17 +0000 (15:12 +0900)]
shared: move devices from core to shared

Separate commonly used functions from core/devices.c to
shared/devices.c. As headers for those two, core/devices.h and
shared/devices.h, have the same name, take care about exact include
path when you use header devices.h.

Change-Id: I5ff977db01c37765a3e870c3426eeec03d2e8c5d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopartition-switch: add new tool for partition switch 27/265227/2
Youngjae Cho [Wed, 13 Oct 2021 01:57:33 +0000 (10:57 +0900)]
partition-switch: add new tool for partition switch

Add new tool for switching partition during FOTA. In addition to
this partition-switch tool, this patch makes new "tools" directory
to collect codes that produce executables, and those executables
will be packaged into deviced-tools.

Change-Id: I3d91265e97d4aeefc374fb7eb3a496ed7b670ce3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: replace keycode macro with one in linux header 66/265066/1
Youngjae Cho [Fri, 8 Oct 2021 06:07:19 +0000 (15:07 +0900)]
input: replace keycode macro with one in linux header

Change-Id: I04da6e45adad9a3360627cd241bba32e0fc04d94
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: change power off key mapping 11/265011/3
Youngjae Cho [Thu, 7 Oct 2021 05:27:41 +0000 (14:27 +0900)]
input: change power off key mapping

Change-Id: If580a63972c3cdf13fe612bf1fc99fd34e2d7f2b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRename booting_done to delayed_init_done 19/264919/3
Youngjae Cho [Tue, 5 Oct 2021 06:44:18 +0000 (15:44 +0900)]
Rename booting_done to delayed_init_done

Technically, the DEVICE_NOTIFIER_BOOTING_DONE is generated on receiving
dbus signal "StartupFinished", not "BootingDone". Therefore rename this
notifier to DEVICE_NOTIFIER_DELAYED_INIT and booting_done() callbacks to
delayed_init_done().

Change-Id: Ib7c9a38826ce3fdc7eb0b10ee2a62314c8b0dde6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery-notification: remove duplicated code 24/264924/2
Youngjae Cho [Tue, 5 Oct 2021 07:45:11 +0000 (16:45 +0900)]
battery-notification: remove duplicated code

Change-Id: I391743067775c6eb0134cabe02fb277894f4ab5b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoextcon: register dbus object on init 12/264912/3
Youngjae Cho [Tue, 5 Oct 2021 04:30:19 +0000 (13:30 +0900)]
extcon: register dbus object on init

Change-Id: Ia20bb373f1f20fb1b50d1957636d7f9625b5f07b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoextcon: defer init until booting done 52/264852/2
Youngjae Cho [Fri, 1 Oct 2021 06:43:00 +0000 (15:43 +0900)]
extcon: defer init until booting done

Change-Id: I1a4556d7c5e6e42aa7de8e0eef57f8d107dafce1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: support cpu lock/unlock for headless 06/264806/2
Youngjae Cho [Thu, 30 Sep 2021 05:35:24 +0000 (14:35 +0900)]
power: support cpu lock/unlock for headless

Add power-control-plugin module to support headless-exclusive
cpu lock/unlock.

Change-Id: I3d39f5b9479af114fb0f42281511c93590a29ff7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: add input-handler for iot-headless 88/264688/3 accepted/tizen/6.5/unified/20211028.114341 accepted/tizen/unified/20211001.001408 submit/tizen/20210929.005949 submit/tizen_6.5/20211028.162501 tizen_6.5.m2_release
Youngjae Cho [Tue, 28 Sep 2021 08:15:48 +0000 (17:15 +0900)]
input: add input-handler for iot-headless

Change-Id: Ie90573af3c1351d8f1f6ed8622ed8ec021eb8ba8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agodisplay: remove pm_callback function pointer 95/264695/1
Youngjae Cho [Tue, 28 Sep 2021 09:17:20 +0000 (18:17 +0900)]
display: remove pm_callback function pointer

Instead, invoke poll_callback() function, which is identical to the
pm_callback function pointer.

Change-Id: Ic7a4bc2ea5a5729a39b6333d572621303a00fc95
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: detach input from display module 65/264665/2
Youngjae Cho [Tue, 28 Sep 2021 03:14:38 +0000 (12:14 +0900)]
input: detach input from display module

For headless profile, separate input from display module. The input
module must be initialized with a parameter which is function pointer
handling input event.

Change-Id: Idc5e821d3cf1d02feae0ee6f9dc367320296f223
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agousbhost: add configuration for display change state 70/263870/6
Youngjae Cho [Mon, 13 Sep 2021 05:20:47 +0000 (14:20 +0900)]
usbhost: add configuration for display change state

Change-Id: I1801f86f15fc41774b73e410c6baecb155ab44f1
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoAdd new package, plugin-profile-iot-headless 23/263223/4 accepted/tizen/unified/20210830.182638 submit/tizen/20210830.032417
Youngjae Cho [Mon, 30 Aug 2021 01:03:55 +0000 (10:03 +0900)]
Add new package, plugin-profile-iot-headless

Change-Id: I2ab36edc7ef1f87432be2b69435a714b407932a3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRevert "Fix MIC errors by restoring device-iot package" 24/263224/1
Hyotaek Shim [Mon, 30 Aug 2021 01:08:24 +0000 (01:08 +0000)]
Revert "Fix MIC errors by restoring device-iot package"

This reverts commit c36f0147dd7785d8dcf00e9875fda8abbc921ef7.

Change-Id: I77b563d1d21e9bb6f6b4a133632f1ed9d3dc3b80

2 years agoFix MIC errors by restoring device-iot package 18/263218/1 submit/tizen/20210828.141109
Hyotaek Shim [Sat, 28 Aug 2021 13:58:21 +0000 (22:58 +0900)]
Fix MIC errors by restoring device-iot package

Change-Id: I34302da456118c8f02f147a7acb7e12fc47a0317
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agolowbat-handler: disable poweroff by lowbattery at emul 40/263040/1 accepted/tizen/unified/20210827.122234 submit/tizen/20210825.082622 submit/tizen/20210827.022603
Youngjae Cho [Wed, 25 Aug 2021 03:09:54 +0000 (20:09 -0700)]
lowbat-handler: disable poweroff by lowbattery at emul

Change-Id: I5bc023f9f52885678da75570423f207e76f1943b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agodevice-idler: reduce to a single function, g_idle_add() 93/262793/1
Youngjae Cho [Fri, 20 Aug 2021 02:02:31 +0000 (11:02 +0900)]
device-idler: reduce to a single function, g_idle_add()

Change-Id: I95e33e1763d22aeea892836e6417aea78f6d7664
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoMerge "Remove unused code" into tizen
Hyotaek Shim [Fri, 20 Aug 2021 01:32:43 +0000 (01:32 +0000)]
Merge "Remove unused code" into tizen

2 years agobitmap: move to shared 86/262786/2
Youngjae Cho [Thu, 19 Aug 2021 09:26:52 +0000 (18:26 +0900)]
bitmap: move to shared

Change-Id: Ic454a4e47245e294511033b79f9e8b4cf7de82c9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRemove unused code 67/262767/1
Youngjae Cho [Thu, 19 Aug 2021 08:41:20 +0000 (17:41 +0900)]
Remove unused code

Change-Id: Idcb99ab59dc44fee23d0fcbedfa80ade62ead57f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agodevice-notifier: separate functions from device 16/262716/1
Youngjae Cho [Wed, 18 Aug 2021 07:52:33 +0000 (16:52 +0900)]
device-notifier: separate functions from device

The device-notifier "device" should have treated device-notifier
"device" only. But it have covered device-notifier "functions" as
well. Seperate this "functions" from device-notifier "device" and
move these to shared library. And rename device-notifier "device"
to late-booting-done-notifier to more semantically fit to its role.

Change-Id: Ia958c15b7b1bb9cf1eb7b09da53ceb31b72f96cf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agodevices: replace priority enum to integer 06/262306/1
Youngjae Cho [Fri, 6 Aug 2021 07:22:22 +0000 (16:22 +0900)]
devices: replace priority enum to integer

Previously, there were only two priorities of enum device_priority,
so it wasn't possible to fine-tune the initialization order.
Replace this enum to integer and sorts devices with this integer.
Higher integer will be initialized first.

Change-Id: I90183d86159cca6ad00afa3a92dbadd3bab6751a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRename iot package to iot-headed 36/262236/4
Youngjae Cho [Thu, 5 Aug 2021 00:35:15 +0000 (09:35 +0900)]
Rename iot package to iot-headed

There iot-headless will be added. Therefore, to distinguish those
two iot headed/headless profiles, rename the existing iot to iot-headed.

Change-Id: I590ad8122723d7f6e2c5273aaa000d091378e6ab
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agothermal: rename device_thermal_e to hal_device_thermal_e 52/262052/1 accepted/tizen/unified/20210804.085642 submit/tizen/20210802.064402
Youngjae Cho [Mon, 2 Aug 2021 05:40:21 +0000 (14:40 +0900)]
thermal: rename device_thermal_e to hal_device_thermal_e

Change-Id: I1143aae7d95e2b9a4859b6d53600b06076debdfb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery: fix segfault for iot-headless 62/261562/2 accepted/tizen/unified/20210722.124904 submit/tizen/20210721.083006
Youngjae Cho [Wed, 21 Jul 2021 07:12:56 +0000 (16:12 +0900)]
battery: fix segfault for iot-headless

Change-Id: Ic88833c305694ca43723152c37212c7f92df3f16
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery: bug fix regarding pm_lock_internal() check 44/261544/4 submit/tizen/20210721.045108
Youngjae Cho [Wed, 21 Jul 2021 02:50:45 +0000 (11:50 +0900)]
battery: bug fix regarding pm_lock_internal() check

Change-Id: Ic119e32dfe3513910dcb2660e26ab2a25dade34c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoudev: change the name of udev monitor buffer size 31/261531/1
INSUN PYO [Wed, 21 Jul 2021 01:16:49 +0000 (10:16 +0900)]
udev: change the name of udev monitor buffer size

Change-Id: Ibf9f2a76da7483751ab921c8e5ae38ac1c1a4d1b

2 years agoboard: fix memory leak 28/260128/1 submit/tizen/20210621.095917
Hyotaek Shim [Mon, 21 Jun 2021 03:27:40 +0000 (12:27 +0900)]
board: fix memory leak

Change-Id: Icc8d5138643557b83acbba7b7d5df8b26f4b092e
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoboard: fix parameter of get_deviec_serial_number() 92/260092/2 accepted/tizen/unified/20210621.123228 submit/tizen/20210618.075427
Hyotaek Shim [Fri, 18 Jun 2021 10:45:49 +0000 (19:45 +0900)]
board: fix parameter of get_deviec_serial_number()

Change-Id: I4c9d3adbe0226afafd35c8597cb1d8787b70f428
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoChange timeout way of reboot command 13/259813/9 submit/tizen/20210616.024518
taemin.yeom [Tue, 15 Jun 2021 06:16:43 +0000 (15:16 +0900)]
Change timeout way of reboot command

Change-Id: I92f4f05a367c6229e6781f29457c89682d45de14
Signed-off-by: taemin.yeom <taemin.yeom@samsung.com>
2 years agoboard: renaming get_device_serial_number 68/259768/1 accepted/tizen/unified/20210615.120400 submit/tizen/20210614.021455
Youngjae Cho [Mon, 14 Jun 2021 02:07:00 +0000 (11:07 +0900)]
board: renaming get_device_serial_number

Change-Id: Ic25d4697a90da5a71a9a93ccd6d081491bc3214e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agocommon: move file IO to libsyscommon 92/259692/2 submit/tizen/20210611.122922
Youngjae Cho [Fri, 11 Jun 2021 06:02:51 +0000 (15:02 +0900)]
common: move file IO to libsyscommon

Change-Id: Id9d27b95808d8a8c540cd46c67db1996007944db
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoFix build warning 81/259681/1
Youngjae Cho [Fri, 11 Jun 2021 04:28:23 +0000 (13:28 +0900)]
Fix build warning

Change-Id: I3a913e36e3482255f81a658ec8e28e25b24c1b97
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agousb-host-test: fix resource leak 39/259639/1
INSUN PYO [Thu, 10 Jun 2021 09:42:58 +0000 (18:42 +0900)]
usb-host-test: fix resource leak

Change-Id: I86a76faca13ffd9a930d947fe92be58328586e25

2 years agodeviced-common-private: new shared library for common code 09/259609/2
Youngjae Cho [Thu, 10 Jun 2021 07:13:31 +0000 (16:13 +0900)]
deviced-common-private: new shared library for common code

Generate libdeviced-common-private.so which contains common source code
for reusability and testability.
 core/common.c -> shared/common.h (moved)
 core/common.h -> shared/common.h (merged)

Change-Id: I3b631bcba58aeabc437a974c06e560b08b72768b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoRemove final.target dependency from reboot sequence 46/259546/3 accepted/tizen/unified/20210611.145056 submit/tizen/20210610.022051
Hyotaek Shim [Wed, 9 Jun 2021 10:34:48 +0000 (19:34 +0900)]
Remove final.target dependency from reboot sequence

Change-Id: I1fbc7a5eda461f90202db92093a60edbb63d3941
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoSpecify User, Group, and Smack in deviced-request-shutdown@.service 05/259005/3 accepted/tizen/unified/20210601.135344 submit/tizen/20210531.203739
Hyotaek Shim [Mon, 31 May 2021 01:44:30 +0000 (10:44 +0900)]
Specify User, Group, and Smack in deviced-request-shutdown@.service

Change-Id: I1d46ab57aa5033595c64b3fe8a93b28da18fa2b0
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
3 years agoshutdown: Ensure that shutdown goes through deviced, if it's available 29/258429/3 accepted/tizen/unified/20210528.134738 submit/tizen/20210528.010751
Karol Lewandowski [Mon, 17 May 2021 16:03:22 +0000 (18:03 +0200)]
shutdown: Ensure that shutdown goes through deviced, if it's available

Change-Id: I9bfad72d41f340abb99dc44c2ec0b9e243301450

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>
3 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>
3 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>
3 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

3 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

3 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

3 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

3 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>
3 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>
3 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>
3 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>
3 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>
3 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)

3 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>
3 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>
3 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>
3 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>
3 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>
3 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>
3 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>