Merge "Add MOUNT_FLAG_VISIBLE to visible stub volumes" am: d8e3e07264 am: eba787f7a5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1536320 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I21d5560f0d061cae9c8959cb658a75fd14e7ed76
This commit is contained in:
@@ -50,6 +50,8 @@ public class DiskInfo implements Parcelable {
|
|||||||
public static final int FLAG_DEFAULT_PRIMARY = 1 << 1;
|
public static final int FLAG_DEFAULT_PRIMARY = 1 << 1;
|
||||||
public static final int FLAG_SD = 1 << 2;
|
public static final int FLAG_SD = 1 << 2;
|
||||||
public static final int FLAG_USB = 1 << 3;
|
public static final int FLAG_USB = 1 << 3;
|
||||||
|
/** The FLAG_STUB_VISIBLE is set from vold, which gets the flag from outside (e.g., ChromeOS) */
|
||||||
|
public static final int FLAG_STUB_VISIBLE = 1 << 6;
|
||||||
|
|
||||||
public final String id;
|
public final String id;
|
||||||
@UnsupportedAppUsage
|
@UnsupportedAppUsage
|
||||||
@@ -152,6 +154,10 @@ public class DiskInfo implements Parcelable {
|
|||||||
return (flags & FLAG_USB) != 0;
|
return (flags & FLAG_USB) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isStubVisible() {
|
||||||
|
return (flags & FLAG_STUB_VISIBLE) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
final CharArrayWriter writer = new CharArrayWriter();
|
final CharArrayWriter writer = new CharArrayWriter();
|
||||||
|
|||||||
@@ -1537,6 +1537,9 @@ class StorageManagerService extends IStorageManager.Stub
|
|||||||
mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();
|
mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();
|
||||||
|
|
||||||
} else if (vol.type == VolumeInfo.TYPE_STUB) {
|
} else if (vol.type == VolumeInfo.TYPE_STUB) {
|
||||||
|
if (vol.disk.isStubVisible()) {
|
||||||
|
vol.mountFlags |= VolumeInfo.MOUNT_FLAG_VISIBLE;
|
||||||
|
}
|
||||||
vol.mountUserId = mCurrentUserId;
|
vol.mountUserId = mCurrentUserId;
|
||||||
mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();
|
mHandler.obtainMessage(H_VOLUME_MOUNT, vol).sendToTarget();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user