platform/core/system/sessiond.git
22 months agoTemporarily allow all dbus policy by default 72/278372/1 accepted/tizen/unified/20220720.141517 submit/tizen/20220720.014058 submit/tizen/20220720.052140
Hyotaek Shim [Wed, 20 Jul 2022 01:40:23 +0000 (10:40 +0900)]
Temporarily allow all dbus policy by default

Change-Id: I23047031697072967a49d49fed0114a721b150a1
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
22 months agoRevert "Temporarily allow dbus policy by default" 71/278371/2
Hyotaek Shim [Wed, 20 Jul 2022 01:38:43 +0000 (01:38 +0000)]
Revert "Temporarily allow dbus policy by default"

This reverts commit 330e4429171a18f5f28e49c915c507572deff539.

Change-Id: I945e28a1d37b419d5a32425b79ffd999f08de9c6

22 months agoMerge "library: Ensure subsession_user_t does not contain garbage" into tizen
Karol Lewandowski [Tue, 19 Jul 2022 21:34:28 +0000 (21:34 +0000)]
Merge "library: Ensure subsession_user_t does not contain garbage" into tizen

22 months agoUser len 19 and len 20 tests 83/278283/3
Arkadiusz Nowak [Mon, 18 Jul 2022 07:15:40 +0000 (09:15 +0200)]
User len 19 and len 20 tests

Change-Id: Ibf7710a0248fdd0dfcafa885a1b6d9687fcce6b3

22 months agoTemporarily allow dbus policy by default 16/278316/1 submit/tizen/20220719.043933
Hyotaek Shim [Tue, 19 Jul 2022 04:38:45 +0000 (13:38 +0900)]
Temporarily allow dbus policy by default

Change-Id: Iae10d6d10904c4195e100b8631631cffebba3edf
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
22 months agoAdd a note to the sessiond.h header on the "" subsession 93/278293/1 accepted/tizen/unified/20220720.064039 submit/tizen/20220719.015501
Mateusz Majewski [Mon, 18 Jul 2022 11:37:52 +0000 (13:37 +0200)]
Add a note to the sessiond.h header on the "" subsession

Change-Id: Id6ddafd8f017ede6423b20539f0c4d0c341570ba

22 months agolibrary: Ensure subsession_user_t does not contain garbage 85/277985/2
Karol Lewandowski [Fri, 15 Jul 2022 15:16:44 +0000 (17:16 +0200)]
library: Ensure subsession_user_t does not contain garbage

Change-Id: I06fa8c004af2873a3a2926b5bde4fc62043d8f62

22 months agolibrary: Fix subsession_user_copy() 84/277984/1 accepted/tizen/unified/20220719.014548 submit/tizen/20220715.154248 submit/tizen/20220718.045828 submit/tizen/20220718.115742
Karol Lewandowski [Fri, 15 Jul 2022 15:04:08 +0000 (17:04 +0200)]
library: Fix subsession_user_copy()

This commit fixes strlen() to be invoked on source string, not
destination.

Change-Id: I9eeef27e6c713134ddfedf79e66a3f28dafb7f1d

22 months agoRelease 0.4.2 81/277981/1 submit/tizen/20220715.132635
Karol Lewandowski [Fri, 15 Jul 2022 13:00:15 +0000 (15:00 +0200)]
Release 0.4.2

Change-Id: Ifaaaede75993b827da12b55e0edaaa36ce7d70e0

22 months agolibrary: Use assert() to catch programming errors in make_new_signal_callback_client_... 92/277892/4
Karol Lewandowski [Thu, 14 Jul 2022 09:15:47 +0000 (11:15 +0200)]
library: Use assert() to catch programming errors in make_new_signal_callback_client_data()

Change-Id: I9c0b718cab9a010b8094a079e52844b2d03f0619

22 months agolibrary: Unify signal handlers 94/277894/4
Karol Lewandowski [Thu, 14 Jul 2022 10:24:59 +0000 (12:24 +0200)]
library: Unify signal handlers

This commit drops quite a lot of repetition by moving switch
and add+remove handlers common parts to separate functions.

Change-Id: I80fc2d3ab6d7990e2633b2a3660ff3ba527ea558

22 months agolibrary: Drop cb_data_ 93/277893/4
Karol Lewandowski [Thu, 14 Jul 2022 09:19:12 +0000 (11:19 +0200)]
library: Drop cb_data_

We really don't need it as repetition is negligible.  More imporantly, using explicit
paramaters (cb, cb_data) is far more readable than looking for yet another macro def.

Change-Id: Ibb0c3a3723deec76b4fa615546343393e6b82920

22 months agoAdd static where appropriate 55/277955/2
Mateusz Majewski [Fri, 15 Jul 2022 08:16:30 +0000 (10:16 +0200)]
Add static where appropriate

Change-Id: Ic3027ddecbbefd4696ddf0636407c5d4f7a2ae17

22 months agoDrop dbus_signal_subscribed 54/277954/2
Mateusz Majewski [Fri, 15 Jul 2022 08:16:08 +0000 (10:16 +0200)]
Drop dbus_signal_subscribed

... as it is unused.

Change-Id: I9724221dac88448a48ff19d98f561269e620d93e

22 months agoRemoved unused lists 51/277951/2
Arkadiusz Nowak [Fri, 15 Jul 2022 07:42:53 +0000 (09:42 +0200)]
Removed unused lists

Change-Id: I280f0852aa544d136ea8c0d8b8456ad6807e9bf3

22 months agoFix some leakage in the library 19/277819/1
Michal Bloch [Wed, 13 Jul 2022 18:50:37 +0000 (20:50 +0200)]
Fix some leakage in the library

Change-Id: I678dbb9dde715c473aa432d43d29f87e18b494d1
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoRelease 0.4.1 02/277802/2 accepted/tizen/unified/20220715.141346 submit/tizen/20220713.133213
Karol Lewandowski [Wed, 13 Jul 2022 13:02:59 +0000 (15:02 +0200)]
Release 0.4.1

Change-Id: I9f2e8ca7595cdf3214e99837074110eedfa57a37

22 months agoCorrection in test description 72/277772/3
Arkadiusz Nowak [Wed, 13 Jul 2022 06:16:28 +0000 (08:16 +0200)]
Correction in test description

Change-Id: I557a780c119530ed9680377bc82dd8bdb4293ab9

22 months agolib: get_current_user: Avoid off-by-one while copying user name 48/277748/7
Karol Lewandowski [Tue, 12 Jul 2022 22:19:52 +0000 (00:19 +0200)]
lib: get_current_user: Avoid off-by-one while copying user name

- fix off-by-one error while copying user name
- tizen style fixes

Change-Id: If2fc3204413f748526959f567fad9b032502cd75

22 months agolib: get_user_list: Numerous fixes 47/277747/5
Karol Lewandowski [Tue, 12 Jul 2022 20:15:31 +0000 (22:15 +0200)]
lib: get_user_list: Numerous fixes

- use SUBSESSION_* errors only (instead of 0/TIZEN_* domain errors)
- use exact types where possible (subsession_user_t instead of void)
- fix off-by one when copying gvariant string whose lenght >= USER_MAXLEN
- minor style fixes

Change-Id: I47821432306f48caac719e2a09c3af8c1b8b452b

22 months agolibsessiond: fix a memleak in `subsession_get_user_list` 39/277739/5
Adam Michalski [Tue, 12 Jul 2022 14:23:44 +0000 (16:23 +0200)]
libsessiond: fix a memleak in `subsession_get_user_list`

Change-Id: I543f85dfddd563db71e834acf0874dae09eb3d82

22 months agoDefault user on libsessiond 33/277733/1
Arkadiusz Nowak [Tue, 12 Jul 2022 12:28:43 +0000 (14:28 +0200)]
Default user on libsessiond

Fix test to check default user id
Minor fix in clientExample

Change-Id: I1b95e3e6f77141804d35f04f4c2169b40dc244b5

22 months agoInclude default user in `GetUserList` call 25/277725/2
Adam Michalski [Tue, 12 Jul 2022 11:32:26 +0000 (13:32 +0200)]
Include default user in `GetUserList` call

Change-Id: I9e2319615f06e2896157adba0c8545c2e41fffdc

22 months agoClearly guide how to free user_list from subsession_get_user_list() 04/277604/3
Hyotaek Shim [Mon, 11 Jul 2022 04:16:02 +0000 (13:16 +0900)]
Clearly guide how to free user_list from subsession_get_user_list()

Change-Id: Ic0cc16a072d9a8d307fd061c2fc06c0e6dd1aafc
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
22 months agoRelease 0.4 86/277586/2 accepted/tizen/unified/20220712.010805 submit/tizen/20220708.124830
Karol Lewandowski [Fri, 8 Jul 2022 12:36:20 +0000 (14:36 +0200)]
Release 0.4

Change-Id: Ic3c22630f8947c04289012ef1f057d365216e302

22 months agoClient example: minor tweaks 87/277587/1
Michal Bloch [Fri, 8 Jul 2022 12:36:45 +0000 (14:36 +0200)]
Client example: minor tweaks

Change-Id: Id79209548f37171d2c0f521858c443a23688968d
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoAdapt clientExample to char * 73/277573/6
Mateusz Majewski [Fri, 8 Jul 2022 09:21:36 +0000 (11:21 +0200)]
Adapt clientExample to char *

Change-Id: Ic68fc382f0d1e91f062ff6d40ac7885f1a864fdb

22 months agolibsessiond: Change user id from int to string type 68/277468/19
Arkadiusz Nowak [Fri, 1 Jul 2022 11:31:05 +0000 (13:31 +0200)]
libsessiond: Change user id from int to string type

Change-Id: I89da68279daa124b93eaf3a32db96e2b421d6990

22 months agoChange subsession_id type to std::string{,_view} 67/276967/18
Mateusz Majewski [Tue, 28 Jun 2022 11:30:45 +0000 (13:30 +0200)]
Change subsession_id type to std::string{,_view}

Co-authored-by: Adam Michalski <a.michalski2@partner.samsung.com>
Change-Id: Ie5d645b9172d7423f40b74c5b92c44ac106b8c1e

22 months agoRemove unnecessary `enum` 60/277360/1
Adam Michalski [Tue, 5 Jul 2022 14:54:45 +0000 (16:54 +0200)]
Remove unnecessary `enum`

Change-Id: Ibd8c2f7efb8999a97d76c69ac04f0ca6e014d42e

22 months agoRelease 0.3.1 01/277201/1 accepted/tizen/unified/20220704.213012 submit/tizen/20220701.115540
Karol Lewandowski [Fri, 1 Jul 2022 11:08:37 +0000 (13:08 +0200)]
Release 0.3.1

Change-Id: If7467fe5fb2b5549a768be32d49fe5dd3b2acc7e

22 months agoMerge "Add log notification" into tizen
Karol Lewandowski [Fri, 1 Jul 2022 10:49:25 +0000 (10:49 +0000)]
Merge "Add log notification" into tizen

22 months agoAdd log notification 40/277040/4
Arkadiusz Nowak [Wed, 29 Jun 2022 14:50:08 +0000 (16:50 +0200)]
Add log notification

Change-Id: Ia4e3809385d66e0bb7b00aee40c7bbc66a24d524

22 months agoFix an inappropriate usage of std::string_view 10/277010/2 accepted/tizen/unified/20220630.211956 submit/tizen/20220630.001059
Mateusz Majewski [Wed, 29 Jun 2022 05:55:37 +0000 (07:55 +0200)]
Fix an inappropriate usage of std::string_view

Change-Id: Ib78a4dee5588cd50ebda2666d9536acc8156de55

22 months agosessiond: Apply systemd-based dbus activation 49/276649/6
Adam Michalski [Wed, 22 Jun 2022 12:43:13 +0000 (14:43 +0200)]
sessiond: Apply systemd-based dbus activation

Change-Id: I7c5323eef839ead0fb9e3ae066310c3b50aa357e

22 months agoFix a blunder 66/276966/1
Mateusz Majewski [Tue, 28 Jun 2022 11:21:04 +0000 (13:21 +0200)]
Fix a blunder

HMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

Change-Id: I0b993c1e64fb600ef30c854ad688eef1ca6c97d5

22 months agoAdd std::string and std::string_view support to tuple_g_variant_helpers 80/276780/2
Mateusz Majewski [Fri, 24 Jun 2022 10:11:05 +0000 (12:11 +0200)]
Add std::string and std::string_view support to tuple_g_variant_helpers

std::string is supported in both cases. std::string_view is only allowed
in input and not in output.

Change-Id: Ib7d23a434309943e475e70b6a2ace943e55ec8ae

22 months agoRefactor tuple_g_variant_helpers 79/276779/2
Mateusz Majewski [Fri, 24 Jun 2022 10:06:23 +0000 (12:06 +0200)]
Refactor tuple_g_variant_helpers

... to be a bit more extensible.

Change-Id: I2c37833fd8c5296d2d81413316173a35910e7a8f

22 months agoClient example: Remove unnecessary header file 78/276778/1
Adam Michalski [Fri, 24 Jun 2022 10:07:06 +0000 (12:07 +0200)]
Client example: Remove unnecessary header file

<unistd.h> was needed by sleep/usleep calls which were used temporarily
during the client app race condition tests. It's redundant now, that's
why it has been removed.

Change-Id: I9d97189a91d6630daa5853d0f62e6ac9042e4f66

22 months agoClient example: improve commentary 33/276733/1
Michal Bloch [Thu, 23 Jun 2022 14:28:34 +0000 (16:28 +0200)]
Client example: improve commentary

Change-Id: Ibe197b04e362069c3c4d129aad2f6bdf769c8bb7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoapi: Adjust spacing 12/275912/4
Karol Lewandowski [Mon, 6 Jun 2022 10:52:14 +0000 (12:52 +0200)]
api: Adjust spacing

Change-Id: Iab0a1c38894bf6ce4f0c10ce39337e832cc253e9

22 months agoClient example: extract duplicate code 11/276611/2
Michal Bloch [Tue, 21 Jun 2022 20:15:46 +0000 (22:15 +0200)]
Client example: extract duplicate code

 * changes a loop condition to the first-last form,
   which is equivalent and used everywhere else.

 * changes `switch_user_test` to return bool to
   conform with the new convention I am in the
   process of enforcing.

Change-Id: Id233a33ab0f0977b4e6ce660457761ce27520c8e
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoClient example: rework mutexes 10/276610/2
Michal Bloch [Tue, 21 Jun 2022 18:01:42 +0000 (20:01 +0200)]
Client example: rework mutexes

 * add a lot of commentary, including to the newly added
   example of passing values to the callback.

 * use a conditional variable instead of a single mutex.
   This is because glib mutexes (and their underlying
   default POSIX mutexes) have undefined behaviour when
   trying to lock an already owned mutex from the owning
   thread. As a side effect, this gets rid of the trylock
   mechanism which (even though it worked) was confusing.

 * fix the mutex being left locked on subsession call error.

Change-Id: I1afa973bcae57ff8c7434d2365d51893ff7696d0
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoClient example: error handling fixes 09/276609/2
Michal Bloch [Tue, 21 Jun 2022 17:19:56 +0000 (19:19 +0200)]
Client example: error handling fixes

 * start handling errors from event (un-)registration and getting user list

 * use SUBSESSION_ERROR constants supplied by the lib instead of magic

 * reword error messages to better reflect what happens

Change-Id: Id282c12433aca44acabd03d4e2b1daaa86adac44
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoClient example: dispel magic around program returns 08/276608/2
Michal Bloch [Tue, 21 Jun 2022 17:01:57 +0000 (19:01 +0200)]
Client example: dispel magic around program returns

Change-Id: Icd0d78534df27e806e8764114ce05eeaf2a2c7b7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoClient example: main loop handling fixes 07/276607/2
Michal Bloch [Tue, 21 Jun 2022 16:09:04 +0000 (18:09 +0200)]
Client example: main loop handling fixes

 * use a GThread instead of std::thread since everything
   else uses glib facilities instead of C++ ones

 * extract the wait at the end into its own function

 * fix the main loop not being unref'd

Change-Id: I4fd8c938ad793dd27e53f2def5a0dece2699551b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoClient example: extract color magic to a function 06/276606/2
Michal Bloch [Tue, 21 Jun 2022 15:02:09 +0000 (17:02 +0200)]
Client example: extract color magic to a function

Could be parametrized for more colors, but somehow
these don't exist (what happened to red errors?).

Change-Id: I4450bf980089cdde602650cc126c5935e18665d7
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoClient example: cleanup globals 05/276605/2
Michal Bloch [Tue, 21 Jun 2022 14:54:59 +0000 (16:54 +0200)]
Client example: cleanup globals

 * the loop variable can be local.

 * it is safe to initialize an atomic variable
   non-atomically as long as there's only 1 thread.

 * make global constants into constexpr vars,
   as opposed to regular const vars or macros.

Change-Id: I006831917517db7e9fe0aed4a78aefccae1f2c0b
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
22 months agoclientExample: refactor some code 92/276492/6
Adam Michalski [Fri, 17 Jun 2022 09:25:50 +0000 (11:25 +0200)]
clientExample: refactor some code

- removed race condition causing the main thread to terminate before
  returns from all callbacks occured
- refactored some code to conform to the Tizen coding standards
- removed some unused variables
- added some comments to the source code

Change-Id: Ifa080f9f48747db201b7e73016b414dd5fe1b400

23 months agoRearrange the API order in sessiond.h from basic to advanced 75/276275/1 accepted/tizen/unified/20220615.135341 submit/tizen/20220614.055116
Hyotaek Shim [Tue, 14 Jun 2022 01:05:47 +0000 (10:05 +0900)]
Rearrange the API order in sessiond.h from basic to advanced

+ add .gitignore

Change-Id: Iae9c3c37a36355af9aaa10cbaeb569824c8efe2c
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
23 months agoRelease 0.3 54/276254/4
Karol Lewandowski [Mon, 13 Jun 2022 12:06:56 +0000 (14:06 +0200)]
Release 0.3

Change-Id: Iecbc675df568ee7dd88f1589145d5ee686e71e6a

23 months agolibsessiond: Drop unused code and data 59/276259/1
Karol Lewandowski [Mon, 13 Jun 2022 13:36:59 +0000 (15:36 +0200)]
libsessiond: Drop unused code and data

Change-Id: Ia02761d1f9d950e1997f9a590b7d818cd980c001

23 months agopackaging: Improve package description a bit 53/276253/3
Karol Lewandowski [Mon, 13 Jun 2022 12:05:25 +0000 (14:05 +0200)]
packaging: Improve package description a bit

Change-Id: I7a22e6554ed808288ab595f83494ad697b17a0b8

23 months agoIntegrate clientExample 52/276252/3
Karol Lewandowski [Mon, 13 Jun 2022 11:06:42 +0000 (13:06 +0200)]
Integrate clientExample

Change-Id: I4200e5903e2820652ee26a774e0016508010cf04

23 months agoUpdate tests to async callback call result check. 51/276251/2
Arkadiusz Nowak [Mon, 13 Jun 2022 06:11:22 +0000 (08:11 +0200)]
Update tests to async callback call result check.

Change-Id: I91eace5907919b6282a3a4b84fe52aabf1f8684b

23 months agosubsession_{add,remove,switch}_user: make async 05/276205/3
Michal Bloch [Mon, 13 Jun 2022 03:31:14 +0000 (05:31 +0200)]
subsession_{add,remove,switch}_user: make async

Also they now accept null callbacks.

Change-Id: I9a87f6bae74395d0bc374ca95c6ac2cd35c11e3c
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
23 months agoRevert 'result' parameter in subsession_reply_callback 62/276162/4
Arkadiusz Nowak [Fri, 10 Jun 2022 07:26:18 +0000 (09:26 +0200)]
Revert 'result' parameter in subsession_reply_callback

Change-Id: I8397ebe73780a05ba4be2cf3f01eaa4974d06e74

23 months agoChange error returns in subsession_register_event_callback and subsession_unregister_... 90/276090/4
Arkadiusz Nowak [Thu, 9 Jun 2022 05:25:40 +0000 (07:25 +0200)]
Change error returns in subsession_register_event_callback and subsession_unregister_event_callbacks

subsession_register_event will return SUBSESSION_ERROR_ALREADY_EXISTS
if event on the same subsession_uid was previously registered

subsession_unregister_event will return SUBSESSION_ERROR_NOT_AVAILABLE
if event on the subsession wasn't or previously unregistered

to change callback and callbacks data
unregister and register event again is required

To update the calllback and callback's data the call of subsession_unregister_event_callback
and subsession_register_event_callback with new data is required.

Change-Id: I2ad90f7ac04e9e5f8417f5842db920e91c94511c

23 months agoReduce some copy-paste 07/276107/1
Michal Bloch [Thu, 9 Jun 2022 13:12:14 +0000 (15:12 +0200)]
Reduce some copy-paste

Fixes a memleak in one of the functions.

Change-Id: I773142fa1061083e2065072a07d4df02d8f342ea
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
23 months agoAdd parameter validation to `subsession_get_current_user` and `subsession_get_user_list` 15/275915/4
Arkadiusz Nowak [Mon, 6 Jun 2022 10:12:10 +0000 (12:12 +0200)]
Add parameter validation to `subsession_get_current_user` and `subsession_get_user_list`

Change-Id: Ie70e797c585114381a96f5967b8f98e8a5ac60b1

23 months agoapi: Drop redundant fields from subsession_event_wait_done() and clarify assumed... 11/275911/6
Karol Lewandowski [Mon, 6 Jun 2022 10:29:43 +0000 (12:29 +0200)]
api: Drop redundant fields from subsession_event_wait_done() and clarify assumed usage

Changes in:
  - public interface header (libsessiond.h) authored by Karol Lewandowski
  - the rest implemented by Michal Bloch

Change-Id: I2d5337f59c868a614674f1b10001dc8c776f6f91

23 months agoapi: Drop unused return value from subsession_event_callback 10/275910/5
Karol Lewandowski [Mon, 6 Jun 2022 10:28:21 +0000 (12:28 +0200)]
api: Drop unused return value from subsession_event_callback

Changes in:
  - public interface header (libsessiond.h) authored by Karol Lewandowski
  - the rest implemented by Michal Bloch

Change-Id: I89808022e341a0ec10863181ba8788300b55b648

23 months agoapi: Drop unused paramaters and return value from subsession_reply_callback 09/275909/5
Karol Lewandowski [Mon, 6 Jun 2022 10:28:01 +0000 (12:28 +0200)]
api: Drop unused paramaters and return value from subsession_reply_callback

Changes in:
  - public interface header (libsessiond.h) authored by Karol Lewandowski
  - the rest implemented by Michal Bloch

Change-Id: I7d391d4f57fee0925fa0ccb57c2a4d2e99d88c98

23 months agoapi: Move generic fields to the top of subsession_event_info 08/275908/4
Karol Lewandowski [Mon, 6 Jun 2022 10:25:27 +0000 (12:25 +0200)]
api: Move generic fields to the top of subsession_event_info

Also happens to fix some functions referencing the wrong union member.

Changes in:
  - public interface header (libsessiond.h) authored by Karol Lewandowski
  - the rest implemented by Michal Bloch

Change-Id: I5dde2519a85c2e0ab3fc9621324eb140b0825743

23 months agoRevert "Restore subsession_*_user_wait_done due to other programs linking to them" 07/275907/1
Karol Lewandowski [Mon, 6 Jun 2022 10:14:03 +0000 (12:14 +0200)]
Revert "Restore subsession_*_user_wait_done due to other programs linking to them"

This reverts commit 3d88538370fa18dd4a44554e7b57b4cbfa50d844.

It's not enough to make rest of Tizen build, so better drop it.

Change-Id: Ibb790ee5287e00cae84a1915e02098b8d7b61cf5

23 months agoRestore subsession_*_user_wait_done due to other programs linking to them 88/275888/1 submit/tizen/20220603.181846
Karol Lewandowski [Fri, 3 Jun 2022 18:07:28 +0000 (20:07 +0200)]
Restore subsession_*_user_wait_done due to other programs linking to them

Change-Id: Ic7bed033dc062d1f8eda746206aca6976df52a05

23 months agoMerge branch 'devel' into tizen 82/275882/1 submit/tizen/20220603.143851
Karol Lewandowski [Fri, 3 Jun 2022 13:59:05 +0000 (15:59 +0200)]
Merge branch 'devel' into tizen

Change-Id: I259e76c89662ad686bcfa1e7a0f95ea18869f618

23 months agoapi: Add documentation 10/274710/7 devel
Karol Lewandowski [Thu, 5 May 2022 11:05:16 +0000 (13:05 +0200)]
api: Add documentation

Change-Id: I2a9a913e3a329f9134ecd7fe511b38fea1cc2efc

23 months agoChanged init_callbacks_list to int type 74/275874/5
Arkadiusz Nowak [Fri, 3 Jun 2022 09:38:31 +0000 (11:38 +0200)]
Changed init_callbacks_list to int type

Internal append_to_callbacks_list internal function
that contains g_mutex management

Change-Id: I4d8380431bef46941cc23e5bfc61bc0a8e968698

23 months agoEvent wait done API function 51/275751/5
Arkadiusz Nowak [Tue, 31 May 2022 09:17:23 +0000 (11:17 +0200)]
Event wait done API function

Function subsession_event_wait_done that replaces:
subsession_add_user_wait_done
subsession_remove_user_wait_done
subsession_switch_wait_done

Error tests for subsession_event_wait_done

Appened permission denied error code to
map_dbus_call_error_to_return_value

Change-Id: I753b6ef5f3ee68f45ddacf58d58065855ae1825d

23 months agoMerge "Added clientExample" into tizen
Karol Lewandowski [Thu, 2 Jun 2022 18:43:21 +0000 (18:43 +0000)]
Merge "Added clientExample" into tizen

23 months agoTests with errors 76/275476/5
Arkadiusz Nowak [Mon, 23 May 2022 08:20:53 +0000 (10:20 +0200)]
Tests with errors

Sending incorrect values to sessiond
server and takes back error codes

for:
 subsession_add_user
 subsession_remove_user
 subsession_switch_user

Removed test_api_adduser.cpp.
Removed test_api_removeuser.cpp
Tests from theese files are moved to test_api_addremove_user.cpp

Fixed errors in libsessiond  detected by tests

subsession_add_user,
subsession_remove_user,
subsession_switch_user will not call callback if error

Validation macros partially moved to lib.h
Validation macros are more generic

Change-Id: Ide27b2cfd8ffc6d31813230f3a43bafb6079584c

23 months agoUnify internal error code to DBus name mappings 08/275708/6
Michal Bloch [Mon, 30 May 2022 19:55:18 +0000 (21:55 +0200)]
Unify internal error code to DBus name mappings

Change-Id: I37ef2cfefd2c30a77286b2444c57acdccf3d96c9
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
23 months agoAdded clientExample 04/275704/6
Hubert Kowalski [Mon, 30 May 2022 12:27:57 +0000 (14:27 +0200)]
Added clientExample

Change-Id: Id3b0b539c5a22060dbedddaf1690b37c51d468ac

23 months agoDelete duplicated libsessiond.pc.in 99/275699/1 accepted/tizen/unified/20220531.143708 submit/tizen/20220530.104631
Hyotaek Shim [Mon, 30 May 2022 10:45:23 +0000 (19:45 +0900)]
Delete duplicated libsessiond.pc.in

Change-Id: I32ea1f85d441e284da4492d7dd93c6ee12e2fa60
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
23 months agoImplementation of subsession_get_current_user 06/275306/6
Arkadiusz Nowak [Fri, 20 May 2022 09:33:06 +0000 (11:33 +0200)]
Implementation of subsession_get_current_user

removed subsession_is_supported

Change-Id: I987fe917859571087a2a2abd237facaa0856e15e

23 months agoUpdate test for SUBSESSION_SWITCH_USER_WAIT 78/275278/5
Arkadiusz Nowak [Thu, 19 May 2022 10:05:20 +0000 (12:05 +0200)]
Update test for SUBSESSION_SWITCH_USER_WAIT

Additional call of API subsession_switch_user
that set user to "1" before change it to "2"

Change-Id: I9e0a6637ec7e1a4fb4208a34630788afc0f5dbef

23 months agoRegistration of switch user completion event 29/275229/5
Arkadiusz Nowak [Wed, 18 May 2022 07:30:43 +0000 (09:30 +0200)]
Registration of switch user completion event

Implementation of API function subsession_register_event_callback
for SUBSESSION_SWITCH_USER_COMPLETION flag

Change-Id: I8049e7c9b39d5f726b24353f9155a9374ac83f4c

23 months ago[fix] sessiond: Rename DBus error enums so they are not confused with 48/275648/1
Adam Michalski [Fri, 27 May 2022 12:03:05 +0000 (14:03 +0200)]
[fix] sessiond: Rename DBus error enums so they are not confused with
the error codes defined in libsessiond.

Change-Id: I89964a5207a24d7b1b8cea482430dbfc83c731df

23 months agoMerge "Allow user with id 0 to be switched to" into devel
Karol Lewandowski [Fri, 27 May 2022 11:11:10 +0000 (11:11 +0000)]
Merge "Allow user with id 0 to be switched to" into devel

23 months agoAllow user with id 0 to be switched to 84/275584/2
Adam Michalski [Thu, 26 May 2022 14:11:05 +0000 (16:11 +0200)]
Allow user with id 0 to be switched to

Change-Id: I0f51ed2c4f8bc58a815b3361e413fbe0b6e8db2d

23 months agoPrevent removing currently active user 83/275583/3
Adam Michalski [Thu, 26 May 2022 13:29:00 +0000 (15:29 +0200)]
Prevent removing currently active user

Change-Id: I718e9bb0e2d1be7b7e19d4c4ec295b335f0cf436

23 months agoRework DBus exception handling in sessiond and libsessiond 89/275289/8
Adam Michalski [Thu, 19 May 2022 15:28:25 +0000 (17:28 +0200)]
Rework DBus exception handling in sessiond and libsessiond

Change-Id: I591af8d9d1dd927bfffddbc45a48540488893699

2 years agoAdd validity checks for `SwitchUser` method 40/275040/3
Adam Michalski [Fri, 13 May 2022 16:45:04 +0000 (18:45 +0200)]
Add validity checks for `SwitchUser` method

Change-Id: I586044883648768d682c70757b521564ea57d17e

2 years agoDeduce an array type 57/274957/2
Michal Bloch [Thu, 12 May 2022 11:40:27 +0000 (13:40 +0200)]
Deduce an array type

Change-Id: I57189a88fe01aca471472ed5c6933a5803fd0FCA
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
2 years agoFix library installation path 51/275051/1 accepted/tizen/unified/20220526.144312 submit/tizen/20220525.001052
Hyotaek Shim [Mon, 16 May 2022 03:53:37 +0000 (12:53 +0900)]
Fix library installation path

32-bit build: /usr/lib
64-bit build: /usr/lib64

Change-Id: Id0f7225d7e11969cb0f3b94eb0efad38a6c3d536
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
2 years agoremove 'prev_user' parameter from libsessiond 62/274962/3
Arkadiusz Nowak [Thu, 12 May 2022 12:55:56 +0000 (14:55 +0200)]
remove 'prev_user' parameter from libsessiond

Change-Id: I459e947e3a2177f66f327359a4a9e77aa0da7d8f

2 years agoRemove redundant `prev_subsession_id` parameter from the 58/274958/6
Adam Michalski [Thu, 12 May 2022 12:45:29 +0000 (14:45 +0200)]
Remove redundant `prev_subsession_id` parameter from the
`SwitchUser` method

Change-Id: Ice4709be50884f8dc807edbba5f17555bbcb1a3f

2 years agoImplement server-side GetCurrentUser method 43/274843/8
Adam Michalski [Tue, 10 May 2022 15:03:39 +0000 (17:03 +0200)]
Implement server-side GetCurrentUser method

Change-Id: I765ee5179e4cf4f9c849a7946ee18f5e0fc47b01

2 years agoAdded subsession_unregister_event_callback() 35/274735/6
Hubert Kowalski [Wed, 27 Apr 2022 12:51:53 +0000 (14:51 +0200)]
Added subsession_unregister_event_callback()

This function unsibscribes event callback by uid and removing it from list.
removed unused unsubscribe handler
API function change:
from subsession_remove_event_callback
to subsession_unregister_event_callback

Change-Id: If58381dfa17c27ce2764aeabf8d698212561ab17

2 years agoEvent's callback registration 34/274734/5
Arkadiusz Nowak [Tue, 26 Apr 2022 08:15:10 +0000 (10:15 +0200)]
Event's callback registration

Register callback for method - signal:
AddUserWait - AddUserStarted,
RemoveUserWait - RemoveUserStarted,
SwitchUserWait - SwitchUserStarted,
registered by API function:
subsession_register_event_callback
with tests.

API function subsession_switch_wait_done
(called by callback)

More descriptive error codes
Removed deprecated functions

Change-Id: I307fe0fc624292a9c3408169e6653e2eed07544b

2 years agoAdd handler for SUBSESSION_SWITCH_USER_WAIT and SUBSESSION_SWITCH_USER_COMPLETION 33/274733/6
Arkadiusz Nowak [Mon, 25 Apr 2022 12:17:49 +0000 (14:17 +0200)]
Add handler for SUBSESSION_SWITCH_USER_WAIT and SUBSESSION_SWITCH_USER_COMPLETION

Change methods calls in callbacks data  to correct ones.
Remove unused parameter "event_bits" in register_event_callback and subscribe_only_callback

Change-Id: If451d81d5ab193061a0ab46ddd61fa9d3769526d

2 years ago[fix] Add input parameter validation for GetUserList 44/274844/1
Adam Michalski [Tue, 10 May 2022 15:25:49 +0000 (17:25 +0200)]
[fix] Add input parameter validation for GetUserList

Change-Id: Ide73c817315e939ffffc92e96f2b608ec85b482b

2 years agoMerge "[fix] Add logging `invalid_argument` exception" into devel
Karol Lewandowski [Mon, 9 May 2022 12:03:31 +0000 (12:03 +0000)]
Merge "[fix] Add logging `invalid_argument` exception" into devel

2 years agoMerge changes Ifa0cbed1,I766670d5,I03094609,I57c9e563 into devel
Karol Lewandowski [Mon, 9 May 2022 11:58:05 +0000 (11:58 +0000)]
Merge changes Ifa0cbed1,I766670d5,I03094609,I57c9e563 into devel

* changes:
  wait_manager: Add some prose
  Add privacy to wait_manager
  Split wait_manager arguments
  Extract `wait_manager` template class into a separate file

2 years agowait_manager: Add some prose 25/274725/2
Mateusz Majewski [Thu, 5 May 2022 12:42:17 +0000 (14:42 +0200)]
wait_manager: Add some prose

Change-Id: Ifa0cbed179e24bd7a840f578c91daae81268eca9

2 years agoAdd privacy to wait_manager 24/274724/2
Mateusz Majewski [Thu, 5 May 2022 09:55:54 +0000 (11:55 +0200)]
Add privacy to wait_manager

Change-Id: I766670d51f4f062b1113e788c1967e1ad473b2c6

2 years agoSplit wait_manager arguments 23/274723/2
Mateusz Majewski [Thu, 5 May 2022 09:34:49 +0000 (11:34 +0200)]
Split wait_manager arguments

Change-Id: I03094609fab5072507081ee2ec4b437d3e602583

2 years agofs-helpers: Refactor some code 07/274707/3
Adam Michalski [Fri, 29 Apr 2022 17:13:16 +0000 (19:13 +0200)]
fs-helpers: Refactor some code

Change-Id: Idbfdcc8fd014075781f7cd34da187d8754763532

2 years agoExtract `wait_manager` template class into a separate file 09/274709/2
Adam Michalski [Mon, 2 May 2022 16:11:33 +0000 (18:11 +0200)]
Extract `wait_manager` template class into a separate file

Change-Id: I57c9e56335a9365bcbdbf6a522a3fd32581a7dee