platform/core/system/deviced.git
4 years agoAdd vconf set for charger type 11/228811/2
Youngjae Cho [Thu, 26 Mar 2020 01:21:46 +0000 (10:21 +0900)]
Add vconf set for charger type

Change-Id: I83a35de22a2e5df90b2921be6077d49033ff1ddc
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRemove unused sources 95/228395/3
INSUN PYO [Sun, 22 Mar 2020 23:30:36 +0000 (08:30 +0900)]
Remove unused sources

It has been moved to libsyscommon.

Change-Id: I8f9241b359905ae71caf935803f083f040f21a3c

4 years agoDo not apply GrayScale during UltraPowerSaving 28/228728/2
Hyotaek Shim [Wed, 25 Mar 2020 06:15:12 +0000 (15:15 +0900)]
Do not apply GrayScale during UltraPowerSaving

Change-Id: Icc2c412cfeed9c5afd7688ff10cbd790c21c4305
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoFix AutoBrightnessChanged considering interaction with AOD 22/228722/1
Youngjae Cho [Wed, 25 Mar 2020 05:23:47 +0000 (14:23 +0900)]
Fix AutoBrightnessChanged considering interaction with AOD

Change-Id: I5fb69c70dc75b28b83e438fb37f5d781089c6d2a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix build warning 96/228596/2
INSUN PYO [Tue, 24 Mar 2020 05:42:16 +0000 (14:42 +0900)]
Fix build warning

Change-Id: I0bd73a9473bd4fd6763a8f16b24d0995707a0d7b

4 years agoAdd signal broadcast on display detach 06/228606/2
Youngjae Cho [Tue, 24 Mar 2020 06:10:52 +0000 (15:10 +0900)]
Add signal broadcast on display detach

Path        : /Org/Tizen/System/DeviceD/Display
Interface   : org.tizen.system.deviced.display
Signal name : display_detach

Change-Id: I31b38b6c389565ccd0df27d26578c28971c5d5eb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix build warning 23/228423/2
INSUN PYO [Mon, 23 Mar 2020 04:12:13 +0000 (13:12 +0900)]
Fix build warning

Change-Id: Ib52902400185d7ea9ed6c7b2094e9c8eee441f13

4 years agoauto-test: init test for battery-monitor 32/219632/15
sanghyeok.oh [Fri, 6 Dec 2019 13:02:19 +0000 (22:02 +0900)]
auto-test: init test for battery-monitor

Change-Id: I273cfb7c15da79b82ee60cb81df83aff49c4a66c
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agoMerge "Apply dbus sync call to devicectl (Dumpmode, SaveLog)" into tizen
Hyotaek Shim [Fri, 20 Mar 2020 08:21:33 +0000 (08:21 +0000)]
Merge "Apply dbus sync call to devicectl (Dumpmode, SaveLog)" into tizen

4 years agoInitialize battery.capacity to 0 24/228224/2
Youngjae Cho [Fri, 20 Mar 2020 01:26:16 +0000 (10:26 +0900)]
Initialize battery.capacity to 0

Change-Id: If36d9691a98be9e32907602cce26ffaca77baffa
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoApply dbus sync call to devicectl (Dumpmode, SaveLog) 54/228254/2
Hyotaek Shim [Fri, 20 Mar 2020 04:04:11 +0000 (13:04 +0900)]
Apply dbus sync call to devicectl (Dumpmode, SaveLog)

Change-Id: Id13ffd344c7600068da351fb0d9b0c09303b37f8
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoChange log priority 48/228248/1
Youngjae Cho [Fri, 20 Mar 2020 03:37:04 +0000 (12:37 +0900)]
Change log priority

Change-Id: I769f74865d18961d2806426b940e2760e2bdae5a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRemove unused code: sim_signal_hanlder() 71/228171/1
Youngjae Cho [Thu, 19 Mar 2020 09:24:14 +0000 (18:24 +0900)]
Remove unused code: sim_signal_hanlder()

Change-Id: I1e33a45f8f0150e8f671152da1a1b05c38218538
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoMove PM_DEFAULT_BRIGHTNESS into display_conf 60/228160/1
Youngjae Cho [Thu, 19 Mar 2020 08:43:26 +0000 (17:43 +0900)]
Move PM_DEFAULT_BRIGHTNESS into display_conf

All profiles have used PM_DEFAULT_BRIGHTNESS as a same value of 80,
but now the wearable profile is changed to use 70. So move this
information into each profile's display_conf and delete the macro.
And fixed related code.

Change-Id: I4207bb88173aee3f6769c8c64ec616799f1c1b48
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoMove battery status backup after checking is done 55/227555/2
Youngjae Cho [Thu, 12 Mar 2020 23:55:50 +0000 (08:55 +0900)]
Move battery status backup after checking is done

Sometimes, battery status is changed quickly, previous status does
not stored at backup structure. so move them after checking is done.

Change-Id: I0ee56f035a74eadea40b5747aff0ac8e3896deea
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd poweroff stage to clarify poweroff sequence 94/227994/5
Youngjae Cho [Wed, 18 Mar 2020 03:27:45 +0000 (12:27 +0900)]
Add poweroff stage to clarify poweroff sequence

POWEROFF_DEFAULT
 - Default stage, poweroff has not been triggered
POWEROFF_TRIGGERED
 - Poweroff is triggered. Wait timer can be added up to this stage
POWEROFF_WAIT_OTHERS
 - Wait for other processes to clean up their resources

Change-Id: Iaf744a624c230a3d0ffc588aa60138264f184c72
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoremove unused code 22/227922/1
Semun Lee [Tue, 17 Mar 2020 08:10:10 +0000 (17:10 +0900)]
remove unused code

It creates unncessary noise in static analyzers

Change-Id: I269efd772f54794b584c99eb224a4f1ba502f2e2
Signed-off-by: Semun Lee <semun.lee@samsung.com>
4 years agoModify usb debug message 72/227772/4
INSUN PYO [Mon, 16 Mar 2020 08:48:27 +0000 (17:48 +0900)]
Modify usb debug message

Change-Id: I0a3c558221010674a489d9d196db76b0f3d7a96a

4 years agoFix display plugin load error 64/227764/1
Youngjae Cho [Mon, 16 Mar 2020 08:00:18 +0000 (17:00 +0900)]
Fix display plugin load error

Add dummy is_display_detached() for mobile, iot, tv to resolve undefined
symbol error.

Change-Id: I4ed5eb1565a5afff119e9d7c40a2b385744ad92c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix SIGCHLD handling 22/227722/2
Youngjae Cho [Mon, 16 Mar 2020 03:54:43 +0000 (12:54 +0900)]
Fix SIGCHLD handling

Don't treat ECHILD as an error case as it means this SIGCHLD had
already been handled somewhere else.

Change-Id: I115c942b5ec616bf21873e806b6f97add959f054
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix sound issue when wireless charger is attached 00/227500/1
Yunmi Ha [Thu, 12 Mar 2020 07:30:35 +0000 (16:30 +0900)]
Fix sound issue when wireless charger is attached

Change-Id: I683c51ff038d283afcd626021c4fd14c535b638a
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoProhibit turning on display when display has been detached 82/226882/3
Youngjae Cho [Fri, 6 Mar 2020 05:50:16 +0000 (14:50 +0900)]
Prohibit turning on display when display has been detached

Kernel set lcd_power node to 5 when display is detached. If the node's
value is 5, deviced should ignore lcd on request. To this end, add
return statement at the point that can be the entry of the LCDON
procedure. Below are the functions that can be a beginning of LCDON.
 - __pm_change_internal
 - default_trans
 - default_action
 - lcd_on_direct
 - lcd_on_procedure
 - dbus_changestatebyreason
 - dbus_changestate
 - dbus_customlcdon
 - switch_on_lcd

Change-Id: Ibee6139dede213dbcde715c928a2df64c3757324
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRemove unused gloable variable info 41/227441/1
INSUN PYO [Thu, 12 Mar 2020 03:11:18 +0000 (12:11 +0900)]
Remove unused gloable variable info

Change-Id: I01f584f4ea75afa96fc8d628d9d8f0812442faf9

4 years agoFixed using NULL string in gvariant 25/227425/1
INSUN PYO [Wed, 11 Mar 2020 23:43:19 +0000 (08:43 +0900)]
Fixed using NULL string in gvariant

$ dbus-send  --type=method_call --print-reply --reply-timeout=1000 --system --dest=org.tizen.system.deviced /Org/Tizen/System/DeviceD/Board org.tizen.system.deviced.Board.GetSerial
method return time=946688500.085742 sender=:1.56 -> destination=:1.107 serial=39 reply_serial=2
   string "[Invalid UTF-8]"
   int32 -95

Change-Id: Iff775727ee31278c445929477217457c67b7a7da

4 years agoFix memory leak 41/227141/4
INSUN PYO [Tue, 10 Mar 2020 04:19:18 +0000 (13:19 +0900)]
Fix memory leak

Change-Id: Ieff593d532ec1522849af8c27f119e235b6d68f6

4 years agoFix lowbat_execute() timer to keep the last one 63/227363/2
Hyotaek Shim [Wed, 11 Mar 2020 11:15:53 +0000 (20:15 +0900)]
Fix lowbat_execute() timer to keep the last one

Change-Id: I434fb580ff90e2b5bcdd78d6fc7bede495954eb3
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoAdd timer to ignore discharging signal from kernel 79/227279/3
Youngjae Cho [Wed, 11 Mar 2020 05:06:16 +0000 (14:06 +0900)]
Add timer to ignore discharging signal from kernel

Change-Id: Ib6e495c4515fe193b2e38332d818621e8d03a26a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRemove the duplicated usb_client->disable() function. 68/227268/1
INSUN PYO [Wed, 11 Mar 2020 04:42:24 +0000 (13:42 +0900)]
Remove the duplicated usb_client->disable() function.

Change-Id: Idf5a5e321facd206f3f7cac3e1b9cf8509f8b9b9

4 years agoIntroduce 3 level AOD brightness 94/227194/3
Youngjae Cho [Tue, 10 Mar 2020 09:02:20 +0000 (18:02 +0900)]
Introduce 3 level AOD brightness

Change-Id: Iae0ca878f7702e72cccf9ff54f26da59e3b3e78e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRemove VCONFKEY_SETAPPL_AMBIENT_MODE_BOOL 22/227222/1
Hyotaek Shim [Tue, 10 Mar 2020 11:58:45 +0000 (20:58 +0900)]
Remove VCONFKEY_SETAPPL_AMBIENT_MODE_BOOL

replaced by "db/starter/always_on_display"

Change-Id: Ie2b756eb9ed5e963ea6127a3d4000eeb99fde61b
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoChange vconfkey about ambient condition 59/227159/2 accepted/tizen/unified/20200311.130809 submit/tizen/20200310.104300
Youngjae Cho [Tue, 10 Mar 2020 05:36:27 +0000 (14:36 +0900)]
Change vconfkey about ambient condition

Change-Id: I8411394a2f2317374a503349a0bea095b78051d4
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoMove checking current usb mode to usb_change_mode 17/227117/5
INSUN PYO [Tue, 10 Mar 2020 02:22:01 +0000 (11:22 +0900)]
Move checking current usb mode to usb_change_mode

Change-Id: I96cab5ebc7647cadda4e93c5f7b6ce025b4caafb

4 years agoChange bezel state when vconf changes in LCDOFF 06/227106/3
Youngjae Cho [Tue, 10 Mar 2020 01:36:25 +0000 (10:36 +0900)]
Change bezel state when vconf changes in LCDOFF

Change-Id: I3209c2b1c797d47420acffe4e2dbc93426662dc3
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoImprove handling of the usb debug mode 08/227108/4
INSUN PYO [Tue, 10 Mar 2020 01:49:41 +0000 (10:49 +0900)]
Improve handling of the usb debug mode

debug  on + rndis  on : USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_RNDIS
debug  on + rndis off : USB_FUNCTION_MTP | USB_FUNCTION_ACM | USB_FUNCTION_SDB
debug off + rndis  on : USB_FUNCTION_RNDIS
debug off + rndis off : USB_FUNCTION_MTP | USB_FUNCTION_ACM

Change-Id: I917efe98e4ed0e722efb938cb809116cba8001d9

4 years agoImprove handling of the usb tethering mode 04/227104/5
INSUN PYO [Tue, 10 Mar 2020 00:36:48 +0000 (09:36 +0900)]
Improve handling of the usb tethering mode

On: Use predefined mode (USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_RNDIS)
Off: Use predefined mode (USB_FUNCTION_MTP | USB_FUNCTION_ACM) + USB_FUNCTION_SDB(conditional)

Caution: If usb debug menu was enabled, add USB_FUNCTION_SDB to new mode to use.
When tethering is enabled, additionally enable usb debug(USB_FUNCTION_SDB) unconditionally.
Since usb debug is always enabled when you turn off usb tethering, there is no way to know if usb debug was enabled or not.
So before enabling usb tethering, save the previous state.
This saved value is used to check if the debug menu was enabled or not when you turn off usb tethering.

In addition, if someone changes the usb mode while tethering on,
use the latest usb mode to determine the usb debug mode instead of using the saved value.

Change-Id: I20cf762f4d45b96cd7142cf3e6e43a402213a415

4 years agoAdd additional conditions for bezel wakeup 65/227065/3
Youngjae Cho [Mon, 9 Mar 2020 09:28:44 +0000 (18:28 +0900)]
Add additional conditions for bezel wakeup

(UX improvement for DND mode)
If every or either of the two vconf keys below is true,
 - VCONFKEY_SETAPPL_THEATER_MODE_ENABLE
 - VCONFKEY_SETAPPL_GOODNIGHT_MODE_ENABLE
disables bezel wakeup even if bezel wakeup is turned on.

Change-Id: I96d40593dd5ca6ae6e2bb7d7fa9feb13ad59568c
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoFix dbus_getbrightness to consider pm_cur_state 36/226936/7
Hyotaek Shim [Fri, 6 Mar 2020 11:07:56 +0000 (20:07 +0900)]
Fix dbus_getbrightness to consider pm_cur_state

Change-Id: I52ba74786246d399ddd915e90e03bf089a205817
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoRearrange the send_usb_state_changed_event code when usb_change_mode is called 02/226902/2
INSUN PYO [Fri, 6 Mar 2020 07:19:54 +0000 (16:19 +0900)]
Rearrange the send_usb_state_changed_event code when usb_change_mode is called

Change-Id: I5b890d82c78b1739a93e55880f0ae7e59135e7db

4 years agoTurn off display when display is detached 84/226784/5
Youngjae Cho [Thu, 5 Mar 2020 08:26:14 +0000 (17:26 +0900)]
Turn off display when display is detached

Change-Id: I09a203694da1af7bb564cf4faa5839c119839b21
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFixed the vconf values in usb debug mode and usb selected mode to always match 24/226824/2
INSUN PYO [Thu, 5 Mar 2020 23:50:32 +0000 (08:50 +0900)]
Fixed the vconf values in usb debug mode and usb selected mode to always match

1. When usb mode is changed, debug mode should be 1 if sdb is enabled and 0 if disabled.
2. If sdb is enabled in selected mode when deviced starts, enable debug mode; otherwise disable.

Change-Id: I8b85bc2d31c0febfccf844619b6ad53a160161ac

4 years agoFix to shutdown usb0 interface when USB cable is disconnected in rndis mode 24/226724/1
INSUN PYO [Thu, 5 Mar 2020 03:51:49 +0000 (12:51 +0900)]
Fix to shutdown usb0 interface when USB cable is disconnected in rndis mode

When the usb cable is disconnected, it just disables the gadget, but keeps the gadget's configuration.
So usb0 is left and rndis.service fails the next time you plug the usb cable.

Change-Id: I4245f4cbfcc71b6f42dd9332de2b6e7f564e1358

4 years agoRemove duplicate code and clean up in usb module 29/226629/13
INSUN PYO [Wed, 4 Mar 2020 07:44:13 +0000 (16:44 +0900)]
Remove duplicate code and clean up in usb module

usb_config_init and usb_change_gadget are duplicated with the exact same code.

Change-Id: Ie3899df4ccb8d2c861b9af80ed4e652e7bb7a489

4 years agoFix critical log for long lasting lock 33/226633/1
Hyotaek Shim [Wed, 4 Mar 2020 07:55:51 +0000 (16:55 +0900)]
Fix critical log for long lasting lock

Change-Id: Ibd9d1e8bbf5e0409f5879614d46f90f795c5b68a
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoAdd is_app() as a common api 27/226627/2
Hyotaek Shim [Wed, 4 Mar 2020 07:43:06 +0000 (16:43 +0900)]
Add is_app() as a common api

Change-Id: I5d195ffea25602af85276145a41a4d849696e7d8
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoRearrange display lock and unlock in the usb module 09/226609/4
INSUN PYO [Wed, 4 Mar 2020 06:17:33 +0000 (15:17 +0900)]
Rearrange display lock and unlock in the usb module

If an error occurs during usb enable, do not acquire display lock.
Target may enter sleep mode with the USB cable is connected

To prevent this situation, acquire the lock when usb cable is connected,
and release the lock when usb cable is disconnected.

Change-Id: I9850e593957e182a415298eeb63361d09c21dc3a

4 years agoRefactoring usb_state_update_state #5 88/226588/3
INSUN PYO [Wed, 4 Mar 2020 04:53:53 +0000 (13:53 +0900)]
Refactoring usb_state_update_state #5

Reimplemented by separating change_usb_state_notification_handler() from usb_state_update_state().

A change_usb_state_notification_handler() is only changed when the usb gadget is enabled or disabled.

Change-Id: I58a30bf3a41abe082ed5f91da2cddd232ed0c6e4

4 years agoRefactoring usb_state_update_state #4 73/226573/6
INSUN PYO [Wed, 4 Mar 2020 03:25:48 +0000 (12:25 +0900)]
Refactoring usb_state_update_state #4

Reimplemented by separating send_usb_state_changed_event() from usb_state_update_state().

USB_DISCONNECTED                  : VCONFKEY_SYSMAN_USB_DISCONNECTED
USB_CONNECTED + USB_FUNCTION_NONE : VCONFKEY_SYSMAN_USB_CONNECTED
USB_CONNECTED + USB_FUNCTION_OOOO : VCONFKEY_SYSMAN_USB_AVAILABLE

When connecting the usb cable     : "disconnected"(previous value) -> "connected" -> "available"
When disconnecting the usb cable  : "available"(previous value) -> "dosconnected"
When changing usb mode            : "available"(previous value) -> "connected" -> "available"

When USB cable is connected but USB initialization fails : It stays "connected" without going to "available"

Change-Id: I8a9d84884388bb0dcf24f44735224c695d2f10ec

4 years agoAdd critical-log for long lasting lock 17/226517/6
Youngjae Cho [Tue, 3 Mar 2020 08:34:04 +0000 (17:34 +0900)]
Add critical-log for long lasting lock

Check locks every 10 minutes. (disp_plgn.lockcheck_timeout = 600)

Change-Id: I6cee6df8e46f947131a30c46c373332d456134dd
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRevert "Add more robust usb error handling" 04/226504/3
INSUN PYO [Tue, 3 Mar 2020 06:57:59 +0000 (06:57 +0000)]
Revert "Add more robust usb error handling"

This reverts commit 982e0040a8ed197ea2a35c05052ae3bacd2f6068.

Change-Id: I634d301d2b22a905e8c2d014076f847eb1b3fa73

4 years agoRefactoring usb_state_update_state #3 86/226486/6
INSUN PYO [Tue, 3 Mar 2020 06:02:40 +0000 (15:02 +0900)]
Refactoring usb_state_update_state #3

Reimplemented by separating usb_state_set_current_mode() from usb_state_update_state().

A usb_state_set_current_mode() is olny changed when the usb gadget is enabled or disabled.

Change-Id: I0baaf031f52d2417d9aef84d56ff4b0e4c394b5f

4 years agoDelete critical-log for pmlock/unlock 83/226483/1
Youngjae Cho [Tue, 3 Mar 2020 05:36:40 +0000 (14:36 +0900)]
Delete critical-log for pmlock/unlock

Change-Id: Ia09f99ad4a94adc5e2272cf6650c7832910e07a2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRefactoring usb_state_update_state #2 71/226471/4
INSUN PYO [Tue, 3 Mar 2020 05:09:39 +0000 (14:09 +0900)]
Refactoring usb_state_update_state #2

Reimplemented by separating usb_state_set_connection() from usb_state_update_state().

A usb_state_set_connection() is olny changed when the usb cable is connected or disconnected.

Change-Id: Ib2f9ca0eb12cb60e9f50f5badcedacaa71f8663b

4 years agoAdd usb configuration exception handling code 50/226450/3
INSUN PYO [Tue, 3 Mar 2020 02:42:50 +0000 (11:42 +0900)]
Add usb configuration exception handling code

If an error occurs during usb configuration, change the usb current mode to USB_FUNCTION_NONE.

The meaning of usb current mode is that usb is working correctly.
If any error occurs, USB operation is not guaranteed.
The value of usb current mode should not have a meaningless value and should have USB_FUNCTION_NONE.

Change-Id: Ia882f517fe696a03cf1a39f97b382383d970e9d5

4 years agoAdd more robust usb error handling 39/226439/2 accepted/tizen/unified/20200303.170228 submit/tizen/20200303.002902
INSUN PYO [Tue, 3 Mar 2020 00:06:06 +0000 (09:06 +0900)]
Add more robust usb error handling

The extcon uvent handler usb_state_changed() handles errors for usb connect/disconnect,
but adds additional exception handling code for more robust usb error handling.

Change-Id: I6c79fa99078ec71a19a2a72a94d28d31c8b9571f

4 years agoAdd pmqos for WirelessSendFile 18/226218/1
Youngjae Cho [Fri, 28 Feb 2020 04:07:25 +0000 (13:07 +0900)]
Add pmqos for WirelessSendFile

Change-Id: I6d721794f937d99dee51d22e200691b4c3abdf5e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoCleanup usb code 66/226066/4 submit/tizen/20200228.005656
INSUN PYO [Wed, 26 Feb 2020 10:32:25 +0000 (19:32 +0900)]
Cleanup usb code

Change-Id: I6bee810fb808b2caf6de69bcd17db2a9ea4b8677

4 years agoFix SVACE 62/226062/2
Hyotaek Shim [Wed, 26 Feb 2020 10:15:22 +0000 (19:15 +0900)]
Fix SVACE

After having been compared to NULL value at bezel.c:111,
pointer 'bezel_dev->set_sw_state' is dereferenced at bezel.c:128

Change-Id: I7bf465007fffe6f373621ac3ca16e0df0117929a
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoFixed to use default usb sel mode(MTP + ACM) for invalid vocnf value #2 59/226059/1
INSUN PYO [Wed, 26 Feb 2020 09:57:06 +0000 (18:57 +0900)]
Fixed to use default usb sel mode(MTP + ACM) for invalid vocnf value #2

Change-Id: I304abc9eef84328887f7ec6da282ae8aa43a2f6b

4 years agoFix wearable_mode() related code according to profile 88/225988/6
Youngjae Cho [Wed, 26 Feb 2020 04:45:44 +0000 (13:45 +0900)]
Fix wearable_mode() related code according to profile

Leave one of 'if' or 'else' statement related to wearable_mode()
according to profile.

Change-Id: I378ce12d334444dcfc4643dafb256eca4abc16cb
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRefactoring usb_state_update_state 96/225996/4
INSUN PYO [Wed, 26 Feb 2020 05:38:25 +0000 (14:38 +0900)]
Refactoring usb_state_update_state

Since these four functions are handled in one function, they must be separated.

1. add and remove usb state notification handler
2. change usb connection state
3. send usb state changed event: event, vconf, dbus signal
4. change usb current mode

Change-Id: I202a069f36b7feb5a7c0db38e2d2e15f805802aa

4 years agoAdd delay to set_brightness_level() when AOD is on 65/225865/4
Youngjae Cho [Tue, 25 Feb 2020 05:38:22 +0000 (14:38 +0900)]
Add delay to set_brightness_level() when AOD is on

When display state changes from AOD to LCDON, brightness change
effect seems sluggish because of heavy load of jobs for turning on
display. So delay this brightness change a bit to avoid this
heavy loaded time and therefore make it change smoothly.

Change-Id: Ie59e572becbb4bfc204634d5720818531d43121e
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFixed to use default usb sel mode(MTP + ACM) for invalid vocnf value 73/225973/4
INSUN PYO [Wed, 26 Feb 2020 03:30:53 +0000 (12:30 +0900)]
Fixed to use default usb sel mode(MTP + ACM) for invalid vocnf value

Deviced must never run in USB_FUNCTION_NONE mode.
So if vconf value is invalid, deviced uses the default usb mode internally.
Keep the problematic vconf values in order to define the problem correctly.

Change-Id: Iaeda7d02accbdc3576acb173f4c60cbe38f33519

4 years agoFix build warning 66/225866/1
Youngjae Cho [Tue, 25 Feb 2020 05:56:34 +0000 (14:56 +0900)]
Fix build warning

Change-Id: Ie04008f348ccb3c2b23fffcaeab0ec53651e7045
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd software bezel control 89/225689/9 accepted/tizen/unified/20200225.224439 submit/tizen/20200225.024742
Youngjae Cho [Mon, 24 Feb 2020 03:06:33 +0000 (12:06 +0900)]
Add software bezel control

Change-Id: I1c1625892c7d04531d88079fdb70ab404a9c6065
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRemove is_emulator() on usb 83/225683/3
INSUN PYO [Mon, 24 Feb 2020 03:10:01 +0000 (12:10 +0900)]
Remove is_emulator() on usb

Deviced only uses three functions in usb_client hal: disable, enable and reconfigure_gadget.
If emulator's usb_client hal provides these three functions as dummy,
deviced can be used on both the emulator and target as a single code.

Change-Id: Ie2f32403e9767f65d4166ab8be6c83b68891b452

4 years agoRemoved the usb_state_changed() function that was called by usb_init() without meaning. 15/225715/2
INSUN PYO [Mon, 24 Feb 2020 06:09:30 +0000 (15:09 +0900)]
Removed the usb_state_changed() function that was called by usb_init() without meaning.

The following call stack ensures that usb_state_changed() is called after usb_init.
///////////////////////////////////////////////////////////////////////////////////////////////////////////
extcon_init() --> usb_init() -->
event_handler_state_changed (DEVICE_NOTIFIER_STATE_START) --> add_extcon_event_handler() -->
get_extcon_init_state() -> config_parse() -> extcon_load_uevent() -> extcon_update() -> usb_state_changed()
///////////////////////////////////////////////////////////////////////////////////////////////////////////

Also, when usb_state_changed() is called from usb_init,
the extcon value is always -1 because the extcon initial value has not yet been retrieved.

The initial state of usb_state_changed() is -1, and usb_state_changed(-1) does nothing.

Change-Id: I77d774c9a396b3773203a69db83aa408e315205a

4 years agoRemoved "route add" in rndis usb mode 04/225704/1
INSUN PYO [Mon, 24 Feb 2020 05:06:30 +0000 (14:06 +0900)]
Removed "route add" in rndis usb mode

Ifconfig command will also automatically add route information to the routing table in the kernel.
So if you run "route add" additionally, you have duplicate routing table entries.

sh-3.2# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.0.1     0.0.0.0         UG    0      0        0 wlan0
cns1.sec.samsun 192.168.0.1     255.255.255.255 UGH   0      0        0 wlan0
cns2.sec.samsun 192.168.0.1     255.255.255.255 UGH   0      0        0 wlan0
192.168.0.0     *               255.255.255.0   U     0      0        0 wlan0
192.168.0.1     *               255.255.255.255 UH    0      0        0 wlan0
192.168.129.0   *               255.255.255.0   U     0      0        0 usb0   <== here
192.168.129.0   *               255.255.255.0   U     0      0        0 usb0   <== here

Change-Id: I96c290ce5de1da81ff7b9f99cfaefc8a64b618ac

4 years agoadd static keyword to locally used functions 63/224563/2
sanghyeok.oh [Tue, 11 Feb 2020 12:10:34 +0000 (21:10 +0900)]
add static keyword to locally used functions

Change-Id: Ia9869628db2e6fe89f3a95d89894f4c31eeb9592
Signed-off-by: sanghyeok.oh <sanghyeok.oh@samsung.com>
4 years agoAdd LCD_OFF_COMPLETE notifier 84/225584/1
Youngjae Cho [Fri, 21 Feb 2020 05:49:59 +0000 (14:49 +0900)]
Add LCD_OFF_COMPLETE notifier

DEVICE_NOTIFIER_LCD_OFF_COMPLETE is used for disabling lbm on LCDOFF.

Change-Id: I88064ef316dd69623be197e5824c168c0069bf74
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd strings for LCDON triggered from bezel/backkey 99/225499/3
Youngjae Cho [Thu, 20 Feb 2020 08:40:45 +0000 (17:40 +0900)]
Add strings for LCDON triggered from bezel/backkey

Change-Id: I2dc3a91991ee318b5419822f8f161d648820715d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agosync usb mode index with vconf 67/225567/1
INSUN PYO [Fri, 21 Feb 2020 03:47:17 +0000 (12:47 +0900)]
sync usb mode index with vconf

Change-Id: Ifa79010dd982e48df995a02a6c6dc519c0e40733

4 years agoAdd FreqStrength to locate optimal position for D2D charging 61/225461/3
Youngjae Cho [Thu, 20 Feb 2020 05:54:28 +0000 (14:54 +0900)]
Add FreqStrength to locate optimal position for D2D charging

For D2D charge, user doesn't know the optimal location for charging.
To improve this, support information about frequency strength to user
so that they can adjust device charging position.

Change-Id: Id002cc62b1aaf37d31328fcc47e0ef3368a0a20f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoUpdate pm_cur_state correctly in lcd_on_direct() 49/225449/1
Youngjae Cho [Thu, 20 Feb 2020 04:17:39 +0000 (13:17 +0900)]
Update pm_cur_state correctly in lcd_on_direct()

Change-Id: Ic72bbd46a90a597e814de87b45f9c2962d3d7e0d
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix dbus method: change_usb_client_mode() 66/225366/8 accepted/tizen/unified/20200221.093446 submit/tizen/20200220.052758
Youngjae Cho [Wed, 19 Feb 2020 08:23:02 +0000 (17:23 +0900)]
Fix dbus method: change_usb_client_mode()

Change-Id: I285ecde35f611642bbec068ddade0482107603a5
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRemove to check if mtp-responder.service exists. 83/225283/2 accepted/tizen/unified/20200220.122436 submit/tizen/20200218.230813
INSUN PYO [Wed, 19 Feb 2020 00:00:21 +0000 (09:00 +0900)]
Remove to check if mtp-responder.service exists.

If you disable mtp mode if there is not mtp service.
The predefined usb mode and current usb state do not match.

So, mtp-responder-dummy.service is created int libdevice-node.
This prevents inconsistencies between predefined usb mode and the current state.

Change-Id: I05dec48b4aabe8bbf0f9139502a2092e518d1aa3

4 years agoMerge "Fix usb mode<->vconf conversion" into tizen
INSUN PYO [Wed, 19 Feb 2020 07:28:34 +0000 (07:28 +0000)]
Merge "Fix usb mode<->vconf conversion" into tizen

4 years agoFix usb mode<->vconf conversion 11/224811/11
Youngjae Cho [Thu, 13 Feb 2020 07:40:09 +0000 (16:40 +0900)]
Fix usb mode<->vconf conversion

We consider usb mode is always valid wherease usb vconf may not
represent the mode correctly as it is determined manually. (eg.
As mode mapping table or vconf definition is hard-coded manually,
it can cause mismatch as usb policy changes.) So mode update always
take place, but vconf update doesn't if converted vconf is invalid.
You can see this in usb_state_set_selected_mode(). usb_selected_mode
is always updated regardless of converted vconf is valid or not. The
vconf update, on the other hand, doesn't take place if the converted
vconf is invalid.

Change-Id: I4f7b0d7529b3612947baf2b9869f4b77571d264f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoEnable rndis usb mode for tv and iot profile 19/225219/2
INSUN PYO [Tue, 18 Feb 2020 06:07:35 +0000 (15:07 +0900)]
Enable rndis usb mode for tv and iot profile

Iot profile use rndis usb mode without usb tethering feature.
So, all profile have to support usb rndis mode.

Change-Id: Ib75aaf0c141fcb8b554cdcd2adea9a8ad37e3b02

4 years agoAdd iot-display.conf 90/225190/1 accepted/tizen/unified/20200219.130218 submit/tizen/20200218.060818
Hyotaek Shim [Tue, 18 Feb 2020 05:36:27 +0000 (14:36 +0900)]
Add iot-display.conf

Change-Id: I40b5b40f7cabb5165baaaacf6776139f1faf22cc
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoIntroduce critical-log API from dlog 87/225087/4
Youngjae Cho [Mon, 17 Feb 2020 08:14:58 +0000 (17:14 +0900)]
Introduce critical-log API from dlog

Below are added as critical-log
- Power(Display) lock/unlock
- PowerOff/Reboot
- Battery status/health

Change-Id: I6f2f5b1ee660d4f6a8a426b71d311719f9304a36
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoDelete critical-log module 08/225108/1
Youngjae Cho [Mon, 17 Feb 2020 09:47:41 +0000 (18:47 +0900)]
Delete critical-log module

Replace critical-log module to dlog API

Change-Id: Ie2e7c6ddebe47a1d5c89cf494f7ce0fe6102f89f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd dbus interface for setting DIM_FLAG 96/224896/6 accepted/tizen/unified/20200216.215210 submit/tizen/20200214.104608
Youngjae Cho [Fri, 14 Feb 2020 02:43:05 +0000 (11:43 +0900)]
Add dbus interface for setting DIM_FLAG

Path       : /Org/Tizen/System/DeviceD/Display
Interface  : org.tizen.system.deviced.display
Method     : DimStayControl
Signature  : "(i)"
Parameter  : 0(Unset flag), 1(Set flag)

Control DimStay. Update DIM_FLAG and change brightness accordingly.

Change-Id: I7b3197a965044fdf9e0313ebf8b4d1f383ea7017
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix coverity issue 24/224824/1
Youngjae Cho [Thu, 13 Feb 2020 08:36:57 +0000 (17:36 +0900)]
Fix coverity issue

CID 1123903 (#1 of 1): Incorrect deallocator used (ALLOC_FREE_MISMATCH)

Change-Id: I88366204c9bb349e42dd3a79688a1c13280fe622
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoAdd static configurations for usb gadget mode according to sdb debugging on/off 22/224722/3
INSUN PYO [Wed, 12 Feb 2020 10:59:58 +0000 (19:59 +0900)]
Add static configurations for usb gadget mode according to sdb debugging on/off

On:
SET_USB_SDB (USB_FUNCTION_MTP | USB_FUNCTION_ACM | USB_FUNCTION_SDB)

Off:
SET_USB_DEFAULT (USB_FUNCTION_MTP | USB_FUNCTION_ACM)

Change-Id: I88248ee3508a9529f875bb85a12b020907e40798

4 years agoAdd static configurations for usb gadget mode according to tethering on/off 87/224687/7
INSUN PYO [Wed, 12 Feb 2020 08:00:20 +0000 (17:00 +0900)]
Add static configurations for usb gadget mode according to tethering on/off

On:
SET_USB_RNDIS_SDB (USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_RNDIS)

Off:
SET_USB_SDB (USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_MTP)

Change-Id: I18cad16c6cebfa6d168beb2acca6462e673d2701
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoMerge "Improved log readability" into tizen
INSUN PYO [Wed, 12 Feb 2020 07:24:29 +0000 (07:24 +0000)]
Merge "Improved log readability" into tizen

4 years agoChange usb_cur_mode from bitOR to index. 05/224505/7
INSUN PYO [Tue, 11 Feb 2020 06:15:23 +0000 (15:15 +0900)]
Change usb_cur_mode from bitOR to index.

In MCD 4.0, VCONFKEY_USB_SEL_MODE has been changed to usb function index instead of bitOR of USB_FUNCTION_OOO.
Deviced works internally as bitOR of USB_FUNCTION_OOO, so you must convert it when you read/write from vconf.
Since these two values are not 1:1 mapping, so you have to be careful when you convert bitOR to usb function index.

Mapping table
//////////////////////////////////////////////////////////////////////////////////////////////
[SET_USB_NONE]            = USB_FUNCTION_NONE
[SET_USB_DEFAULT]         = USB_FUNCTION_MTP | USB_FUNCTION_ACM
[SET_USB_SDB]             = USB_FUNCTION_MTP | USB_FUNCTION_ACM | USB_FUNCTION_SDB
[SET_USB_SDB_DIAG]        = USB_FUNCTION_MTP | USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_DIAG
[SET_USB_RNDIS_TETHERING] = USB_FUNCTION_RNDIS | USB_FUNCTION_SDB | USB_FUNCTION_ACM
[SET_USB_RNDIS]           = USB_FUNCTION_RNDIS
[SET_USB_RNDIS_SDB]       = USB_FUNCTION_RNDIS | USB_FUNCTION_SDB | USB_FUNCTION_ACM
[SET_USB_DIAG_SDB]        = USB_FUNCTION_MTP | USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_DIAG
[SET_USB_RNDIS_DIAG]      = USB_FUNCTION_RNDIS | USB_FUNCTION_DIAG
[SET_USB_DIAG_RMNET]      = USB_FUNCTION_DIAG | USB_FUNCTION_RMNET
[SET_USB_ACM_SDB_DM]      = USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_DM
[SET_USB_RNDIS_SDB_ACM]   = USB_FUNCTION_RNDIS | USB_FUNCTION_ACM | USB_FUNCTION_SDB

Reverse mapping table
//////////////////////////////////////////////////////////////////////////////////////////////
USB_FUNCTION_NONE                                                          = SET_USB_NONE
USB_FUNCTION_RNDIS                                                         = SET_USB_RNDIS
USB_FUNCTION_MTP | USB_FUNCTION_ACM                                        = SET_USB_DEFAULT
USB_FUNCTION_DIAG | USB_FUNCTION_RNDIS                                     = SET_USB_RNDIS_DIAG
USB_FUNCTION_DIAG | USB_FUNCTION_RMNET                                     = SET_USB_DIAG_RMNET
USB_FUNCTION_MTP | USB_FUNCTION_ACM | USB_FUNCTION_SDB                     = SET_USB_SDB
USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_RNDIS                   = SET_USB_RNDIS_SDB
USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_DM                      = SET_USB_ACM_SDB_DM
USB_FUNCTION_MTP | USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_DIAG = SET_USB_SDB_DIAG

Mapping excluded from reverse table
//////////////////////////////////////////////////////////////////////////////////////////////
USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_RNDIS                   = SET_USB_RNDIS_TETHERING
USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_RNDIS                   = SET_USB_RNDIS_SDB_ACM
USB_FUNCTION_MTP | USB_FUNCTION_ACM | USB_FUNCTION_SDB | USB_FUNCTION_DIAG = SET_USB_DIAG_SDB

Change-Id: I3bd0227e274a45135218ae1b015926e13dd9469a

4 years agoImproved log readability 96/224596/1
INSUN PYO [Wed, 12 Feb 2020 02:20:09 +0000 (11:20 +0900)]
Improved log readability

Change-Id: I5b48879b74fd9a73e8ff889781146cd73ceddc5e

4 years agoFix coverity issue 35/224535/2
Youngjae Cho [Tue, 11 Feb 2020 08:53:57 +0000 (17:53 +0900)]
Fix coverity issue

CID 1099199 (#1 of 1): Read from pointer after free (USE_AFTER_FREE)
20. deref_after_free: Dereferencing freed pointer elem.

Change-Id: I85c34f351db0cc10ce384176b90ba72067e3c051
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoFix lockcheck interval 22/224522/1
Youngjae Cho [Tue, 11 Feb 2020 07:56:20 +0000 (16:56 +0900)]
Fix lockcheck interval

Change-Id: Ifac60f83149cb94f8ac1392950fe57b454203cad
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoRefactoring usb current mode 68/224468/6 accepted/tizen/unified/20200212.125906 submit/tizen/20200211.051146 submit/tizen/20200213.232703
INSUN PYO [Tue, 11 Feb 2020 00:51:00 +0000 (09:51 +0900)]
Refactoring usb current mode

Change-Id: Ieaec11ed3cf352c60adf30724552a7fbdfb5a015

4 years agoFix svace issue 97/224397/4
Yunmi Ha [Mon, 10 Feb 2020 08:15:01 +0000 (17:15 +0900)]
Fix svace issue

- Remove memory-leak
- Remove unreachable code

Change-Id: Ie4f9a2819e0e839e21fa7a35aa672ed12f08f158
Signed-off-by: Yunmi Ha <yunmi.ha@samsung.com>
4 years agoDon't check if timeout is 0 in dbus_sethbm_timeout() 64/224464/2
Youngjae Cho [Tue, 11 Feb 2020 00:27:40 +0000 (09:27 +0900)]
Don't check if timeout is 0 in dbus_sethbm_timeout()

When turning off hbm, it is natural that both the value and the timeout
should be zero as parameters. For turning on the hbm, timeout 0 will be
checked again in hbm_set_state_with_timeout().

Change-Id: I97819bacdff3c156cf5c458ca5f4f230f83f1eb2
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoApply changeable RNDIS IP address 80/224280/2 accepted/tizen/unified/20200211.055725 submit/tizen/20200207.105942
INSUN PYO [Fri, 7 Feb 2020 10:16:28 +0000 (19:16 +0900)]
Apply changeable RNDIS IP address

Change-Id: Icddea9c594cf9aee5afa9d203a5681276ca8f016

4 years agoAdd log related to engineer mode for usb state 61/223761/3 accepted/tizen/unified/20200210.131756 submit/tizen/20200205.015759 submit/tizen/20200205.041356 submit/tizen/20200207.103010
INSUN PYO [Tue, 4 Feb 2020 00:52:24 +0000 (09:52 +0900)]
Add log related to engineer mode for usb state

Change-Id: Iad11d4ec9021c6854a912b3596a193545ac4b5d0

4 years agoChange powerlock/unlock signal name for consistency 23/223723/2
Youngjae Cho [Mon, 3 Feb 2020 07:34:06 +0000 (16:34 +0900)]
Change powerlock/unlock signal name for consistency

Change-Id: I7c4c81431511d7aa696220c55b49546d69574f7a
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoChange version 94/223694/1
Hyotaek Shim [Mon, 3 Feb 2020 05:53:26 +0000 (14:53 +0900)]
Change version

Change-Id: I1d0ae4cdcc6290f81c289e53ce36596d2d64f9db
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
4 years agoChange version 63/223563/2
Youngjae Cho [Fri, 31 Jan 2020 01:32:50 +0000 (10:32 +0900)]
Change version

Change-Id: Ib3bdef354fd5bec99665783e663c4c2ca078ffff
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoGenerate signal about power lock/unlock information 15/223615/5
Youngjae Cho [Fri, 31 Jan 2020 07:24:20 +0000 (16:24 +0900)]
Generate signal about power lock/unlock information

Change-Id: I75b2a36ff57243bf13a8d6bcd8047d40a015939f
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
4 years agoProvide time info for suspend/wakeup signal 05/223605/3
Youngjae Cho [Fri, 31 Jan 2020 06:23:33 +0000 (15:23 +0900)]
Provide time info for suspend/wakeup signal

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