platform/core/system/deviced.git
6 weeks agoAdd plugins to deviced ISU configuration 71/308271/1 accepted/tizen_8.0_unified 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)

8 weeks 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>
3 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>
3 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>
4 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
5 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>
6 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>
7 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>
7 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>
7 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>
7 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>
8 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

8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 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>
8 months agoplugin: Replace shared/log.h with the libsyscommon/log.h 77/297377/1
Youngjae Cho [Thu, 17 Aug 2023 11:13:03 +0000 (20:13 +0900)]
plugin: Replace shared/log.h with the libsyscommon/log.h

Change-Id: I382897148934deba330e23975b411d51103d3a61
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Replace headed/headless device-notifier.h with libsyscommon 48/297348/2
Youngjae Cho [Thu, 17 Aug 2023 06:04:46 +0000 (15:04 +0900)]
display: Replace headed/headless device-notifier.h with libsyscommon

Change-Id: I8c712cc698767267742a0d19ef017e5eacd06c12
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Remove unused ambient code from headed plugin 47/297347/3
Youngjae Cho [Thu, 17 Aug 2023 05:15:44 +0000 (14:15 +0900)]
display: Remove unused ambient code from headed plugin

Change-Id: Ie0629fb269c633b24f6be8afbad93c8e4b223f40
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Remove unused disp_plgn/backlight_ops from headed 46/297346/4
Youngjae Cho [Thu, 17 Aug 2023 05:06:31 +0000 (14:06 +0900)]
display: Remove unused disp_plgn/backlight_ops from headed

Change-Id: I858e6097b407bc447fa3687247ccff75fb725980
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agoplugins: iot-headless: Repalce shared header with libsyscommon header 63/297363/2
Chanwoo Choi [Thu, 17 Aug 2023 09:44:25 +0000 (18:44 +0900)]
plugins: iot-headless: Repalce shared header with libsyscommon header

- shared/log.h -> libsyscommon/log.h
- shared/device-notifier.h -> system/syscommon-plugin-deviced-common-interface.h
                           -> libsyscommon/notifier.h

Change-Id: I548e74944fde61852ccff73e4c9f514dc7a3cbb0
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
8 months agoshared: event: Replace event_broadcast_id() with gdbus_signal_emit() directly 58/297358/3
Chanwoo Choi [Thu, 17 Aug 2023 09:21:20 +0000 (18:21 +0900)]
shared: event: Replace event_broadcast_id() with gdbus_signal_emit() directly

Without event_broadcast_id() wrapper funciton, use gdbus_signal_emit()
helper function directly to send the signal of event id.

Change-Id: I1545d7a1fb2c70c74c873dd0d2d81342c96aa0f5
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
8 months agoshared: event: Replace with DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK 57/297357/3
Chanwoo Choi [Thu, 17 Aug 2023 06:24:29 +0000 (15:24 +0900)]
shared: event: Replace with DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK

Replace event_acquire_wakelock() with DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK
attribute by using resource-mangaer in libsyscommon and then remove
event_acquire_wakelock().

Change-Id: I7f0dbc7a46f0753c14ef4ecbecb0bf27e300f61e
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
8 months agopower: resource: Add new DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK 56/297356/2
Chanwoo Choi [Thu, 17 Aug 2023 06:24:00 +0000 (15:24 +0900)]
power: resource: Add new DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK

DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK attribute provides the
setter function to acquire the wakelock in order to prevent the suspending.

[Detailed description of newly added attribute]
- attr id   : DEVICED_POWER_ATTR_TUPLE2_SET_WAKELOCK
- setter    : O
- getter    : X
- 1st param : Event ID
- 2nd param : Timeout to release the wakelock count

Change-Id: I9ffdecac5ddd538b22ae2cd9397abb0fe93dd98a
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
8 months agopower: resource: Remove unneeded blank 55/297355/2
Chanwoo Choi [Thu, 17 Aug 2023 05:30:13 +0000 (14:30 +0900)]
power: resource: Remove unneeded blank

Change-Id: I529384993dd03dc5767ee0a31aa6a396b8c0f7b7
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
8 months agoplugins: iot-headless: Remove unused header and replace it by libsyscommon 54/297354/2
Chanwoo Choi [Thu, 17 Aug 2023 05:27:57 +0000 (14:27 +0900)]
plugins: iot-headless: Remove unused header and replace it by libsyscommon

- shared/common.h is not used
- shared/log.h is replaced with libsyscommon/lig.h

Change-Id: If4113e98aa7b130230b2fa1eac93395c99e9ae70
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
8 months agoshared: Replace device_notifier_type with the libsyscommon 43/297343/1
Youngjae Cho [Thu, 17 Aug 2023 05:48:27 +0000 (14:48 +0900)]
shared: Replace device_notifier_type with the libsyscommon

The prefix DEVICE_NOTIFIER has been replaced with DEVICE'D'_NOTIFIER.

Change-Id: Ie2600c7846ca9ac898b3b20f69e36bc8c45f9b3e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Remove display module from headless plugin 27/297327/2 accepted/tizen/unified/20230818.183532 accepted/tizen/unified/riscv/20230817.113309
Yunhee Seo [Thu, 17 Aug 2023 01:38:15 +0000 (10:38 +0900)]
display: Remove display module from headless plugin

Headless does not use display device, however dummy display.so file exists.
As display refactoring progressed, there was no need for dummy display module to exist.
Thus, display module is removed from headless plugin.

Change-Id: Ia0bf6bf53ae5883a86f26bc522f222130ae95b3d
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
8 months agodisplay: Replace change state of iot-headed/mobile/tv plugin 55/297255/1
Youngjae Cho [Wed, 16 Aug 2023 02:10:07 +0000 (11:10 +0900)]
display: Replace change state of iot-headed/mobile/tv plugin

The display_state_transition_request_state_transition_with_option()
has been replaced by resource-manager API of the libsyscommon that
sets display attribute DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE.

Change-Id: I7e9cecd3246914c5a323eac7acb3051b907737bb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Add set attribute for current state 28/297228/1
Youngjae Cho [Mon, 14 Aug 2023 07:55:14 +0000 (16:55 +0900)]
display: Add set attribute for current state

New attribute:
 - id: DEVICED_DISPLAY_ATTR_TUPLE2_SET_CURRENT_STATE
 - type: SYSCOMMON_RESMAN_DATA_TYPE_UIN64_UINT64
 - setter: O
 - getter: X

It sets display current state. It receives two parameters,
 - enum deviced_display_state
  : next state to be changed
 - enum deviced_event
  : reason why the state changed

Change-Id: I9e3bca655b85f0639fa50ea6d21cee62e2dc909d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Add display attribute representing current state 07/297107/2
Youngjae Cho [Wed, 9 Aug 2023 11:22:00 +0000 (20:22 +0900)]
display: Add display attribute representing current state

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

Plugins and other core modules has replaced get_pm_cur_state()
with resource-manager API that accessing the attribute.

Change-Id: Iacb01f00c6909f313d32575f424646a8b4de3a96
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Relocate display_state_transition_do_state_action() 06/297106/1
Youngjae Cho [Thu, 10 Aug 2023 06:31:06 +0000 (15:31 +0900)]
display: Relocate display_state_transition_do_state_action()

The display_state_transition_do_state_action() of display-panel.c has
been moved to display-state-transition.c and it has renamed to
display_state_set_current().

Change-Id: Iff04254b484c56fd56db134978f805e12fcfc4b6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Add display_state_get_current() 05/297105/1
Youngjae Cho [Thu, 10 Aug 2023 04:43:17 +0000 (13:43 +0900)]
display: Add display_state_get_current()

It replaces get_pm_cur_state() of the display core.

Change-Id: I7fa227f816b343226f5a7584952862a4ebdd8459
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Relocate state to display-state-transition.c 76/297076/2
Youngjae Cho [Thu, 10 Aug 2023 02:57:13 +0000 (11:57 +0900)]
display: Relocate state to display-state-transition.c

The existing pm_cur_state/pm_old_state has renamed to current/previous.
Getter and setter on that current/previous state has moved accordingly.
However, those getter/setter name hasn't been changed as it will be
replaced with resource-manager soon.

Change-Id: Ib89c018bd1cf011c80bff4ec9922fa970931a1aa
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Replace state_t with deviced_display_state of the libsyscommon 71/297071/1
Youngjae Cho [Thu, 10 Aug 2023 01:39:07 +0000 (10:39 +0900)]
display: Replace state_t with deviced_display_state of the libsyscommon

Removed unused S_STANDBY, S_SUSPEND and S_POWEROFF.

Change-Id: I16ecff84bf8b3bf0379afe43942aa28d2950f4b2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agoReplace INTERNAL_LOCK_* with deviced_event of the libsyscommon 36/296936/5
Youngjae Cho [Mon, 7 Aug 2023 11:00:59 +0000 (20:00 +0900)]
Replace INTERNAL_LOCK_* with deviced_event of the libsyscommon

Most of INTERNAL_LOCK_XXX has changed to the same name, DEVICED_EVENT_XXX.
A few of them, mostly INTERNAL_LOCK_PM, has changed to the best matching
name that reflects its context.

Change-Id: I4574e82985defed2578338b6c2bb3cbd34f023ea
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Remove unreachable display-enhance code 23/296923/4
Youngjae Cho [Mon, 7 Aug 2023 08:24:04 +0000 (17:24 +0900)]
display: Remove unreachable display-enhance code

The enhance isn't invoked by display_ops->func(), but by notifier.

Change-Id: I43f4cfd3c1afc8b11960302fc5cdb4e97ac9c4b5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Add resource attribute representing max brightness 87/296887/4
Youngjae Cho [Fri, 4 Aug 2023 05:23:53 +0000 (14:23 +0900)]
display: Add resource attribute representing max brightness

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

 The previous operations, display_backlight_get_max_brightness(),
has been replaced with operation that accessing the attribute
DEVICED_DISPLAY_ATTR_INT_BRIGHTNESS via resource-manager API.

Change-Id: I6966cbdf4a75795c9f566611424095a04c133bbc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: power: Replace common code with the libsyscommon 86/296886/3
Youngjae Cho [Fri, 4 Aug 2023 05:32:05 +0000 (14:32 +0900)]
display: power: Replace common code with the libsyscommon

Change-Id: I7baf001d4d03ef675465b821d564cae3958055ca
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agodisplay: Introduce resource-driver 57/296757/3
Youngjae Cho [Thu, 3 Aug 2023 06:07:11 +0000 (15:07 +0900)]
display: Introduce resource-driver

Add skeleton resource-driver for the display.

Change-Id: I716c208ed55b89636d4c3ecc394d8f6938abecc6
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
8 months agoinput: Add typecasting to avoid static analysis issue 69/296769/2
Yunhee Seo [Fri, 4 Aug 2023 04:48:27 +0000 (13:48 +0900)]
input: Add typecasting to avoid static analysis issue

Add typecasting to avoid static analysis issue

Change-Id: I4be23e93b2e67854d3bbd93bc758e18b7daa8e3a
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
8 months agoplugin: display: Add check NULL dereference 68/296768/2
Yunhee Seo [Fri, 4 Aug 2023 04:41:00 +0000 (13:41 +0900)]
plugin: display: Add check NULL dereference

Fix static analysis NULL dereference issue.

Change-Id: I5cca401e4cd9a1b52e19e30dbfbebd747c6a3aed
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
8 months agobattery: Add check NULL derefernce 67/296767/2
Yunhee Seo [Fri, 4 Aug 2023 04:39:33 +0000 (13:39 +0900)]
battery: Add check NULL derefernce

Fix static analysis NULL dereferce issue.

Change-Id: Ib33ce3df0eab04c62c9096d78e09ff2e093edd57
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
9 months agopower: Fix type casting of set_current_state() 65/296665/1 accepted/tizen/unified/20230803.174810 accepted/tizen/unified/riscv/20230809.013257
Youngjae Cho [Thu, 3 Aug 2023 02:03:49 +0000 (11:03 +0900)]
power: Fix type casting of set_current_state()

The last set-value parameter, data4, receives address to the user_data,
which is type of 'const void *'.

Change-Id: I6eaf48357b8eb5c4bfc551832b3c35aff2b2aef7
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agodisplay: Apply resource-manager for controlling power 98/296598/4
Youngjae Cho [Tue, 1 Aug 2023 09:50:19 +0000 (18:50 +0900)]
display: Apply resource-manager for controlling power

 Previously, controlling power has operated via power functions such as
power_request_change_state(), power_request_change_state_strict(). It
has changed to work via the libsyscommon resource-manager.

Change-Id: I39253c193ccf73e66a6075c4e46e4a1432c501dd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agopower: Introduce resource-driver 34/296534/5
Youngjae Cho [Mon, 31 Jul 2023 10:31:29 +0000 (19:31 +0900)]
power: Introduce resource-driver

The power module now operates on top of resource-driver.

 New attribute:
  - id: DEVICED_POWER_ATTR_SET_UINT64_4_CURRENT_STATE
  - type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64_UINT64_UINT64_UINT64
  - setter: O
  - getter: X
  It trigger power transition to set current power state.
  Requires 4 parameter:
   1. FROM state
      Transition take place only from the 'FROM' state. If you
      don't mind whatever the 'FROM' state is, use
      DEVICED_POWER_STATE_ALL for the 'FROM' state.
   2. TO state
      Next state to transition
   3. triggering reason
   4. user_data

 New attribute:
  - id: DEVICED_POWER_ATTR_UINT64_CURRENT_STATE
  - type: SYSCOMMON_RESMAN_DATA_TYPE_UINT64
  - setter: X
  - getter: O
  It gets the current power state.

 New attribute:
  - id: DEVICED_POWER_ATTR_INT_WAKEUP_REASON
  - type: SYSCOMMON_RESMAN_DATA_TYPE_INT
  - setter: X
  - getter: O
  It gets wakeup reason of the latest system wakeup.

 All enums and macros regarding power state have moved to libsyscommon,
syscommon-plugin-deviced-power-interface.h, so that those value can be
used by both the deviced core and plugin.

 To match type of user_data from resource-manager, fix the existing
'void *' to 'const void *'.

Change-Id: I58af2a74ce2313a07b676e1a884b4201751a882c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agocore: Introduce resource-manager 33/296533/2
Youngjae Cho [Mon, 31 Jul 2023 07:06:08 +0000 (16:06 +0900)]
core: Introduce resource-manager

The deviced core init/exit resource drivers. The helper functions have
been added for this job.
 - resource_init()
 - resource_exit()

Currently, there can be only a single resource instance by a resource
type. Therefore, the deviced manages resource ids of instances within
an array that each index contains a single integer of resource id.

Change-Id: I8818c64f9bfa70a9751a213330e36c5744a55daa
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agodisplay: Fix build warning, casting pointer into integer 44/296444/1 accepted/tizen/unified/20230731.175310
Youngjae Cho [Fri, 28 Jul 2023 01:04:37 +0000 (10:04 +0900)]
display: Fix build warning, casting pointer into integer

The warning happens when casting 64bit pointer into 32bit integer.
Casting into intermeidate type, intptr_t, suppresses such warning.

Change-Id: I56bbce61f7c43311574e8cfb65237ad49954cf55
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agoshared: Replace device notifier with syscommon notifier 72/296372/2
Youngjae Cho [Wed, 26 Jul 2023 08:00:43 +0000 (17:00 +0900)]
shared: Replace device notifier with syscommon notifier

Leave enum device_notifier_type and device_notifier_state_e for now.
It will be moved to plugin-api-interface to be used by both the deviced
and its plugin.

Change-Id: I11e6a275f60a0170e7854f9268459617ce563530
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agoshared: Replace do_mkdir() with syscommon_mkdir() 71/296371/2
Youngjae Cho [Wed, 26 Jul 2023 07:37:32 +0000 (16:37 +0900)]
shared: Replace do_mkdir() with syscommon_mkdir()

Change-Id: I93f1691078b8ae3686035be3a87541f9fa203165
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agoshared: Remove unused get_command() and unnecessary include 62/296362/2
Youngjae Cho [Wed, 26 Jul 2023 06:30:59 +0000 (15:30 +0900)]
shared: Remove unused get_command() and unnecessary include

Change-Id: I6e81fb4a969793c87c71f45dab42fea9caecfc90
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agoshared: Replace do_copy_force() with syscommon_file_copy() 60/296360/1
Youngjae Cho [Wed, 26 Jul 2023 05:39:21 +0000 (14:39 +0900)]
shared: Replace do_copy_force() with syscommon_file_copy()

Change-Id: I4522ca9f1f9a2aebdc16b106e8d0536bca6cae9b
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agodisplay: Remove get_lcd_power() 28/296028/4 accepted/tizen/unified/20230726.163529
Yunhee Seo [Tue, 18 Jul 2023 11:35:56 +0000 (20:35 +0900)]
display: Remove get_lcd_power()

As display plugin dependency is resolved, get_lcd_power() no longer needs to exist.
Thus, get_lcd_power() and wrapper are removed.

Change-Id: I97b35b3f7f1b502fa630f91c39e59fc326788952
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
9 months agodisplay: Fix typo 27/296027/3
Yunhee Seo [Tue, 18 Jul 2023 11:25:43 +0000 (20:25 +0900)]
display: Fix typo

display_plugin_display_on_by_reason() name was misspelled.

Change-Id: I4aa413762e839c2453070ccadc62912d685ce3d4
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
9 months agodisplay: Remove unused function display_panel_set_dpms_running_state() 23/296023/3
Yunhee Seo [Tue, 18 Jul 2023 10:04:00 +0000 (19:04 +0900)]
display: Remove unused function display_panel_set_dpms_running_state()

dpms_running_state variable and setter have never been used since they were added.
There is no place to call display_panel_set_dpms_running_state() and it is unreachable.
Thus display_panel_set_dpms_running_state() and dpms_running_state is removed.

Change-Id: I51a74e0e300d37e2d87808248a7759c0992c45d9
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
9 months agoshared: Replace is_emulator() with syscommon_is_emulator() 83/296283/2
Youngjae Cho [Mon, 24 Jul 2023 12:43:36 +0000 (21:43 +0900)]
shared: Replace is_emulator() with syscommon_is_emulator()

Change-Id: I4ee8746942fbc9f3a223bb5d3867f774a2ce5a52
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agoReplace prefix 'libsys' with 'syscommon' 68/296268/3
Youngjae Cho [Mon, 24 Jul 2023 11:47:34 +0000 (20:47 +0900)]
Replace prefix 'libsys' with 'syscommon'

Change-Id: I10e88e888da3a8a9c5cfed8640ac2aaceecf3565
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agopower: Move shutdown exclusive code to shutdown.c 67/296267/3
Youngjae Cho [Mon, 24 Jul 2023 11:30:37 +0000 (20:30 +0900)]
power: Move shutdown exclusive code to shutdown.c

umount_partition_by_kill() and its subroutine functions are only used
by the shutdown binary. Therefore relocate it from shared library to
shutdown binary.

Change-Id: I1d88b5892cdf1d918b674f30d095ab56c2a8743c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agoshared: Replace mount_check() with syscommon_is_mounted() 66/296266/1
Youngjae Cho [Mon, 24 Jul 2023 11:36:56 +0000 (20:36 +0900)]
shared: Replace mount_check() with syscommon_is_mounted()

Change-Id: I505117cb3ffcfb3e467bd2dd7df79d2d051b5f39
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agoshared: Replace sys_check_node() with access() 57/296257/1
Youngjae Cho [Mon, 24 Jul 2023 10:28:54 +0000 (19:28 +0900)]
shared: Replace sys_check_node() with access()

Change-Id: I56c9e398bd176930e5ae05fafdce440ef459d2fe
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
9 months agoshared: Replace proc operation with that of the libsyscommon 89/295989/2
Youngjae Cho [Mon, 17 Jul 2023 06:20:06 +0000 (15:20 +0900)]
shared: Replace proc operation with that of the libsyscommon

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