platform/core/system/deviced.git
2 years agopower: change configuration section of TimeoutSleepSupport 72/272772/1
Youngjae Cho [Thu, 24 Mar 2022 06:45:47 +0000 (15:45 +0900)]
power: change configuration section of TimeoutSleepSupport

Change-Id: I9e534b858d7994182d994d9649d4f1e2375c32e9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoAdd new command to manipulate the "cloned" flag 55/272355/6
SangYoun Kwak [Tue, 15 Mar 2022 07:23:25 +0000 (16:23 +0900)]
Add new command to manipulate the "cloned" flag

Change-Id: I6dc81870f7769869f02b0dfaa6e2418179288ee2
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agousb-gadget: introduce configurable usb-gadget 12/272412/6
Youngjae Cho [Wed, 16 Mar 2022 08:25:33 +0000 (17:25 +0900)]
usb-gadget: introduce configurable usb-gadget

Change-Id: Iaf2adf68666b1def8dcf6b04707d0f5a3f5fc3e0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoSupport silent boot via cmdline bootmode 82/272282/2 accepted/tizen/unified/20220318.132958 submit/tizen/20220317.053005
Youngjae Cho [Mon, 14 Mar 2022 05:32:36 +0000 (14:32 +0900)]
Support silent boot via cmdline bootmode

The /proc/cmdline has changed to have bootmode=silent parameter on
silent booting.

Change-Id: I15ebb44bdd86155fc1a65489e23ec527fd9cbf86
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery: fix name of battery charging state 67/272267/1
Youngjae Cho [Mon, 14 Mar 2022 02:01:37 +0000 (11:01 +0900)]
battery: fix name of battery charging state

Change-Id: Ide4c233bf2c69ffdec270622a5d23736cfb661e4
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery: suppress config parse error 75/272075/1 accepted/tizen/unified/20220310.120904 submit/tizen/20220308.032646
Youngjae Cho [Tue, 8 Mar 2022 02:44:56 +0000 (11:44 +0900)]
battery: suppress config parse error

Do not consider encounter of a section that we are not intersted in
as an error, because several new sections have been added recently.

Change-Id: I9d3f3d6a5dd6e14ca0478ed6f661e39a7519cd46
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoFix section name to follow the coding ground rule 34/272034/1
Youngjae Cho [Mon, 7 Mar 2022 06:53:56 +0000 (15:53 +0900)]
Fix section name to follow the coding ground rule

Change-Id: I0a6d6d499a0bfcfaa1b8bf0f275b6de3470e84f2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoauto-test: add uevent control before/after the battery test 98/270998/2 submit/tizen/20220222.024249
Youngjae Cho [Mon, 14 Feb 2022 04:02:59 +0000 (13:02 +0900)]
auto-test: add uevent control before/after the battery test

During battery test, uevent must be ignored as test-driver generates
pseudo-uevent and a real-uevent might corrupt it.

Change-Id: Idf44757c00e2f2fadda75d87cec3a2982ee0871e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: clarify meaning of power-state-wait log 25/270625/1 submit/tizen/20220208.052553 submit/tizen/20220208.075544
Youngjae Cho [Mon, 7 Feb 2022 05:19:44 +0000 (14:19 +0900)]
power: clarify meaning of power-state-wait log

Clarify it to imply the meaning of "how many" processes have requested
for state-wait.

Change-Id: I96dccbdcf60c84307d3d4e0dc39794421cda4549
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoauto-test: check feature using system-info library 79/270479/1
Youngjae Cho [Thu, 3 Feb 2022 07:25:20 +0000 (16:25 +0900)]
auto-test: check feature using system-info library

Previously, the uniitest is conducted based on statically defined
configuration file, auto-test.conf. Replace it to system-info API,
which fetches feature on runtime. Therefore it is able to find feature
on various target without defining one by one in advance whether a test
can be deserved.

Change-Id: Iaf445edc4c566517c37106dd00c67c42cd7f813a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery: rename battery.online as charger_connected 36/270236/7
Youngjae Cho [Thu, 27 Jan 2022 01:46:10 +0000 (17:46 -0800)]
battery: rename battery.online as charger_connected

 The charger_connected has changed to have only a value of 0 or 1,
which corresponds to charger disconnected/connected. At before, the
variable can have any integer other than 0 or 1, which implied which
type of charger had been connected. Instead of those integers, the
power_source_s or vconf can be utilized for charger type.
 The vconf, VCONFKEY_SYSMAN_CHARGER_TYPE, which was exclusive for MCD
product profile, has changed to have a one of the value belows, and it
will be changed according to battery.power_source_s.
    0 (none, charger disconnected or unknown type)
    1 (ac)
    2 (usb)
    3 (wireless)

Change-Id: I8ff4751e521585f94cd421a0edeba04651094bce
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: defer state transition until booting done 73/269573/1
Youngjae Cho [Tue, 18 Jan 2022 09:43:07 +0000 (18:43 +0900)]
power: defer state transition until booting done

If a transition event occured before booting_done(=delayed_init_done),
defer the transition until booting done.

Change-Id: Ib79974b34a8b55751d542c50f9354cdc95ae021b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery: fix condition of update_online() 71/269571/1
Youngjae Cho [Tue, 18 Jan 2022 09:15:06 +0000 (18:15 +0900)]
battery: fix condition of update_online()

Initialize online_status by -1 so that the update_online() shall process
properly even when the device has turned on with charger disconnected.

Change-Id: I25c51f0aa856c2b1190f148f650b674054f918f7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoFix conf filename format to {module}-profile-{profile}.conf 27/269327/4
Youngjae Cho [Thu, 13 Jan 2022 01:37:52 +0000 (17:37 -0800)]
Fix conf filename format to {module}-profile-{profile}.conf

Change-Id: I5bd5e1e635b43fe3fa55f657ac6d162920f1d827
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoAdd license declaration in source files 88/269488/3
SangYoun Kwak [Mon, 17 Jan 2022 02:35:17 +0000 (11:35 +0900)]
Add license declaration in source files

Change-Id: Iad0053e73a19b1dbd71ed9b3f432bd8cafc9f13d
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
2 years agoinput: add ConditionVconf property for conditional action 56/269256/3
Youngjae Cho [Wed, 12 Jan 2022 05:55:31 +0000 (21:55 -0800)]
input: add ConditionVconf property for conditional action

[EVENT_ACTION] of input.conf can now have property ConditionVconf
 - ConditionVconf=key,type,value
which set the condition for an event, so that it will trigger action
only when the given vconf meet.

Change-Id: I3dbd4484718cc3ba3b9b241ec670b28963d45f3d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: make change state wait timeout configurable 63/269263/4
Youngjae Cho [Wed, 12 Jan 2022 07:01:04 +0000 (23:01 -0800)]
power: make change state wait timeout configurable

Change-Id: I808f29e3518c643a295189accf919cd163f75e7e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: add initial power state transition on deviced startup 75/269075/4 accepted/tizen/unified/20220117.135018 submit/tizen/20220112.015321 submit/tizen/20220113.004629
Youngjae Cho [Fri, 7 Jan 2022 07:47:51 +0000 (16:47 +0900)]
power: add initial power state transition on deviced startup

The first transition is specified in init.conf. The transition is
selected by /proc/cmdline bootreason=.

Change-Id: I7ce713fac9008c5cdcc3f9a76a089bb6ebd16db8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery: introduce battery-plugin for iot-headless 23/268823/8
Youngjae Cho [Mon, 3 Jan 2022 09:35:05 +0000 (18:35 +0900)]
battery: introduce battery-plugin for iot-headless

It handles battery event according to the iot-headless policy. Those
policies are specified in battery.conf. For now it only handles event
about charger connect/disconnect.
 1. It triggers power state transition. Those transition actions are
    specified in EVENT_ACTION section.
 2. It might hold wakelock for charger connection. It is specified in
    CHARGER_WAKELOCK section.

Change-Id: Iee6803604a25bacca5ce68953033b71560ed4ba8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: introduce eventlock for iot-headless 56/268956/8
Youngjae Cho [Wed, 5 Jan 2022 07:44:15 +0000 (16:44 +0900)]
power: introduce eventlock for iot-headless

eventlock is another wakelock for guaranteeing subroutine of an event
not to go to sleep regardless of power state. Therefore, the eventlock
works independently of mainlock, which is affected by power state.
The previous templock, which was for key event, has changed to eventlock.

Change-Id: Ie6ac4cf2de6989845b2e64eefe06002147736da2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agotests: add explicit typecast on expect_check() 96/268996/1
Youngjae Cho [Thu, 6 Jan 2022 05:19:41 +0000 (14:19 +0900)]
tests: add explicit typecast on expect_check()

This suppresses mismatch of check_expected() due to sign-extended
integer of cmocka framework on 32bit architecture.

Change-Id: Ief1b52513c4d78a6373aaba7a36c97ed687768d0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agodevice-notifier: add priority to device-notifier 70/268970/5
Youngjae Cho [Wed, 5 Jan 2022 09:45:12 +0000 (18:45 +0900)]
device-notifier: add priority to device-notifier

The priority is sorted in descending order, therefore the higher
a priority is, the earlier it is invoked compared to the lower one.

Change-Id: I30c995cdb4d8b84faf1d4542b81e27052b94a9ab
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agodevice-notifier: add callback that can receive user_data 95/268895/5
Youngjae Cho [Tue, 4 Jan 2022 09:34:49 +0000 (18:34 +0900)]
device-notifier: add callback that can receive user_data

typedef int (*notify_cb_udata)(void *data, void *user_data)
 >> The callback has an additional parameter, user_data, for receiving
    user data.

typedef void (*destroy_cb_udata)(void *user_data)
 >> The callback is invoked on removing notifier with parameter
    user_data.

int __register_notifier_udata(enum device_notifier_type type,
 notify_cb_udata func, void *user_data, destroy_cb_udata func_destroy,
 const char *caller)
 >> Returns negative errno on error occured. Otherwise positive integer
    that denotes notifier id, which can be used for unregistering the
    notifier.
 >> There are two additional parameters compared to the original
    register_notifier(). One is user_data, which is passed as the
    second parameter to callback and the other is func_destroy, which
    is invoked on removing notifier.
 >> It is allowed to register multiple notifier with same callback on a
    same type, because a user_data might differ even though they have
    same callback on a same type.

int __unregister_notifier_udata(int id, const char *caller)
 >> Receives notifier id and unregisters matching notifier.

Change-Id: I46d1fec98eae19dbd9aaed60dfd84f760d152b9e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: change input.conf format and parser 30/268530/2
Youngjae Cho [Fri, 24 Dec 2021 06:15:55 +0000 (15:15 +0900)]
input: change input.conf format and parser

Change-Id: Id6170a4f43ddef3b27f876f3e049dff100ad53a0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agotool: add board opeartions 05/268305/5
Youngjae Cho [Mon, 20 Dec 2021 06:41:53 +0000 (15:41 +0900)]
tool: add board opeartions

Change-Id: I300c324d1175fe53b1b69520b4c9ba29219a91fc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoFix format specifier of type uint64_t 02/268102/1
Youngjae Cho [Thu, 16 Dec 2021 07:43:20 +0000 (16:43 +0900)]
Fix format specifier of type uint64_t

Change-Id: Icaf193fbd700ece2d74482627cf9b3f54441f671
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: apply wait callback mechanism to all state transitions 99/267999/7
Youngjae Cho [Tue, 14 Dec 2021 09:20:25 +0000 (18:20 +0900)]
power: apply wait callback mechanism to all state transitions

Generalize sleep-wait mechanism. It now always waits on changing state
if some other processes has registered change-state-wait on the state.
On transition to a next state, remove all change-state-waits that
waiting for other than the next state. If a timeout expires or all
change-state-waits are confirmed, invoke wait-done callback.

Change-Id: I573ca68c3a6c210cad479e068ee088d6a31ba54f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: remove templock timeout 79/267879/1
Youngjae Cho [Mon, 13 Dec 2021 01:37:07 +0000 (10:37 +0900)]
power: remove templock timeout

Hold templock on pressing a key unless it is released.

Change-Id: Ib7476b9aa8dc2c69b3b8d406464a56aa3a1b9aa9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: broadcast dbus signal on level triggered event 91/267791/2 submit/tizen/20211213.010124
Youngjae Cho [Fri, 10 Dec 2021 01:06:53 +0000 (10:06 +0900)]
input: broadcast dbus signal on level triggered event

Change-Id: I7561ac2086665912e0d5b3c9eec88a7eca1efaa8
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: fix dbus signal for changestate 31/267731/1 accepted/tizen/unified/20211213.133447 submit/tizen/20211210.062426
Youngjae Cho [Thu, 9 Dec 2021 08:21:47 +0000 (17:21 +0900)]
power: fix dbus signal for changestate

The dbus siganl is broadcasted on changing state
  path : /Org/Tizen/System/DeviceD/Power
  iface: org.tizen.system.deviced.Power
  name : ChangeState
  param: "(iti)"
         int32 : type (0: sleep, 1: wakeup)
 uint64: state transition id
 int32 : state transition reason

Change-Id: I04c01722fbdbf59fa2c9eae0c9b819e3aee77488
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: rework sleep-wait 07/267707/5
Youngjae Cho [Thu, 9 Dec 2021 04:21:05 +0000 (13:21 +0900)]
power: rework sleep-wait

The sleep-wait now works based on a single list. Whenever entering
to PSM_SLEEP, all sleep-waits, which had been registered by processes
through device API, will be added to the list waiting for confirmation.

Change-Id: Iebb1b177914847ee9c38ce8bf5fc01bb70d1f3c6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: introduce power-state-manager for iot-headless 48/267648/2
Youngjae Cho [Wed, 8 Dec 2021 07:10:32 +0000 (16:10 +0900)]
power: introduce power-state-manager for iot-headless

Change-Id: I7b4d299d4f05585762b6c3f72d90e8e978eab2e0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agousb: reimplementing sdb default enable mode and removeing engineer mode 48/267348/4
INSUN PYO [Thu, 2 Dec 2021 05:08:34 +0000 (14:08 +0900)]
usb: reimplementing sdb default enable mode and removeing engineer mode

By changeing vconf default key,
public tizen always operates in sdb enable mode.

Change-Id: I00b3c0707cda880a06225c359d6d551f80f4d089

2 years agoinput: fix bug 51/267351/1
Youngjae Cho [Thu, 2 Dec 2021 03:58:44 +0000 (12:58 +0900)]
input: fix bug

Change-Id: Ie3876548648558d5ac7642fc95d93d92587b566f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: make input configurable 41/267241/6
Youngjae Cho [Tue, 30 Nov 2021 07:14:08 +0000 (16:14 +0900)]
input: make input configurable

Change-Id: I920de2208c1c01a59235933f408b227e71237828
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: change longpress interval to 7000ms 88/267188/1
Youngjae Cho [Mon, 29 Nov 2021 07:40:01 +0000 (16:40 +0900)]
input: change longpress interval to 7000ms

Change-Id: Id7677167e28e6fb48c45aa4470b037ae07f79da4
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoFix SVACE issue 30/267130/1
Hyotaek Shim [Fri, 26 Nov 2021 05:20:13 +0000 (14:20 +0900)]
Fix SVACE issue

Change-Id: I2336155180610fbd0bfadb660e8509f845a2408d
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agopower: emit signal on wakeup 42/266842/1
Youngjae Cho [Fri, 19 Nov 2021 08:46:56 +0000 (17:46 +0900)]
power: emit signal on wakeup

path       : /Org/Tizen/System/DeviceD/Power
interface  : org.tizen.system.deviced.Power
signame    : wakeup
parameter  : "(ii)"
             uint64: current time in milisecond
     uitn64: wakeup reason (refer device API)

Change-Id: I8078b056b8f22e86c545ceb291959fbe62bc6869
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: introduce sleep-wait for iot-headless 90/266690/6
Youngjae Cho [Wed, 17 Nov 2021 07:44:55 +0000 (16:44 +0900)]
power: introduce sleep-wait for iot-headless

Sleep-wait defers wake unlock if somebody wants to defer sleep for a
short duration. For example, system might want to notify user that it
is going to sleep by alarming sound. To play sound, system must hold
running state for a moment.

One who wants to defer sleep must request sleep-wait. On receiving
signal that sleep is requested, it processes todo list before going to
sleep. And after finishing the job, it must confirm that it is OK to go
into sleep. For now, deviced waits maximum of 5 seconds, and after this
timeout, wake unlock even someone hasn't confirmed the sleep-wait.

Sleep-wait offers dbus methods.
   1. Adding sleep-wait for deferring sleep
      path       : /Org/Tizen/System/DeviceD/Power
      interface  : org.tizen.system.deviced.Power
      member     : AddSleepWait
      parameter  : no parameter
      return     : "(i)", 0 on success, negative on error.

   2. Removing sleep-wait
      path       : /Org/Tizen/System/DeviceD/Power
      interface  : org.tizen.system.deviced.Power
      member     : RemoveSleepWait
      parameter  : no parameter
      return     : no return

   3. Confirming sleep-wait, which notifies deviced that it is OK
      to go into sleep.
      path       : /Org/Tizen/System/DeviceD/Power
      interface  : org.tizen.system.deviced.Power
      member     : ConfirmSleepWait
      parameter  : "(i)", sleep id to confirm
      return     : "(i)", 0 on success, negative on error.

Change-Id: I58860ab7633c3863cc3ee06befc49b0e152934fe
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: change shortkey/longkey interval 12/266812/1
Youngjae Cho [Fri, 19 Nov 2021 03:01:32 +0000 (12:01 +0900)]
input: change shortkey/longkey interval

Change-Id: I466c591b754c906fe9b77854e4fca43b4f78ac26
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoinput: acquire temporal lock on pressing key 65/266765/6
Youngjae Cho [Thu, 18 Nov 2021 09:07:03 +0000 (18:07 +0900)]
input: acquire temporal lock on pressing key

To process shortkey/longkey during autosleep is enabled, it must be
prevented to re-enter sleep right after the device is woken up by
key press. Therefore, hold wakelock temporarily during key pressed.

Change-Id: I9d4f282fcae0beeec9edb97e463f4b0eef2bfacb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: emit signal before sleep on iot-headless 99/266699/5
Youngjae Cho [Wed, 17 Nov 2021 09:08:32 +0000 (18:08 +0900)]
power: emit signal before sleep on iot-headless

path      : /Org/Tizen/System/DeviceD/Power
interface : org.tizen.system.deviced.Power
name      : "sleep"
parameter : "(tt)"
            uint64, current time in milisecond
    uint64, sleep id

Change-Id: I1664898bf3f475125ad8bb3cafbd8a2c45948841
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: move sleep configuration to power 53/266653/2
Youngjae Cho [Wed, 17 Nov 2021 01:17:14 +0000 (10:17 +0900)]
power: move sleep configuration to power

Change-Id: I5d6d7054149134bdea68f85802414e7783f8265d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agobattery: invalidate battery vconf when battery disconnected 25/266425/3
Youngjae Cho [Fri, 12 Nov 2021 05:53:00 +0000 (14:53 +0900)]
battery: invalidate battery vconf when battery disconnected

Change-Id: I4afad3783088c1cb1a7a8ef63b9535907b0a20ad
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agopower: support autosleep for iot-headless 70/265570/7 accepted/tizen/unified/20211110.122329 submit/tizen/20211109.045047
Youngjae Cho [Fri, 22 Oct 2021 07:02:10 +0000 (16:02 +0900)]
power: support autosleep for iot-headless

Change-Id: Ia0ff76a4fa301708939abf197f0abaa92aad5c10
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
2 years agoextcon: check condition variable for extcon init and deinit 20/266120/3
INSUN PYO [Mon, 8 Nov 2021 05:53:42 +0000 (14:53 +0900)]
extcon: check condition variable for extcon init and deinit

Change-Id: Ib7956980d1d82991d866666c82ac5fb39a9885ed

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

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

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

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

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

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