[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:42:46 +0000 (14:42 +0900)
commitfd8431caa6628774b2e9405067c9d18d90fd8dc8
tree939fcc2f8087dbea951b82ca8bc4ba0bbb516639
parente7a12f36238713ba4766b769a370908985117a96
[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