manuelbl / JavaDoesUSB

USB library for Java
MIT License
143 stars 11 forks source link

Unmount an USB sdcard (soft) do no trigger a disconnected event #17

Closed ouaibsky closed 11 months ago

ouaibsky commented 1 year ago

Event are well received when I plug an sd card.

But when I un-mount (click into the finder on the icon) then no event is received (setOnDeviceDisconnected).

Event (disconnected) is received only when I physically remove the sdcard.

Is it something expected ?

manuelbl commented 1 year ago

This is to be expected. Unmount is a file system operation. After unmounting the device can no longer be accessed through the file system. But it is still available, e.g. for formatting. And it can be mounted again.

Furthermore for composite devices, unmounting only affects the mass storage part while the other functions (e.g. a serial port) are still in use.