diff options
Diffstat (limited to 'android/os/storage/StorageVolume.java')
-rw-r--r-- | android/os/storage/StorageVolume.java | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/android/os/storage/StorageVolume.java b/android/os/storage/StorageVolume.java index 1fc0b820..070b8c1b 100644 --- a/android/os/storage/StorageVolume.java +++ b/android/os/storage/StorageVolume.java @@ -19,7 +19,6 @@ package android.os.storage; import android.annotation.Nullable; import android.content.Context; import android.content.Intent; -import android.net.TrafficStats; import android.net.Uri; import android.os.Environment; import android.os.Parcel; @@ -78,13 +77,11 @@ import java.io.File; public final class StorageVolume implements Parcelable { private final String mId; - private final int mStorageId; private final File mPath; private final String mDescription; private final boolean mPrimary; private final boolean mRemovable; private final boolean mEmulated; - private final long mMtpReserveSize; private final boolean mAllowMassStorage; private final long mMaxFileSize; private final UserHandle mOwner; @@ -121,17 +118,15 @@ public final class StorageVolume implements Parcelable { public static final int STORAGE_ID_PRIMARY = 0x00010001; /** {@hide} */ - public StorageVolume(String id, int storageId, File path, String description, boolean primary, - boolean removable, boolean emulated, long mtpReserveSize, boolean allowMassStorage, + public StorageVolume(String id, File path, String description, boolean primary, + boolean removable, boolean emulated, boolean allowMassStorage, long maxFileSize, UserHandle owner, String fsUuid, String state) { mId = Preconditions.checkNotNull(id); - mStorageId = storageId; mPath = Preconditions.checkNotNull(path); mDescription = Preconditions.checkNotNull(description); mPrimary = primary; mRemovable = removable; mEmulated = emulated; - mMtpReserveSize = mtpReserveSize; mAllowMassStorage = allowMassStorage; mMaxFileSize = maxFileSize; mOwner = Preconditions.checkNotNull(owner); @@ -141,13 +136,11 @@ public final class StorageVolume implements Parcelable { private StorageVolume(Parcel in) { mId = in.readString(); - mStorageId = in.readInt(); mPath = new File(in.readString()); mDescription = in.readString(); mPrimary = in.readInt() != 0; mRemovable = in.readInt() != 0; mEmulated = in.readInt() != 0; - mMtpReserveSize = in.readLong(); mAllowMassStorage = in.readInt() != 0; mMaxFileSize = in.readLong(); mOwner = in.readParcelable(null); @@ -211,34 +204,6 @@ public final class StorageVolume implements Parcelable { } /** - * Returns the MTP storage ID for the volume. - * this is also used for the storage_id column in the media provider. - * - * @return MTP storage ID - * @hide - */ - public int getStorageId() { - return mStorageId; - } - - /** - * Number of megabytes of space to leave unallocated by MTP. - * MTP will subtract this value from the free space it reports back - * to the host via GetStorageInfo, and will not allow new files to - * be added via MTP if there is less than this amount left free in the storage. - * If MTP has dedicated storage this value should be zero, but if MTP is - * sharing storage with the rest of the system, set this to a positive value - * to ensure that MTP activity does not result in the storage being - * too close to full. - * - * @return MTP reserve space - * @hide - */ - public int getMtpReserveSpace() { - return (int) (mMtpReserveSize / TrafficStats.MB_IN_BYTES); - } - - /** * Returns true if this volume can be shared via USB mass storage. * * @return whether mass storage is allowed @@ -385,13 +350,11 @@ public final class StorageVolume implements Parcelable { pw.println("StorageVolume:"); pw.increaseIndent(); pw.printPair("mId", mId); - pw.printPair("mStorageId", mStorageId); pw.printPair("mPath", mPath); pw.printPair("mDescription", mDescription); pw.printPair("mPrimary", mPrimary); pw.printPair("mRemovable", mRemovable); pw.printPair("mEmulated", mEmulated); - pw.printPair("mMtpReserveSize", mMtpReserveSize); pw.printPair("mAllowMassStorage", mAllowMassStorage); pw.printPair("mMaxFileSize", mMaxFileSize); pw.printPair("mOwner", mOwner); @@ -420,13 +383,11 @@ public final class StorageVolume implements Parcelable { @Override public void writeToParcel(Parcel parcel, int flags) { parcel.writeString(mId); - parcel.writeInt(mStorageId); parcel.writeString(mPath.toString()); parcel.writeString(mDescription); parcel.writeInt(mPrimary ? 1 : 0); parcel.writeInt(mRemovable ? 1 : 0); parcel.writeInt(mEmulated ? 1 : 0); - parcel.writeLong(mMtpReserveSize); parcel.writeInt(mAllowMassStorage ? 1 : 0); parcel.writeLong(mMaxFileSize); parcel.writeParcelable(mOwner, flags); |