-
- All Implemented Interfaces:
public final class UsbMassStorageDeviceClass representing a connected USB mass storage device. You can enumerate through all connected mass storage devices via .getMassStorageDevices. This method only returns supported devices or if no device is connected an empty array.
After choosing a device you have to get the permission for the underlying android.hardware.usb.UsbDevice. The underlying android.hardware.usb.UsbDevice can be accessed via .getUsbDevice.
After that you need to call .setupDevice. This will initialize the mass storage device and read the partitions ( com.github.mjdev.libaums.partition.Partition).
The supported partitions can then be accessed via .getPartitions and you can begin to read directories and files.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classUsbMassStorageDevice.Companion
-
Field Summary
Fields Modifier and Type Field Description private List<Partition>partitionsprivate final UsbDeviceusbDevice
-
Method Summary
Modifier and Type Method Description final List<Partition>getPartitions()final UnitsetPartitions(List<Partition> partitions)final UsbDevicegetUsbDevice()This returns the android.hardware.usb.UsbDevice which can be used to request permission for communication. final Unitinit()Initializes the mass storage device and determines different things like for example the MBR or the file systems for the different partitions. final Unitclose()Releases the android.hardware.usb.UsbInterface and closes the android.hardware.usb.UsbDeviceConnection. -
-
Method Detail
-
getPartitions
final List<Partition> getPartitions()
-
setPartitions
final Unit setPartitions(List<Partition> partitions)
-
getUsbDevice
final UsbDevice getUsbDevice()
This returns the android.hardware.usb.UsbDevice which can be used to request permission for communication.
-
init
final Unit init()
Initializes the mass storage device and determines different things like for example the MBR or the file systems for the different partitions.
-
close
final Unit close()
Releases the android.hardware.usb.UsbInterface and closes the android.hardware.usb.UsbDeviceConnection. After calling this method no further communication is possible. That means you can not read or write from or to the partitions returned by .getPartitions.
-
-
-
-