Merge "Rename StorageVolume.isStub as StorageVolume.isExternallyManaged"

This commit is contained in:
TreeHugger Robot
2022-01-08 02:19:08 +00:00
committed by Android (Google) Code Review
5 changed files with 22 additions and 21 deletions

View File

@@ -9530,7 +9530,7 @@ package android.os.storage {
public final class StorageVolume implements android.os.Parcelable {
method @NonNull public String getId();
method public boolean isStub();
method public boolean isExternallyManaged();
}
}

View File

@@ -99,7 +99,7 @@ public final class StorageVolume implements Parcelable {
@UnsupportedAppUsage
private final boolean mRemovable;
private final boolean mEmulated;
private final boolean mStub;
private final boolean mExternallyManaged;
private final boolean mAllowMassStorage;
private final long mMaxFileSize;
private final UserHandle mOwner;
@@ -138,7 +138,7 @@ public final class StorageVolume implements Parcelable {
/** {@hide} */
public StorageVolume(String id, File path, File internalPath, String description,
boolean primary, boolean removable, boolean emulated, boolean stub,
boolean primary, boolean removable, boolean emulated, boolean externallyManaged,
boolean allowMassStorage, long maxFileSize, UserHandle owner, UUID uuid, String fsUuid,
String state) {
mId = Preconditions.checkNotNull(id);
@@ -148,7 +148,7 @@ public final class StorageVolume implements Parcelable {
mPrimary = primary;
mRemovable = removable;
mEmulated = emulated;
mStub = stub;
mExternallyManaged = externallyManaged;
mAllowMassStorage = allowMassStorage;
mMaxFileSize = maxFileSize;
mOwner = Preconditions.checkNotNull(owner);
@@ -165,7 +165,7 @@ public final class StorageVolume implements Parcelable {
mPrimary = in.readInt() != 0;
mRemovable = in.readInt() != 0;
mEmulated = in.readInt() != 0;
mStub = in.readInt() != 0;
mExternallyManaged = in.readInt() != 0;
mAllowMassStorage = in.readInt() != 0;
mMaxFileSize = in.readLong();
mOwner = in.readParcelable(null, android.os.UserHandle.class);
@@ -275,13 +275,13 @@ public final class StorageVolume implements Parcelable {
}
/**
* Returns true if the volume is a stub volume (a volume managed from outside Android).
* Returns true if the volume is managed from outside Android.
*
* @hide
*/
@SystemApi
public boolean isStub() {
return mStub;
public boolean isExternallyManaged() {
return mExternallyManaged;
}
/**
@@ -520,7 +520,7 @@ public final class StorageVolume implements Parcelable {
pw.printPair("mPrimary", mPrimary);
pw.printPair("mRemovable", mRemovable);
pw.printPair("mEmulated", mEmulated);
pw.printPair("mStub", mStub);
pw.printPair("mExternallyManaged", mExternallyManaged);
pw.printPair("mAllowMassStorage", mAllowMassStorage);
pw.printPair("mMaxFileSize", mMaxFileSize);
pw.printPair("mOwner", mOwner);
@@ -555,7 +555,7 @@ public final class StorageVolume implements Parcelable {
parcel.writeInt(mPrimary ? 1 : 0);
parcel.writeInt(mRemovable ? 1 : 0);
parcel.writeInt(mEmulated ? 1 : 0);
parcel.writeInt(mStub ? 1 : 0);
parcel.writeInt(mExternallyManaged ? 1 : 0);
parcel.writeInt(mAllowMassStorage ? 1 : 0);
parcel.writeLong(mMaxFileSize);
parcel.writeParcelable(mOwner, flags);
@@ -637,7 +637,7 @@ public final class StorageVolume implements Parcelable {
mPrimary,
mRemovable,
mEmulated,
/* stub= */ false,
/* externallyManaged= */ false,
/* allowMassStorage= */ false,
/* maxFileSize= */ 0,
mOwner,

View File

@@ -404,7 +404,7 @@ public class VolumeInfo implements Parcelable {
final boolean removable;
final boolean emulated;
final boolean stub = type == TYPE_STUB;
final boolean externallyManaged = type == TYPE_STUB;
final boolean allowMassStorage = false;
final String envState = reportUnmounted
? Environment.MEDIA_UNMOUNTED : getEnvironmentForState(state);
@@ -460,8 +460,8 @@ public class VolumeInfo implements Parcelable {
}
return new StorageVolume(id, userPath, internalPath, description, isPrimary(), removable,
emulated, stub, allowMassStorage, maxFileSize, new UserHandle(userId), uuid,
derivedFsUuid, envState);
emulated, externallyManaged, allowMassStorage, maxFileSize, new UserHandle(userId),
uuid, derivedFsUuid, envState);
}
@UnsupportedAppUsage

View File

@@ -105,7 +105,7 @@ public class VolumeRecord implements Parcelable {
final boolean primary = false;
final boolean removable = true;
final boolean emulated = false;
final boolean stub = false;
final boolean externallyManaged = false;
final boolean allowMassStorage = false;
final long maxFileSize = 0;
final UserHandle user = new UserHandle(UserHandle.USER_NULL);
@@ -117,8 +117,8 @@ public class VolumeRecord implements Parcelable {
}
return new StorageVolume(id, userPath, internalPath, description, primary, removable,
emulated, stub, allowMassStorage, maxFileSize, user, null /* uuid */, fsUuid,
envState);
emulated, externallyManaged, allowMassStorage, maxFileSize, user, null /* uuid */,
fsUuid, envState);
}
public void dump(IndentingPrintWriter pw) {

View File

@@ -3846,7 +3846,7 @@ class StorageManagerService extends IStorageManager.Stub
final boolean primary = false;
final boolean removable = false;
final boolean emulated = true;
final boolean stub = false;
final boolean externallyManaged = false;
final boolean allowMassStorage = false;
final long maxFileSize = 0;
final UserHandle user = new UserHandle(userId);
@@ -3854,7 +3854,8 @@ class StorageManagerService extends IStorageManager.Stub
final String description = mContext.getString(android.R.string.unknownName);
res.add(new StorageVolume(id, path, path, description, primary, removable, emulated,
stub, allowMassStorage, maxFileSize, user, null /*uuid */, id, envState));
externallyManaged, allowMassStorage, maxFileSize, user, null /*uuid */, id,
envState));
}
if (!foundPrimary) {
@@ -3869,7 +3870,7 @@ class StorageManagerService extends IStorageManager.Stub
final boolean primary = true;
final boolean removable = primaryPhysical;
final boolean emulated = !primaryPhysical;
final boolean stub = false;
final boolean externallyManaged = false;
final boolean allowMassStorage = false;
final long maxFileSize = 0L;
final UserHandle owner = new UserHandle(userId);
@@ -3878,7 +3879,7 @@ class StorageManagerService extends IStorageManager.Stub
final String state = Environment.MEDIA_REMOVED;
res.add(0, new StorageVolume(id, path, path,
description, primary, removable, emulated, stub,
description, primary, removable, emulated, externallyManaged,
allowMassStorage, maxFileSize, owner, uuid, fsUuid, state));
}