MtpStorageInfo.java revision 8182e72479a8b0d832df9c392890b25bfa6f97b5
1/* 2 * Copyright (C) 2010 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.mtp; 18 19/** 20 * This class encapsulates information about a storage unit on an MTP device. 21 * This corresponds to the StorageInfo Dataset described in 22 * section 5.2.2 of the MTP specification. 23 * 24 * {@hide} 25 */ 26public final class MtpStorageInfo { 27 28 private int mStorageId; 29 private long mMaxCapacity; 30 private long mFreeSpace; 31 private String mDescription; 32 private String mVolumeIdentifier; 33 34 // only instantiated via JNI 35 private MtpStorageInfo() { 36 } 37 38 /** 39 * Returns the storage ID for the storage unit 40 * 41 * @return the storage ID 42 */ 43 public final int getStorageId() { 44 return mStorageId; 45 } 46 47 /** 48 * Returns the maximum storage capacity for the storage unit in bytes 49 * 50 * @return the maximum capacity 51 */ 52 public final long getMaxCapacity() { 53 return mMaxCapacity; 54 } 55 56 /** 57 * Returns the amount of free space in the storage unit in bytes 58 * 59 * @return the amount of free space 60 */ 61 public final long getFreeSpace() { 62 return mFreeSpace; 63 } 64 65 /** 66 * Returns the description string for the storage unit 67 * 68 * @return the storage unit description 69 */ 70 public final String getDescription() { 71 return mDescription; 72 } 73 74 /** 75 * Returns the volume identifier for the storage unit 76 * 77 * @return the storage volume identifier 78 */ 79 public final String getVolumeIdentifier() { 80 return mVolumeIdentifier; 81 } 82} 83