blob: af9f24a13db5713f873349071d3b026e3d9550fc [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
Daichi Hirono0639fe02016-07-07 17:36:26 +090019import android.annotation.NonNull;
20
Mike Lockwood8182e722010-12-30 15:38:45 -050021/**
22 * This class encapsulates information about a storage unit on an MTP device.
23 * This corresponds to the StorageInfo Dataset described in
24 * section 5.2.2 of the MTP specification.
Mike Lockwood8182e722010-12-30 15:38:45 -050025 */
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 /**
Mike Lockwood11dd5ae2011-04-01 14:00:08 -040039 * Returns the storage ID for the storage unit.
40 * The storage ID uniquely identifies the storage unit on the MTP device.
Mike Lockwood8182e722010-12-30 15:38:45 -050041 *
42 * @return the storage ID
43 */
44 public final int getStorageId() {
45 return mStorageId;
46 }
47
48 /**
49 * Returns the maximum storage capacity for the storage unit in bytes
50 *
51 * @return the maximum capacity
52 */
53 public final long getMaxCapacity() {
54 return mMaxCapacity;
55 }
56
57 /**
58 * Returns the amount of free space in the storage unit in bytes
59 *
60 * @return the amount of free space
61 */
62 public final long getFreeSpace() {
63 return mFreeSpace;
64 }
65
66 /**
Mike Lockwood11dd5ae2011-04-01 14:00:08 -040067 * Returns the description string for the storage unit.
68 * This is typically displayed to the user in the user interface on the
69 * MTP host.
Mike Lockwood8182e722010-12-30 15:38:45 -050070 *
71 * @return the storage unit description
72 */
Daichi Hirono0639fe02016-07-07 17:36:26 +090073 public final @NonNull String getDescription() {
Mike Lockwood8182e722010-12-30 15:38:45 -050074 return mDescription;
75 }
76
77 /**
78 * Returns the volume identifier for the storage unit
79 *
80 * @return the storage volume identifier
81 */
Daichi Hirono0639fe02016-07-07 17:36:26 +090082 public final @NonNull String getVolumeIdentifier() {
Mike Lockwood8182e722010-12-30 15:38:45 -050083 return mVolumeIdentifier;
84 }
85}