blob: d1b86fcfc2e6238e36dd040cb2a562a48b0d60b9 [file] [log] [blame]
Mike Lockwood8182e722010-12-30 15:38:45 -05001/*
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.
Mike Lockwood8182e722010-12-30 15:38:45 -050023 */
24public final class MtpStorageInfo {
25
26 private int mStorageId;
27 private long mMaxCapacity;
28 private long mFreeSpace;
29 private String mDescription;
30 private String mVolumeIdentifier;
31
32 // only instantiated via JNI
33 private MtpStorageInfo() {
34 }
35
36 /**
Mike Lockwood11dd5ae2011-04-01 14:00:08 -040037 * Returns the storage ID for the storage unit.
38 * The storage ID uniquely identifies the storage unit on the MTP device.
Mike Lockwood8182e722010-12-30 15:38:45 -050039 *
40 * @return the storage ID
41 */
42 public final int getStorageId() {
43 return mStorageId;
44 }
45
46 /**
47 * Returns the maximum storage capacity for the storage unit in bytes
48 *
49 * @return the maximum capacity
50 */
51 public final long getMaxCapacity() {
52 return mMaxCapacity;
53 }
54
55 /**
56 * Returns the amount of free space in the storage unit in bytes
57 *
58 * @return the amount of free space
59 */
60 public final long getFreeSpace() {
61 return mFreeSpace;
62 }
63
64 /**
Mike Lockwood11dd5ae2011-04-01 14:00:08 -040065 * Returns the description string for the storage unit.
66 * This is typically displayed to the user in the user interface on the
67 * MTP host.
Mike Lockwood8182e722010-12-30 15:38:45 -050068 *
69 * @return the storage unit description
70 */
71 public final String getDescription() {
72 return mDescription;
73 }
74
75 /**
76 * Returns the volume identifier for the storage unit
77 *
78 * @return the storage volume identifier
79 */
80 public final String getVolumeIdentifier() {
81 return mVolumeIdentifier;
82 }
83}