Make migrate option menu invisible when src volume is not mounted
When the adopted media storage is ejected, migrate operation from adopted storage to internal storage always fails. This CL makes the migrate option menu invisible when the source volume of migration is not mounted and not accessible. Bug: 117178027 Test: Settings robotests & manual Change-Id: I8bfc9de552a8daf861315a5e46ee520ede14dd81
This commit is contained in:
@@ -67,7 +67,8 @@ public class PrivateVolumeOptionMenuController implements LifecycleObserver, OnC
|
||||
if (migrate != null) {
|
||||
migrate.setVisible((privateVol != null)
|
||||
&& (privateVol.getType() == VolumeInfo.TYPE_PRIVATE)
|
||||
&& !Objects.equals(mVolumeInfo, privateVol));
|
||||
&& !Objects.equals(mVolumeInfo, privateVol)
|
||||
&& privateVol.isMountedWritable());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -416,7 +416,8 @@ public class PrivateVolumeSettings extends SettingsPreferenceFragment {
|
||||
.getPrimaryStorageCurrentVolume();
|
||||
migrate.setVisible((privateVol != null)
|
||||
&& (privateVol.getType() == VolumeInfo.TYPE_PRIVATE)
|
||||
&& !Objects.equals(mVolume, privateVol));
|
||||
&& !Objects.equals(mVolume, privateVol)
|
||||
&& privateVol.isMountedWritable());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user