Disable eject button for StubVolumes

StubVolumes are managed from outside Android (e.g. Chrome OS). So, they
should not be unmounted via the eject button in DocumentsUI.

Bug: 187111763
Test: (Tested in R) Manually check and confirm that the eject button is
      not shown for mounted StubVolumes.

Change-Id: Ie7c6d1ec846b20694d98f4cb34099ad5dfcf6478
This commit is contained in:
Youkichi Hosoi 2021-12-08 17:35:42 +09:00
parent 2453899e69
commit d24047fdbc

View File

@ -236,7 +236,8 @@ public class ExternalStorageProvider extends FileSystemProvider {
root.flags |= Root.FLAG_REMOVABLE_USB;
}
if (volume.getType() != VolumeInfo.TYPE_EMULATED) {
if (volume.getType() != VolumeInfo.TYPE_EMULATED
&& volume.getType() != VolumeInfo.TYPE_STUB) {
root.flags |= Root.FLAG_SUPPORTS_EJECT;
}