to top
Android APIs
public final class

MtpStorageInfo

extends Object
java.lang.Object
   ↳ android.mtp.MtpStorageInfo

Class Overview

This class encapsulates information about a storage unit on an MTP device. This corresponds to the StorageInfo Dataset described in section 5.2.2 of the MTP specification.

Summary

Public Methods
final String getDescription()
Returns the description string for the storage unit.
final long getFreeSpace()
Returns the amount of free space in the storage unit in bytes
final long getMaxCapacity()
Returns the maximum storage capacity for the storage unit in bytes
final int getStorageId()
Returns the storage ID for the storage unit.
final String getVolumeIdentifier()
Returns the volume identifier for the storage unit
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public final String getDescription ()

Added in API level 12

Returns the description string for the storage unit. This is typically displayed to the user in the user interface on the MTP host.

Returns
  • the storage unit description

public final long getFreeSpace ()

Added in API level 12

Returns the amount of free space in the storage unit in bytes

Returns
  • the amount of free space

public final long getMaxCapacity ()

Added in API level 12

Returns the maximum storage capacity for the storage unit in bytes

Returns
  • the maximum capacity

public final int getStorageId ()

Added in API level 12

Returns the storage ID for the storage unit. The storage ID uniquely identifies the storage unit on the MTP device.

Returns
  • the storage ID

public final String getVolumeIdentifier ()

Added in API level 12

Returns the volume identifier for the storage unit

Returns
  • the storage volume identifier