platform/core/system/deviced.git
3 months agoinput: Add input plugin backend module test 45/320345/1 tizen_8.0
Yunhee Seo [Tue, 15 Oct 2024 10:19:33 +0000 (19:19 +0900)]
input: Add input plugin backend module test

To test input module plugin backend loading and initializing,
this is necessary.
With this, plugin backend initialization and key input event callback
can be tested.

Change-Id: Ic111aaa5b257eb63a8e445721370f8030aecfe7b
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
10 months agopower: Modify the code to keep code consistency 70/315970/1 accepted/tizen_8.0_unified accepted/tizen/8.0/unified/20240813.163313
Yunhee Seo [Fri, 9 Aug 2024 11:44:28 +0000 (20:44 +0900)]
power: Modify the code to keep code consistency

To keep code quality and readability,
these modifications are added.
1. Remove unofficial abbreviations in function/variable name.
2. Change void return type function to return int type.
3. Add return value checking and debug message.

Change-Id: I2bd738db09beb10cf5a79ba7d95ce2deea399595
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
10 months agopower: Add handling code to safely manage power state waiting list 00/315900/3 accepted/tizen/8.0/unified/20240812.154114
Yunhee Seo [Fri, 9 Aug 2024 05:45:44 +0000 (14:45 +0900)]
power: Add handling code to safely manage power state waiting list

While the power state is changing, power state change waiting list can be cleaned up.
However before cleaning up, if remove_change_state_wait() was called,
struct csw in the waiting list can be free twice.
To avoid double free problem, handling code is added.

Change-Id: Id4646b2656688c2f9e091033f7b6ab3e08c930fa
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
10 months agodisplay: Support dim brightness setting 61/315261/1 accepted/tizen/8.0/unified/20240731.160737
Yunhee Seo [Mon, 29 Jul 2024 07:05:57 +0000 (16:05 +0900)]
display: Support dim brightness setting

The dim brightness setting feature had been supported before
but it was no longer available after ce471ec18f19bb184848f4c84e813b834ef4bdee commit.
Although there were descriptions and functions provided for setting dim brightness,
it's not right that it cannot be used, so it is restored.

Change-Id: I6b03d7c12b359a3d24ecd4305f904f97f80decd1
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
11 months agoAdd setter/getter tool for upgrade type 03/314203/1 accepted/tizen/8.0/unified/20240710.161341
Mateusz Moscicki [Fri, 28 Jun 2024 14:16:34 +0000 (16:16 +0200)]
Add setter/getter tool for upgrade type

To make upgrade type settable and gettable, corresponding tools are
added:
 * device_board_get_upgrade_type
 * device_board_set_upgrade_type

Change-Id: Ie86d474e2e23d9d894cab49ae4c0efea74ec056a

11 months agoAdd smack privilege as 'System::Tools' to device_board_* tools 79/313379/2
SangYoun Kwak [Tue, 25 Jun 2024 04:56:46 +0000 (13:56 +0900)]
Add smack privilege as 'System::Tools' to device_board_* tools

To set privilege and prohibit accesses to the device_board_* commands,
smack label 'System::Tools' is added.

Change-Id: I41a20162372a46fa238e2091053db972cdb01364
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
11 months agodisplay: Fix EOPNOTSUPP to ENOSYS 32/313332/1
Youngjae Cho [Mon, 24 Jun 2024 06:04:42 +0000 (15:04 +0900)]
display: Fix EOPNOTSUPP to ENOSYS

The error ENOTSUP and EOPNOTSUPP are both 95 so they cannot be
distinguished. Therefore, fixed the EOPNOTSUPP to ENOSYS.

 ENOSYS  38  Function not implemented

The deviced plugin-api has changed to return ENOSYS if there is
display plugin backend but it hasn't implemented an operation.

Change-Id: I838dd104fdc0cd7bb01f1567bfb51bfffe6c5139
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Remove display-plugin 96/313096/2
Youngjae Cho [Wed, 19 Jun 2024 04:14:15 +0000 (13:14 +0900)]
display: Remove display-plugin

The display plugin has been replaced with the libsyscommon plugin api
for the several previous patches. And finally, it is now totally
replaced so remove the empty display-plugin from the deviced core.

Change-Id: Ia3e78a7ac8a9aeda637efd7aaa556560da018493
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Replace proc_change_state() with plugin api 95/313095/2
Youngjae Cho [Wed, 19 Jun 2024 03:59:39 +0000 (12:59 +0900)]
display: Replace proc_change_state() with plugin api

Change-Id: I8c0887c50078a9904f0b04996bb6df773154355f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Remove plugin initialized display states 94/313094/2
Youngjae Cho [Wed, 19 Jun 2024 02:03:05 +0000 (11:03 +0900)]
display: Remove plugin initialized display states

The core operations has changed to only work on top of default states.
Only wearable is working with its own states but it can figure out
the states by its plugin functions internally regardless of the default
states. Likewise, the core operations are not using the plugin states
if it works in a default way. Therefore, as the deviced core states
and plugin states are totally working independently, the deviced core
has changed not to manage plugin states.

Change-Id: I3e08d77285bfb87a8be0925548b0987b3f78e2cd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Pull out display config from display_plugin structure 93/313093/2
Youngjae Cho [Mon, 17 Jun 2024 11:49:56 +0000 (20:49 +0900)]
display: Pull out display config from display_plugin structure

The display configuration is managed by both the core and plugin. It is
initialized by the plugin first, and then overwritten by the core
config parser. Therefore, it has become a part of the core but work with
plugin api that passes plugin backend's predefined configurations.

Change-Id: I3395e72a2c96b6b4ffe0885dabd882219e372377
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Change system_wakeup_flag from plugin to misc function 92/313092/2
Youngjae Cho [Mon, 17 Jun 2024 11:21:07 +0000 (20:21 +0900)]
display: Change system_wakeup_flag from plugin to misc function

The system_wakeup_flag has nothing to do with plugin but, rather, a
runtime information that controlled by battery module. Therefore, it
is proper that the deviced core manages the value.

Change-Id: I62849c827aa688733da8689a37d1fb5c0ad22b37
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Replace auto brightness with plugin api 91/313091/1
Youngjae Cho [Mon, 17 Jun 2024 11:12:58 +0000 (20:12 +0900)]
display: Replace auto brightness with plugin api

The reset_autobrightness_min has removed and it is intended to be a
part of plugin implementation, .set_auto_brightness_min.

Change-Id: Ie5eeb1bab5a3a8b78a0f6e034dbf2b6b82708e87
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Replace powersaving mode with plugin api 90/313090/1
Youngjae Cho [Mon, 17 Jun 2024 09:09:46 +0000 (18:09 +0900)]
display: Replace powersaving mode with plugin api

Change-Id: I40ac2bd8f713369bcd0ac6d6b94d464efb2af705
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Replace backlight_ops with display plugin api 89/313089/1
Youngjae Cho [Mon, 17 Jun 2024 08:44:25 +0000 (17:44 +0900)]
display: Replace backlight_ops with display plugin api

Change-Id: I1e9471225707f63210898889f22014771555ebc0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
11 months agodisplay: Add omitted return value 50/313050/1 accepted/tizen/8.0/unified/20240619.075741
Yunhee Seo [Tue, 18 Jun 2024 10:44:45 +0000 (19:44 +0900)]
display: Add omitted return value

If display fails loading hal backend, load_display_hal_backend should be returned
right away.
However, return code line was omitted from 6195ac94623f2c756fa3a52adc6fd0234d8e97b2 commit.
In the process of moving the code, it was accidentally omitted.

Change-Id: Idc28ee26c965f3269334939198d7fccd3d8cd6cd
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
11 months agoplugin: mobile: display: Remove key-filter 99/312799/1 accepted/tizen/8.0/unified/20240618.013352
Yunhee Seo [Fri, 14 Jun 2024 08:06:54 +0000 (17:06 +0900)]
plugin: mobile: display: Remove key-filter

Remove key-filter file.
By completely moving the key-filter code to mobile profile plugin backend git,
it can be deleted.
Furthermore, these key manipulation logic is much closer to input module,
these logics are moved to mobile backend input module properly.

Change-Id: I06d1350b6f9f9446eafb05bac4b972aa1053f6f9
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
11 months agoAdd setter/getter tool for upgrade state 67/312767/3
SangYoun Kwak [Wed, 5 Jun 2024 07:48:33 +0000 (16:48 +0900)]
Add setter/getter tool for upgrade state

To make upgrade state settable and gettable, corresponding tools are
added:
 * device_board_get_upgrade_state
 * device_board_set_upgrade_state

Since the names "upgrade status" and "upgrade state" are similar,
to distinguish them, "upgrade status" is renamed as
"upgrade progress status".

Change-Id: Ia25aac24c1c48e375f152b1a8d999ecc1b95ed0a
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
11 months agoled: Add touchled resource driver 92/312792/1
Yunhee Seo [Fri, 14 Jun 2024 07:27:31 +0000 (16:27 +0900)]
led: Add touchled resource driver

New attribute:
 - id: DEVICED_TOUCHLED_ATTR_INT_BACKLIGHT
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: O
 - getter: X

There is touchled function usage case from plugin-backend side,
therefore touchled resource driver is newly added.
To control touchled key manipulation, above attribute is added.

Change-Id: Id8fa30d4424b3536fc0c510db5592b90931c0d96
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agodisplay: Add attributes related to display state manipulation 91/312791/1
Yunhee Seo [Fri, 14 Jun 2024 07:24:33 +0000 (16:24 +0900)]
display: Add attributes related to display state manipulation

New attribute:
 - id: DEVICED_DISPLAY_ATTR_LOCKSCREEN_BG_STATE
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: X
 - getter: O

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_LCDOFF_REASON
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: O
 - getter: X

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_STATE_TRANSITION
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: O
 - getter: X

The corresponding attributes may be changed during the
display state refactoring process.
These are necessary for plugin backend separation.

Change-Id: I45675dae18af894cc6fb2ca80f590ea15ab138f1
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agoAdd display.conf installation 15/312715/3
Yunhee Seo [Thu, 13 Jun 2024 08:32:47 +0000 (17:32 +0900)]
Add display.conf installation

As iot-headed profile was deleted, there was no default display configuration file installed.
In order to support basic display configuration in the headed profile,
this is necessary.

Change-Id: I09763d01b2a981539e91849006fbedbe209b49f7
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agoplugin: mobile: display: Remove unused bezel wakeup 42/312442/4
Yunhee Seo [Mon, 10 Jun 2024 07:04:30 +0000 (16:04 +0900)]
plugin: mobile: display: Remove unused bezel wakeup

At first, bezel wakeup is added for wearable target from below commit.
78129922508e82a8304ef5b1add270e2ff93fb67
After that, this was copied to all plugins from below commit.
ce471ec18f19bb184848f4c84e813b834ef4bdee

Actually, bezel wakeup was for wearable target, and it was not
used properly from other plugins.
Because bezel wakeup is notified only in wearable plugin,
there was no code to notify bezel wakeup from deviced, since the
commit was added.
Thus, bezel wakeup is removed from mobile plugin.

Change-Id: I577a5888636ec090458590b9aa92c323d15b8913
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agoplugin: mobile: display: Remove proc_change_state() 66/312366/5
Yunhee Seo [Fri, 7 Jun 2024 11:12:50 +0000 (20:12 +0900)]
plugin: mobile: display: Remove proc_change_state()

As removed unnecssary proximity dependency,
proc_change_state() can be removed from mobile plugin.

Change-Id: I7a492dfe9ee526df89cb9801f50b0b5bba1bcf82
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agoplugin: mobile: display: Remove unused proximity getter/setter 27/312227/5
Yunhee Seo [Wed, 5 Jun 2024 07:08:38 +0000 (16:08 +0900)]
plugin: mobile: display: Remove unused proximity getter/setter

Since the addition of proximity getter/setter from commit I3ee82aafab34390d6907239c2ab6542540f3abf7,
proximity setter has never been used.
Because proximity setter is not used at all, getter also has become
meaningless.
Before moving the plugin mobile display code,
unused and meaningless code logic part is deleted.

Change-Id: Idff2c2a5adf3fd7bc8862447f5f5dd3512d0b396
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agosyscommon-plugin-test: Add plugin display module test code 80/312180/5
Yunhee Seo [Wed, 5 Jun 2024 01:01:24 +0000 (10:01 +0900)]
syscommon-plugin-test: Add plugin display module test code

To test plugin backend display functions, test code is added.

Change-Id: I4b9950df731974df42a44817b51e96d1a12d5ce0
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agosyscommon-plugin-test: Add plugin battery module test code 79/312179/5
Yunhee Seo [Mon, 3 Jun 2024 10:11:14 +0000 (19:11 +0900)]
syscommon-plugin-test: Add plugin battery module test code

From the tizen 8.0 image, plugins could be separated into plugin-backend
through libsyscommon plugin api and interface implementation.
However, there was no place where the plugin backend module was installed and used,
so it was unable to test it.
Therefore, test code is added that can test the installed plugin backend
regardless of the type of plugin backend and feature support.
If there is a plugin backend module .so file, you can test the module function
with gtest unit.

Also, there are still many plugin functions that have not been separated,
but it will be helpful with this test code.

Change-Id: Iddf34a0074dfbe42a076f47636949a33217792d6
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agodisplay: Fix plugin api error handling 24/312724/2
Youngjae Cho [Thu, 13 Jun 2024 06:32:17 +0000 (15:32 +0900)]
display: Fix plugin api error handling

The deviced plugin api has changed to return two special error case.
 1. -ENOTSUP
    : It specifies loading fail of plugin backend
 2. -EOPNOTSUPP
    : It succeeded backend loading but the loaded backend has no
      implemented operation.
Both cases take alternative fallback - the predefined default routine
by the deviced. Other nagative values are considered as error of
backend implementation itself so it won't take the default routine.

Change-Id: I854cb9ea5403e163a5acb425f5d98bb61d8c968e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Replace display on/off plugin call with plugin api 23/312723/1
Youngjae Cho [Thu, 13 Jun 2024 05:49:12 +0000 (14:49 +0900)]
display: Replace display on/off plugin call with plugin api

Change-Id: Ia845efa9ae0e557a51245487c12a2197ef5a52a9
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Replace enum device_flags with deviced_event 33/312633/2
Youngjae Cho [Wed, 12 Jun 2024 02:21:39 +0000 (11:21 +0900)]
display: Replace enum device_flags with deviced_event

The enum device_flags comprised two kind of semantics, one is 'mode'
that controls devices in a specific way, and the other is 'event'
that used to be used as a reason by which an operation of the deviced
is triggered.

Throughout the several previous patches, all the 'mode' flags except
NORMAL_MODE has been removed. Therefore, flag becomes having no choice
but NORMAL_MODE for 'mode', so the NORMAL_MODE can be remove as well.

And the remaining 'event' related flags are replaced with enum
deviced_event that come from the libsyscommon. Currently, the previous
LCD_ON_BY_EVENT or LCD_OFF_BY_EVENT, which didn't specify a specific
event but just event, have been replaced with DEVICED_EVENT_UNKOWN.

Change-Id: Id9f267729ee8fddebde9ae19f8c263659534da61
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Remove enum TOUCH_SCREEN_OFF_MODE 32/312632/2
Youngjae Cho [Tue, 11 Jun 2024 11:02:23 +0000 (20:02 +0900)]
display: Remove enum TOUCH_SCREEN_OFF_MODE

All call for touchscreen_stop(TOUCH_SCREEN_OFF_MODE) have been replaced
with call touchscreen_set_state() directly, not via touchscreen_stop().

The display dbus method "StayTouchScreenOff" has been deprecated.
Instead, it can do the same thing that "Disable" method of touchscreen
module by disabling touchscreen.

Change-Id: Ic72cbdc6635afd691129d3256aa9a034b71cb2ae
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Remove enum LCD_PANEL_OFF_MODE 31/312631/2
Youngjae Cho [Tue, 11 Jun 2024 04:29:14 +0000 (13:29 +0900)]
display: Remove enum LCD_PANEL_OFF_MODE

No need to take care LCD_PANEL_OFF_MODE flag via parameter throughout
display on/off subroutines. Whenever it is required, just enquire
and get the value using display_panel_get_lcd_paneloff_mode().

Change-Id: Ibd987bb08a718f437b4cdeddc290d9e719593f42
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Remove setter for DEVICED_DISPLAY_ATTR_INT_DPMS_STATE 30/312630/2
Youngjae Cho [Tue, 11 Jun 2024 04:02:02 +0000 (13:02 +0900)]
display: Remove setter for DEVICED_DISPLAY_ATTR_INT_DPMS_STATE

The attribute setter is currently not being used. Moreover, controlling
DPMS from plugin should be prevented as it could ignore and bypass
internal state of the deviced. Only getter is allowed.

Change-Id: Ib473744960c6b67b9a3f657fc240354d098d4f38
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Remove ambient-mode(AOD) code 29/312629/2
Youngjae Cho [Mon, 10 Jun 2024 08:28:28 +0000 (17:28 +0900)]
display: Remove ambient-mode(AOD) code

Change-Id: Ia06d29e50c11b48b74bd544cedf699330bfb1301
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodevices: Remove enum CORE_LOGIC_MODE 28/312628/2
Youngjae Cho [Mon, 10 Jun 2024 07:11:24 +0000 (16:11 +0900)]
devices: Remove enum CORE_LOGIC_MODE

The CORE_LOGIC_MODE is no more than probing and then initializing, or
deinitializing a device. It can be handled by calling probe()/init()
or exit() of device_ops. Therefore, no need to do it within
device_ops->start()/stop() based on the parameter CORE_LOGIC_MODE.
Fix it to directly call probe/init/exit on receiving dbus request
for start/stop device. It is logically same as the previous.

Change-Id: I86285bd5c41a958030d176c32003c61770a72c36
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Add lockscreen attribute and replace existing plugin call 70/312270/3
Youngjae Cho [Wed, 5 Jun 2024 10:47:56 +0000 (19:47 +0900)]
display: Add lockscreen attribute and replace existing plugin call

The lockscreen is solely controlled by the deviced itself, not by any of
plugins. Therefore the lockscreen getter doesn't need to call plugin
api for asking lockscreen state. Rather, display resource driver should
manage the lockscreen state, offering it via resource-manager getter to
plugins.

Change-Id: I9b956294f8e577925044cc837e1279eb843b685d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Use plugin-api on detecting setting value update 56/312256/3
Youngjae Cho [Wed, 5 Jun 2024 06:55:19 +0000 (15:55 +0900)]
display: Use plugin-api on detecting setting value update

Plugin can now receive occurance of setting value change via plugin
interface operation, on_changed_setting_value(), so the plugin can
hook the event and handle it based on its own policy. If the plugin
haven't implemented the operation, deviced handle it in a default way.

Change-Id: I3bc4b3bd3fe35a78b2c29a9603f3040b103e0c99
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agodisplay: Remove unused plugin handle 54/312254/1
Youngjae Cho [Wed, 5 Jun 2024 04:39:10 +0000 (13:39 +0900)]
display: Remove unused plugin handle

Change-Id: I060ef5c9fe29da23865c9e2bbdffee75c56b4f19
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
12 months agoplugin: Remove battery module from mobile plugin 77/311977/2
Yunhee Seo [Fri, 31 May 2024 08:11:26 +0000 (17:11 +0900)]
plugin: Remove battery module from mobile plugin

The existing deviced plugin battery module was highly dependent on the battery inside the deviced(core)
and used the function, data structures directly, which effectively faded the
meaning of the plugin.

By completely moving the code to mobile profile plugin backend git and
removing the build dependency, it became possible to delete the
corresponding plugin's battery module.

Since there is no need for the remaining code to exist in the deviced git anymore,
battery module in mobile plugin is deleted.

Change-Id: I1b1d98ecc9434dd0891c8a9ebead870b2a9e3d4e
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agoplugin: battery: Replace battery function to syscommon resource driver call 76/311976/2
Yunhee Seo [Fri, 31 May 2024 04:02:59 +0000 (13:02 +0900)]
plugin: battery: Replace battery function to syscommon resource driver call

Before move plugin code to mobile plugin backend side, all functions
that depend on deviced must be replaced with syscommon resource driver function.
By removing the dependency, plugin code in deviced can be transferred to plugin backend.

Change-Id: I8b7e6c585ee400a10b54a9e00f51c1a9323b24bf
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agodisplay: Add attribute for setting display state with option 75/311975/2
Yunhee Seo [Thu, 30 May 2024 12:44:41 +0000 (21:44 +0900)]
display: Add attribute for setting display state with option

New attribute:
 - id: DEVICED_DISPLAY_ATTR_TUPLE2_CURRENT_STATE_WITH_OPTION
 - type: SYSCOMMON_RESMAN_DATA_TYPE_2_UINT64
 - setter: O
 - getter: X
 - 1st param: enum deviced_event
 - 2nd param: enum syscommon_deviced_display_state

New attribute:
 - id: DEVICED_DISPLAY_ATTR_TUPLE4_LOCK_WITH_OPTION
 - type: SYSCOMMON_RESMAN_DATA_TYPE_4_UINT64
 - setter: O
 - getter: X
 - 1st param: enum deviced_event
 - 2nd param: enum syscommon_deviced_display_state
 - 3rd param: display state flag (Macro starts with DEVICED_DISPLAY_STATE_*)
 - 4th param: timeout

New attribute:
 - id: DEVICED_DISPLAY_ATTR_TUPLE3_UNLOCK_WITH_OPTION
 - type: SYSCOMMON_RESMAN_DATA_TYPE_3_UINT64
 - setter: O
 - getter: X
 - 1st param: enum deviced_event
 - 2nd param: enum syscommon_deviced_display_state
 - 3rd param: display lock flag (Macro starts with DEVICED_LOCK_*)

When the display state or display lock changing, some options are needed like below
- time for locking or display state changing, triggered pid, lcd state, etc.
To support above function, new attributes are added.

Change-Id: Ifd2ef9ef33a0a3197d3ef5eb35a3e8a73c512844
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agobattery: Add attribute for handling abnormal battery health 74/311974/2
Yunhee Seo [Thu, 30 May 2024 07:37:32 +0000 (16:37 +0900)]
battery: Add attribute for handling abnormal battery health

New attribute:
 - id: DEVICED_BATTERY_ATTR_BOOL_DO_NOT_DISTURB
 - type: SYSCOMMON_RESMAN_DATA_TYPE_BOOLEAN
 - setter: X
 - getter: O

New attribute:
 - id: DEVICED_BATTERY_ATTR_INT_LOW_BATTERY_POPUP
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: O
 - getter: X
 - 1st param: enum syscommon_deviced_battery_option_type

In order to handle abnormal battery health status, above battery attributes are needed.
To support above attribute getter/setter,
enum battery_option_type is replaced by enum syscommon_deviced_battery_option_type from libsyscommon.

Change-Id: I604e478e6c530dc55f1f287196cf31f2da024762
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agobattery: Add attribute getter for battery health status 33/311833/4
Yunhee Seo [Wed, 29 May 2024 01:08:28 +0000 (10:08 +0900)]
battery: Add attribute getter for battery health status

New attribute:
 - id: DEVICED_BATTERY_ATTR_INT_STATUS_HEALTH
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: X
 - getter: O

New attribute:
 - id: DEVICED_BATTERY_ATTR_STRING_STATUS_HEALTH
 - type: SYSCOMMON_RESMAN_DATA_TYPE_STRING
 - setter: X
 - getter: O

To support above attributes getter, below functions are added.
- int power_supply_get_battery_status_health(int *battery_health);
- int power_supply_get_battery_status_health_string(char **battery_health_s);

In below description, "core" means deviced battery module side.

Before deviding mobile plugin battery module, battery resource driver is needed.
Because struct battery_status was used directly receiving and using the address
of the structure in the core battery module.
However, above method of used is very dependent on the deviced
and is not a desirable method, struct pointer should be removed from plugin side.
Through battery resource driver, plugin can use core side battery attributes without dependency.
In order to add these attributes, new file resource-battery.c is added.
As applying this, enumeration for health_type is moved to libsyscommon
for common usage between plugins and core side.

Change-Id: Id7a897564a5b32c45a05f9056434a75fd27cf59c
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agoplugin: mobile: battery: Remove check_power_supply_noti() from mobile plugin 32/311832/1
Yunhee Seo [Thu, 23 May 2024 06:41:44 +0000 (15:41 +0900)]
plugin: mobile: battery: Remove check_power_supply_noti() from mobile plugin

check_power_supply_noti() decides whether to notify battery full or not.
Previously, while separating the plugin,
the deletion part was inevitably reflected late due to the work sequence.
However, since the plugin-backend/deviced-mobile separation worked well,
and there is no need for it to exist in deviced project any longer,
deleting it is appropriate.

However, since this function exists in the wearable, function pointer initialization is only deleted from the mobile plugin.
And that part is replaced with a syscommon_plugin_deviced_battery_is_possible_to_notify_battery_full().
It calls plugin-backend/deviced-mobile function.

In order to delete the dependency on mobile plugins, this deletion is necessary.

Change-Id: I3edfef59f3c42285c50b603fdbd9b8b068f22902
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
12 months agodisplay: Add getter for lock count and signal on count changed 36/311636/2 accepted/tizen/8.0/unified/20240524.142351
Youngjae Cho [Thu, 23 May 2024 02:38:20 +0000 (11:38 +0900)]
display: Add getter for lock count and signal on count changed

The dbus method "PmlockGetLockCount" has been added to get lock count.
And the dbus signal "PowerLockCountChanged" has also been added for
broadcasting on every display lock/unlock. The existing method
"PmlockGetLockState" and signal "PowerLockCountChanged" only say in
'locked' or 'unlocked', however, the "PmLockGetLockCount" and
"PowerLockCountChanged" respond in number.

Change-Id: Ia5aeedd0693ffc0142d3695fcab864d84fd6ad42
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
13 months agodisplay: Add exclusive dim timeout 88/310388/1
Youngjae Cho [Wed, 17 Apr 2024 12:03:55 +0000 (21:03 +0900)]
display: Add exclusive dim timeout

Timeout for dim had always been derived from screen timeout in a ratio
LCD_DIM_TIMEOUT, which is 30% of total screen timeout, naturally in
turn, the remaining 70% is given to normal timeout.

Introduced a new timeout, exclusive dim timeout, that fixes dim timeout
by itself. It is -1 by default, meaning disabled. If it is nonnegative
value, dim timeout is fixed to the value regardless of the screen timeout.
In such case, as dim timeout doesn't share screen timeout, normal timeout
consumes the entire screen timeout as a result.

The exclusive dim timeout is controlled by vconf 'db/setting/timeout_dim'
and it takes time in second.

For example,
 1. db/setting/lcd_backlight_normal = 15
    db/setting/timeout_dim = -1
     => Normal(10.5s) + Dim(4.5s)
    : Work as before. The screen timeout is splitted into 7:3,
      normal state consumes 10.5s and dim state 4.5s.

 2. db/setting/lcd_backlight_normal = 15
    db/setting/timeout_dim = 5
     => Normal(15s) + Dim(5s)
    : The exclusive dim timeout is 5s. The screen timeout, 15s, is not
      given to dim state. Therefore normal state solely consumes the
      entire 15s. After consuming up its 15s, it changes state to dim
      and the dim starts consuming its exclusive timeout, 5s.

 3. db/setting/lcd_backlight_normal = 15
    db/setting/timeout_dim = 0
     => Normal(15s) + Dim(0s)
    : Same as above except that the exclusive dim timeout is 0s.
      It effectively skips dim state.

Change-Id: Id345c7a8cae21c3dd56208185109ee738dccd909
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
14 months agoAdd plugins to deviced ISU configuration 71/308271/1 accepted/tizen/8.0/unified/20240321.151240
Adam Michalski [Fri, 15 Mar 2024 11:12:47 +0000 (12:12 +0100)]
Add plugins to deviced ISU configuration

Additionally it adds rndis.service to ISU configuration.

Change-Id: Iba93315f929bf68b96df2e51d8918f26e3ffd827
(cherry picked from commit 6e21e8ad63ab938f797154e06262877ad0236cd5)

15 months agobattery: Relocate remove_health_popup() from mobile plugin 30/307330/1
Yunhee Seo [Thu, 7 Mar 2024 01:47:43 +0000 (10:47 +0900)]
battery: Relocate remove_health_popup() from mobile plugin

*In this description, "core" refers to the deviced module below src.

Move function remove_health_popup from mobile plugin to core battery module.

[Reason]
When the battery health status is abnormal, core battery module reuqests launching popup.
The location where it requests to add or remove pop-ups is different.
Actually, battery health management responsibility should be moved to core battery module.
Because overall battery health is manged in core battery moudle not mobile plugin.
Also, remove_health_popup() is used only power-supply in core battery module.

As explained above, it can be seen that shotgun surgery and feature envy code smells
from the remove_health_popup().

[How to]
Delete the function from the mobile plguin battery module and move it to
the deviced core battery module.

Change-Id: I6e968e53552e41db947218b95ad3b1c98b74cf90
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
16 months agopower: Remove duplicate operation 03/304603/1 accepted/tizen/8.0/unified/20240125.160922
youngjae [Thu, 18 May 2023 02:52:13 +0000 (11:52 +0900)]
power: Remove duplicate operation

Change-Id: I00ebd2f5883dc4aec26146cdfd99e66caebaa221
Signed-off-by: youngjae <y0.cho@samsung.com>
17 months agodisplay: Add pmlock type and power lock type conversion 42/303942/1 accepted/tizen/8.0/unified/20240109.155444
Yunhee Seo [Mon, 8 Jan 2024 08:18:13 +0000 (17:18 +0900)]
display: Add pmlock type and power lock type conversion

When the emit power lock state signal, it was omitted pmlock and power lock conversion from deviced.
For accurate signal emitting, this is necessary.

Change-Id: I59dc9eab4001812d86e76b4cc325ab3f8c9ba777
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
18 months agoFixing 100% CPU load after first mouse move 42/302742/1 accepted/tizen/8.0/unified/20231214.075346
Daniil Ruban [Fri, 1 Dec 2023 12:16:22 +0000 (13:16 +0100)]
Fixing 100% CPU load after first mouse move

The issue could be found in `input_callback`. Due to not proper
initialization of `input_event_handler_list` `input_callback` just
exits before read the incoming `libinput` event (ie call `libinput_dispatch`).
So these events are collected and lead to memeory/cpu-load leak.
Because the same event will try to call the callback while it will not be
'dispatched'

Change-Id: I3ad336faba40e88caaba988c1e9c0efdc8906823
Signed-off-by: Daniil Ruban <intx82@gmail.com>
18 months agobattery: Remove low battery state notifying 46/301646/4 accepted/tizen/8.0/unified/20231123.173026
Yunhee Seo [Tue, 17 Oct 2023 07:40:41 +0000 (16:40 +0900)]
battery: Remove low battery state notifying

Below dbus method is removed from commit 55a6ef08adcc1e75439d31cbdd9d4dce72fabe7d.
METHOD_LOW_NOTI_ON          "BatteryLowNotiOn"
METHOD_LOW_NOTI_UPDATE      "BatteryLowNotiUpdate"
METHOD_LOW_NOTI_OFF         "BatteryLowNotiOff"
METHOD_CRITICAL_NOTI_ON     "BatteryCriticalNotiOn"
METHOD_CRITICAL_NOTI_UPDATE "BatteryCriticalNotiUpdate"
METHOD_CRITICAL_NOTI_OFF    "BatteryCriticalNotiOff"

After removed that dbus methods from system-popup, deviced code was not removed.
It is calling functions that does not exist.
Thus, meaningless dbus method calls are removed.

Change-Id: I8a1de226ca9e644e0786d8140d1013a7173dc77c
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
18 months agobattery: Remove update_ovp() from plugins 45/301645/3
Yunhee Seo [Tue, 17 Oct 2023 06:42:54 +0000 (15:42 +0900)]
battery: Remove update_ovp() from plugins

update_ovp() is plugin policy function and it is called
when the battery health state changed to HEALTH_OVP.
However, there is no handling codes for battery health OVP state.
1. There is no subscription code and callback for DEVICED_NOTIFIER_BATTERY_OVP
2. update_ovp() only changes meaningless display state without policy.
Thus, meaningless update_ovp() logic is removed from plugins and replaced by syscommon plugin function.

Change-Id: I0130611e24a201199b4a4f11a986f074b699112c
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
18 months agobattery: Move changed_battery_cf() from plugin to core 44/301644/3
Yunhee Seo [Wed, 6 Sep 2023 07:36:49 +0000 (16:36 +0900)]
battery: Move changed_battery_cf() from plugin to core

changed_battery_cf() was used to notify with system popup
when the battery is disconnected.
Notifying battery connection status is a general function.
Thus, move changed_battery_cf() to the core battery module
and name is replaced by inform_changed_battery_connection().

Change-Id: I17ccd437be55551f8501606dbe50ddf4461d688d
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
18 months agopower: Add setter for controlling doze source 43/301643/3
Youngjae Cho [Fri, 13 Oct 2023 09:10:51 +0000 (18:10 +0900)]
power: Add setter for controlling doze source

 Doze is going to replace the event-lock, that is, short-living power
lock. The purpose of doze is for keeping user applications in sleep
while the underneath system is awake, doing something for a moment. In
other words, it can be utilized for short wakeup without notifying it
to the whole applications, especially for jobs related to the real-time
clock. The system stays awake when there is at least a doze source.
 Currently, only two type of doze sources are allowed, power key and
bluetooth key. Those key presses should measure their time lapse with
real-time clock for testing longkey so the system must be awake at
that moment.

Change-Id: I91bdf11e34d18c170deb5d2c4a6a67e7e9565371
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
18 months agotests: Suppress deprecation warning of usbhost 42/301642/2
Youngjae Cho [Tue, 7 Nov 2023 03:56:38 +0000 (12:56 +0900)]
tests: Suppress deprecation warning of usbhost

It suppresses warning:
usb-host-ffs-test-daemon/descs_gen.c:43:9: warning:
 'usb_functionfs_descs_head' is deprecated [-Wdeprecated-declarations]

As of the 3.14, the struct has been deprecated.

Change-Id: I90c2061c810029ba866b703d3eba7727eb993035
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
18 months agocore: Add resource-core 41/301641/2
Youngjae Cho [Wed, 11 Oct 2023 10:57:15 +0000 (19:57 +0900)]
core: Add resource-core

It has only one attribute, DEVICED_CORE_ATTR_INT_DELAYED_INIT_DONE,
which denotes delayed_init_done. It will replace device-notifier of
DEVICED_NOTIFIER_DELAYED_INIT with resource-manager.

Change-Id: Ifb60bd20cc36704db16460460a24475cc739f6de
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
18 months agopower: Add setter for DEVICED_POWER_ATTR_INT_VITAL_MODE 40/301640/2
Youngjae Cho [Thu, 12 Oct 2023 02:30:09 +0000 (11:30 +0900)]
power: Add setter for DEVICED_POWER_ATTR_INT_VITAL_MODE

Instead of notitfying DEVICED_NOTIFIER_VITAL_STATE, it directly sets
power attribute DEVICED_POWER_ATTR_INT_VITAL_MODE to change vital state.

Change-Id: I9ab5ff6101f38fb3cba3be2606306b46e5d0dce6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
18 months agodisplay: Fix display actor getter/setter correctly 39/301639/2
Youngjae Cho [Mon, 16 Oct 2023 06:24:47 +0000 (15:24 +0900)]
display: Fix display actor getter/setter correctly

Getter for DEVICED_DISPLAY_ATTR_UINT64_ACTOR_CAPABILITY
 is now correctly returns capability.
Setter for DEVICED_DISPLAY_ATTR_TUPLE3_ACTOR_CAPABILITY
 is now correctly allocates actor->id.

Change-Id: I67773d32f154b7e499c18fd29de91f3e90054dbc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
19 months agousb-host: Filter out abnormal devpath 70/300770/1 accepted/tizen/8.0/unified/20231108.165829
Youngjae Cho [Tue, 31 Oct 2023 02:21:33 +0000 (11:21 +0900)]
usb-host: Filter out abnormal devpath

Sometimes the devpath gets empty string. It is not sure, but the deviced
seems to get blocked in such case, reading the parent's product/serial
node. It leads watchdog timeout, and the deviced gets SIGABRT from the
systemd. It is not clear that the empty devpath results it though, add
guard clauses for filtering out such an abnormal devpath.

 (gdb) bt
 #0  __libc_read (nbytes=4097, buf=0xaba70f28, fd=-1415114968)
     at ../sysdeps/unix/sysv/linux/read.c:26

 #1  __libc_read (fd=fd@entry=28, buf=buf@entry=0xaba70f28,
     nbytes=nbytes@entry=4097) at ../sysdeps/unix/sysv/linux/read.c:24

 #2  0xf76289a2 in read (__nbytes=4097, __buf=0xaba70f28, __fd=28)
     at /usr/include/bits/unistd.h:44

 #3  read_full_virtual_file (filename=<optimized out>, ret_contents=0xffd180ec,
     ret_size=0xffd180f4) at ../src/basic/fileio.c:371

 #4  0xf7626608 in sd_device_get_sysattr_value (device=0xaba084f8,
     sysattr=0xaaefe36c "product", _value=0xffd181b0)
     at ../src/libsystemd/sd-device/sd-device.c:1789

 #5  0xf761c92e in udev_device_get_sysattr_value (
     udev_device=udev_device@entry=0xaba2c060, sysattr=<optimized out>)
     at ../src/libudev/libudev-device.c:741

 #6  0xaaeec55c in add_usbhost_list (dev=dev@entry=0xab9fc4e0,
     devpath=devpath@entry=0xaba3d984 "")
     at /usr/src/debug/deviced-10.0.0-1.arm/src/usb-host/usb-host.c:236

Change-Id: I7400ccb4f99cfab39e8fcd6f6765f8901afd3f6b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agoconf: org.tizen.system/deviced.conf: Add dbus policy for input interface 44/298744/1 accepted/tizen/8.0/unified/20231005.093737 accepted/tizen/unified/20230914.100408 tizen_8.0_m2_release
Chanwoo Choi [Wed, 13 Sep 2023 05:45:57 +0000 (14:45 +0900)]
conf: org.tizen.system/deviced.conf: Add dbus policy for input interface

Add dbus policy of org.tizen.system.deviced.input
to allow user to use input interface.

Change-Id: I1135724bfe01f21ac1d33b35033efa3256d10eda
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agodisplay: power: Remove _GET_/_SET_ from attribute name 87/298587/1 accepted/tizen/unified/20230913.091608
Youngjae Cho [Mon, 11 Sep 2023 05:29:46 +0000 (14:29 +0900)]
display: power: Remove _GET_/_SET_ from attribute name

Change-Id: I95120bbde33c91c2506b10601e1c690e41947037
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: power: Fix attribute type of multiple data 86/298586/1
Youngjae Cho [Wed, 6 Sep 2023 08:00:33 +0000 (17:00 +0900)]
display: power: Fix attribute type of multiple data

SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64
 -> SYSCOMMON_RESMAN_DATA_TYPE_2_UINT64

SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64
 -> SYSCOMMON_RESMAN_DATA_TYPE_3_UINT64

SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64_UINT64
 -> SYSCOMMON_RESMAN_DATA_TYPE_4_UINT64

Change-Id: Idf402a6d7a0415e83575d018de728d429c3d325f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agopackaging: Remove deviced-isu package requirement 31/298431/1 accepted/tizen/unified/20230908.185258
Chanwoo Choi [Thu, 7 Sep 2023 01:47:13 +0000 (10:47 +0900)]
packaging: Remove deviced-isu package requirement

deviced-isu package should be required in builing-blocks
to be included in snapshot image.

Change-Id: Ie6e86f0841aefb0cf0e83497b0ef625f864098c6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agoFix ISU deviced.service 84/296584/6 accepted/tizen/unified/20230907.055340
Mateusz Moscicki [Mon, 31 Jul 2023 12:59:26 +0000 (14:59 +0200)]
Fix ISU deviced.service

Deviced cannot be run in the sandbox (in a different mount namespace)
because for USB gadget purposes it mounts FunctionFS, which is that case
is not visible outside this sandbox.

Change-Id: I761d72573d884827f1fbc742883a0e26b3312706

21 months agoconf: Remove unused headless configuration 03/297903/1
Chanwoo Choi [Mon, 28 Aug 2023 09:19:55 +0000 (18:19 +0900)]
conf: Remove unused headless configuration

Change-Id: Ib9dc254d73cd4c22fdcef61bd1e2ed13034792af
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agopackaging: Remove unused deviced-plugin-profile-iot-headed package 42/297842/2
Chanwoo Choi [Fri, 25 Aug 2023 08:59:45 +0000 (17:59 +0900)]
packaging: Remove unused deviced-plugin-profile-iot-headed package

Change-Id: I24d5b9f57bbc6895b0506be2f97111590b6f92c9
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agousb-gadget: Add checking return value 31/297831/1 accepted/tizen/unified/20230829.181412
Yunhee Seo [Fri, 25 Aug 2023 06:07:06 +0000 (15:07 +0900)]
usb-gadget: Add checking return value

Add checking return value to fix static anlaysis issue.

Change-Id: I0027cc102f5e1b6c1731d7d15d49254bcd4608aa
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
21 months agodisplay: Remove iot-headed plugin backend 29/297729/3 accepted/tizen/unified/20230825.044249 accepted/tizen/unified/riscv/20230829.072102
Youngjae Cho [Wed, 23 Aug 2023 09:01:57 +0000 (18:01 +0900)]
display: Remove iot-headed plugin backend

In order to guarantee the independency between deviced and iot-headed
plugin backend, move the all iot-headed plugin backend into separate
plugin-backend-deviced-headed.git git repository. And the display
core invokes get_backend() to load that plugin backend.

Change-Id: I19966ba2f96e64c6d2feed12fdfb33b13acac9a0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Add default intializer for display_state 25/297725/3
Youngjae Cho [Wed, 23 Aug 2023 07:40:09 +0000 (16:40 +0900)]
display: Add default intializer for display_state

Change-Id: I2b8ba55f5a044b83ce0f37ff9454bffd14d9ee0e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Add attribute getter for display config 13/297713/3
Youngjae Cho [Wed, 23 Aug 2023 06:42:19 +0000 (15:42 +0900)]
display: Add attribute getter for display config

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_GET_CONFIG_POWERKEY_DOUBLEPRESS
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: X
 - getter: O

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_GET_CONFIG_LONGPRESS_INTERVAL
 - type: SYSCOMMON_RESMAN_DATA_TYPE_DOUBLE
 - setter: X
 - getter: O

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_GET_CONFIG_TOUCH_WAKEUP
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: X
 - getter: O

Those attribute gets value of the display-config of display plugin.

Change-Id: I9a52d5a20ec44b9746aff9879711d7458b34b3f0
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Add plugin-api for loading display config from plugin 24/297724/2
Youngjae Cho [Wed, 23 Aug 2023 08:12:52 +0000 (17:12 +0900)]
display: Add plugin-api for loading display config from plugin

It coexists with the previous way, that is, loading configuration via
display_plugin_device_ops->probe(). This is because it is still being
used by mobile/wearable profile and they currently not be separated
into plugin backend. Only when the result of probe() hasn't loaded
display config, where a plugin backend has completely separated into
dedicated backend repository, the plugin-api underatakes what should
have done by the probe().

Change-Id: I86c68a95cb43cd3add79e3f9625d26a58506b30b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agoplugin: display: Add check NULL dereference 93/297693/1
Yunhee Seo [Wed, 23 Aug 2023 03:07:50 +0000 (12:07 +0900)]
plugin: display: Add check NULL dereference

Fix static analysis NULL dereference issue.

Change-Id: I62328d142f4095d6687441b0a777549502be5f20
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
21 months agousb-host: Add check NULL dereference 91/297691/1
Yunhee Seo [Wed, 23 Aug 2023 02:57:49 +0000 (11:57 +0900)]
usb-host: Add check NULL dereference

Fix static analysis NULL dereference issue.

Change-Id: I9bcf942ae1b8032d399019dec01ed3b15d3d96ca
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
21 months agoplugins: Remove iot-headless plugin backend 42/297442/5 accepted/tizen/unified/20230823.021355
Chanwoo Choi [Fri, 18 Aug 2023 04:59:45 +0000 (13:59 +0900)]
plugins: Remove iot-headless plugin backend

In order to guarantee the independency between deviced and iot-headless
plugin backend, move the all iot-headless plugin backend into separate
plugin-backend-deviced-headless.git git repository.

Change-Id: I6a726b0aad9be1af1f8a643bc86415bba8594619
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agoinput: Replace input plugin-backend by using plugin-api-deviced API 41/297441/5
Chanwoo Choi [Fri, 18 Aug 2023 04:27:49 +0000 (13:27 +0900)]
input: Replace input plugin-backend by using plugin-api-deviced API

Until now, deviced contains the all plugin backend package for each profile like
headless, headed and so on. In order to move the plugin to the seprate
git repository, handle the input plugin-backend by using
plugin-api-deviced API (input plugin-api).

[Sequence flow between packages]
- deviced (input core)
-> plugin-api-deviced(input plugin-api)
-> plugin-backend-deviced-* (input plugin-backend, e.g., plugin-backend-deviced-headless)

Change-Id: Ic01198cc2b3e512ce059c96894ac0b94039e286a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agodisplay: Add attribute for releasing all lock 43/297643/2
Youngjae Cho [Tue, 22 Aug 2023 02:40:19 +0000 (11:40 +0900)]
display: Add attribute for releasing all lock

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_SET_RELEASE_LOCK_ALL
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: O
 - getter: X
 It releases all lock of the given parameter, state.

Removed display-lock.h so that it is independent to the display core.
Due to the removal, the below codes has been changed
 - The macro __CONSTRUCTOR__ has been replaced in primitive way,
   __attribute__((constructor)), as its dependency has been removed
   that was display-lock.h -> common.h.
 - The prototype of get_var_display_config() has been relocated to
   the plugin-util.h.

Change-Id: Ida2d5c887469f331d1790fa021f3fea60108beb3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agopower: Add attribute for pm_history_save() 42/297642/2
Youngjae Cho [Tue, 22 Aug 2023 04:21:22 +0000 (13:21 +0900)]
power: Add attribute for pm_history_save()

New attribute:
 - id: DEVICED_POWER_ATTR_TUPLE2_SET_HISTORY_LOG
 - type: DEVICED_POWER_ATTR_TUPLE2_SET_HISTORY_LOG
 - setter: O
 - getter: X
 - 1st param: enum syscommon_deviced_power_log_type
 - 2nd param: secondary information of type integer

Additionally, replaced enum pm_log_type to
syscommon_deviced_power_log_type of the libsyscommon.

Change-Id: Ifacf09c2f95b8fcc84399f79483634e1d5c1b467
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: headed: Replace shared enum with the libsyscommon 41/297641/2
Youngjae Cho [Tue, 22 Aug 2023 03:10:21 +0000 (12:10 +0900)]
display: headed: Replace shared enum with the libsyscommon

Change-Id: Iee95036c51c51116216e43da7bfea4f19ce74c39
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Replace get_lock_screen_state() with vconf API 40/297640/1
Youngjae Cho [Tue, 22 Aug 2023 02:50:36 +0000 (11:50 +0900)]
display: Replace get_lock_screen_state() with vconf API

The function is dependent to the display/setting.c. To remove that
dependency, added function is_lockscreen_enabled(). Additionally,
the get_lock_screen_bg_state() has been removed as it is not currently
used.

Change-Id: I15c48956b3f34b0397b70a5c4f2f1141671c5c05
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Add attribute for touch event blocked 22/297622/1
Youngjae Cho [Tue, 22 Aug 2023 02:21:11 +0000 (11:21 +0900)]
display: Add attribute for touch event blocked

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_GET_TOUCH_EVENT_BLOCKED
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: X
 - getter: O

Change-Id: Id8b65f4ceeee1ef145f58dbd8176ab7911d27dcf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Add attribute for display actor capability 11/297611/3
Youngjae Cho [Mon, 21 Aug 2023 11:47:51 +0000 (20:47 +0900)]
display: Add attribute for display actor capability

New attribute:
 - id: DEVICED_DISPLAY_ATTR_UINT64_GET_ACTOR_CAPABILITY
 - type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_WITH_2_USER_DATA
 - setter: X
 - getter: O
 - 1st param: syscommon_deviced_display_actor_id
 - 2nd param: syscommon_deviced_display_capability
 It finds whether an actor id has an capability.

New attribute:
 - id: DEVICED_DISPLAY_ATTR_TUPLE3_SET_ACTOR_CAPABILITY
 - type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64
 - setter: O
 - getter: X
 - 1st param: syscommon_deviced_display_actor_id
 - 2nd param: syscommon_deviced_display_capability
 - 3rd param: 0: reset,  1: set
 It sets/resets capability of an actor id.

Additionally, replaces all enum and struct related to display actor
with the libsyscommon one.

Change-Id: Icd8cedfaf8edb315ba1f960470cb46c98e519357
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agopower: Add attribute for vital mode 83/297583/1
Youngjae Cho [Mon, 21 Aug 2023 08:13:12 +0000 (17:13 +0900)]
power: Add attribute for vital mode

New attribute:
 - id: DEVICED_POWER_ATTR_INT_GET_VITAL_MODE
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: X
 - getter: O

Replaced enum vital_mode to that of the libsyscommon. Additionaly,
as the number of power attribute grows, restructured getter to have
single entry function, get_power_attr_data, like resource-display.c.

Change-Id: Ie4c2e8cc282a8728f1b9164c4beff5adbc30500b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: headed: Add set_lcdoff_reason() 15/297515/2
Youngjae Cho [Mon, 21 Aug 2023 07:45:30 +0000 (16:45 +0900)]
display: headed: Add set_lcdoff_reason()

It is copy of display_state_transition_update_lcdoff_reason() of the
src/display/display-state-transition.c. Its operation is not related
to the display core but just related to vconf API. It remove dependency
to the core display-state-transition.h.

Change-Id: I26e630ca7e61d8dcb8f45b48715d0170fc8684fb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: headed: Add plugin-util.c for plugin utility 13/297513/1
Youngjae Cho [Mon, 21 Aug 2023 07:09:04 +0000 (16:09 +0900)]
display: headed: Add plugin-util.c for plugin utility

int launch_system_app()
 : Remove dependency to the src/shared/apps.h.
   This is copy of function at the src/shared/apps.h so that it makes
   plugin be able to separated from the deviced core.

int display_plugin_config_touch_wakeup()
 : Remove dependency to the extern g_display_plugin at display-plugin.h
   As the actual data resides in the plugin, it is able to access it
   without referring the core display-plugin.h. For now, only the one
   member, touch_wakeup, is being accessed. Therefore, the function
   dedicated to that member is added.

Change-Id: I6e25d4dd108ffe97da4502a5597822c16743ad15
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Add attribute for custom brightness 11/297511/1
Youngjae Cho [Mon, 21 Aug 2023 06:46:45 +0000 (15:46 +0900)]
display: Add attribute for custom brightness

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_CUSTOM_BRIGHTNESS
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: O
 - getter: O
 It gets whether custom brightness is set or not. And it enables the
 custom  brightness when it sets attrbute by a value other than 0.

Change-Id: Ia4ab8e6c0e64f97c7bd57ecd6c28a6b060e08cba
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: headed: Remove unnecessrary device-interface.c 59/297459/1 accepted/tizen/unified/20230821.162310
Youngjae Cho [Fri, 18 Aug 2023 11:26:35 +0000 (20:26 +0900)]
display: headed: Remove unnecessrary device-interface.c

The code had have actually nothing. All function pointers were NULL
and it wouldn't have been assigned during runtime.

Change-Id: Ife8d8b336ae60eba8460db036f45114b5ae7c7b3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Move common display_start()/stop()/status() to core 58/297458/1
Youngjae Cho [Fri, 18 Aug 2023 11:16:53 +0000 (20:16 +0900)]
display: Move common display_start()/stop()/status() to core

Change-Id: I07eb94b2401ed1dc494f1922d6954daa81d4e8e4
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Replace struct state with the libsyscommon 57/297457/1
Youngjae Cho [Fri, 18 Aug 2023 10:49:41 +0000 (19:49 +0900)]
display: Replace struct state with the libsyscommon

Change-Id: I38890b7b0d1610b718299c4960d4915604fb5b2d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agoAdd prefix 'syscommon' to enum and struct 46/297446/1
Youngjae Cho [Fri, 18 Aug 2023 10:05:32 +0000 (19:05 +0900)]
Add prefix 'syscommon' to enum and struct

Change-Id: I36f314cc36944cd7973f54f79a9ddbf52cbf23ca
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Replace display_config to the libsyscommon one 39/297439/1
Youngjae Cho [Fri, 18 Aug 2023 06:48:58 +0000 (15:48 +0900)]
display: Replace display_config to the libsyscommon one

The enums that had been used by display_config are also replaced
with that of the libsyscommon.
 - enum display_dpms_type -> enum deviced_dpms_type
 - enum display_init_direction_e -> enum deviced_display_orientation

Change-Id: I8995957bfdfba74b65b4bf16d8e8225104ab6315
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Add display_plugin_config_load() 38/297438/1
Youngjae Cho [Fri, 18 Aug 2023 06:19:55 +0000 (15:19 +0900)]
display: Add display_plugin_config_load()

The display core has become responsible for letting display plugins
load its configuration. It is handled via display_plugin_config_load().
The plugins' routine that was directly invoking display_load_config()
has been removed accordingly.

Change-Id: I51820d8ba88cd43cda14a5ca3393d46c3c474c21
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Integrate plugin is_lcdon_blocked() into display_is_lcdon_blocked() 23/297423/2
Youngjae Cho [Fri, 18 Aug 2023 04:18:11 +0000 (13:18 +0900)]
display: Integrate plugin is_lcdon_blocked() into display_is_lcdon_blocked()

Those is_lcdon_blocked(), scattered throughout the plugins, has been
gathered into display_is_lcdon_blocked() except the wearable one. The
display_plugin_is_lcd_on_blocked() is removed accordingly.

Change-Id: I3affc0dae9a50bcfb16df1036a5944d41b34c0cf
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agopower: Fix missing trans_info replacement 96/297396/1
Youngjae Cho [Fri, 18 Aug 2023 02:20:01 +0000 (11:20 +0900)]
power: Fix missing trans_info replacement

Change-Id: Idc0def7e9893db7b18bcf9da6fd628ada80e87ef
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: headed: Remove code controlling touch-led 95/297395/1
Youngjae Cho [Fri, 18 Aug 2023 02:11:58 +0000 (11:11 +0900)]
display: headed: Remove code controlling touch-led

Headed profile doesn't support touch-led.

Change-Id: I8d8897f8c808c06ad2a794ccc3c232fdd4081bdd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: headed: Remove unnecessary header 85/297385/2
Youngjae Cho [Fri, 18 Aug 2023 01:50:23 +0000 (10:50 +0900)]
display: headed: Remove unnecessary header

Change-Id: I6192b9abdbaf4f1041d917da3d21ff750b78d93a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Add display attribute for controlling DPMS 81/297381/4
Youngjae Cho [Thu, 17 Aug 2023 12:14:46 +0000 (21:14 +0900)]
display: Add display attribute for controlling DPMS

New attribute:
 - id: DEVICED_DISPLAY_ATTR_INT_DPMS_STATE
 - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
 - setter: O
 - getter: O
 It sets/gets DPMS value type of enum deviced_dpms_state.

New attribute:
 - id: DEVICED_DISPLAY_ATTR_TUPLE2_SET_DISPLAY_DIRECT
 - type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64
 - setter: O
 - getter: X
 It bypasses display state transition routine. Instead it sets DPMS
 directly. It requires two parameter, enum deviced_dpms_state and
 enum deviced_event.

Change-Id: If8ab662ccf011458607acfa24aca97298eddcfc6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agodisplay: Change setter for attribute SET_CURRENT_STATE 80/297380/4
Youngjae Cho [Thu, 17 Aug 2023 10:37:59 +0000 (19:37 +0900)]
display: Change setter for attribute SET_CURRENT_STATE

The operation of the display_state_set_current() is interfered by
the existing operation display_state_transition_do_state_transition().
As both are accessing and modifying same underlying data, and they
can be working at the same time, the data could be corrupted by each
other during their operation. Therefore, use only one for set state.
However, all of them should be fixed to display_state_set_current()
eventually.

Change-Id: I635eb5e8537302647d120ca4f6ef005f09dc1a07
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
21 months agopower: Covnert to struct syscommon_plugin_deviced_power_trans_info 74/297374/3
Chanwoo Choi [Thu, 17 Aug 2023 10:55:25 +0000 (19:55 +0900)]
power: Covnert to struct syscommon_plugin_deviced_power_trans_info

struct trans_info is used on both deviced and deviced-plugin-backend.
So that move it to plugin-api-deviced in libsyscommon and then covert
from trans_info to syscommon_plugin_deviced_power_trans_info.

Change-Id: I990f9f94dc3452e59d9c9f6b0d02a2c95e7b44ce
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agopower: Move convert_action_string_to_power_state() to plugin-api-deviced 73/297373/3
Chanwoo Choi [Thu, 17 Aug 2023 10:46:28 +0000 (19:46 +0900)]
power: Move convert_action_string_to_power_state() to plugin-api-deviced

convert_action_string_to_power_state() is used on both deviced
and deviced-plugin-backend. So that move it to plugin-api-deviced
package in libsyscommon.

Change-Id: I2809e7a85a51339beb673782c0aae12e8f2e3da6
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
21 months agodisplay: Remove unnecessary headers from headed/headless plugin 49/297349/2
Youngjae Cho [Thu, 17 Aug 2023 04:58:33 +0000 (13:58 +0900)]
display: Remove unnecessary headers from headed/headless plugin

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