[Tizen.System.Storage] Register eventhandler if it is already existed
authorUnsung Lee <unsung.lee@samsung.com>
Wed, 27 Mar 2024 06:51:24 +0000 (15:51 +0900)
committerChanwoo Choi <chanwoo@kernel.org>
Fri, 29 Mar 2024 05:23:34 +0000 (14:23 +0900)
commitb47915fdeeda7370aac95f4f0e3ec2d420a68b77
treeb2c6d4dc6b996f699599cfd17969009dc4748174
parent6420c380b4338a1e65e6fa9385af6eac22ceb21f
[Tizen.System.Storage] Register eventhandler if it is already existed

Register event handler in the class Storage if eventhandler is already existed.

If at least one event handler is already registered,
the API returns the storage state from a variable within the class.
Otherwise, it retrieves the status externally.

In the previous implementation, an event handler was only registered within class Storage
when it was registered for each storage ID,
and no event handler was registered within class Storage when it was registered by storage type.
As a result of that, when the USB (or SD card) was removed,
it attempted to obtain the state from outside and provided incorrect information
to the application because there is no storage already removed.

Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
src/Tizen.System.Storage/Storage/Storage.cs
src/Tizen.System.Storage/Storage/StorageManager.cs