Storage Settings crash

Storage settings will crash because there is no emulated primary volume found after private internal volume is Ejected.

Below change in Settings impacted Storage dashboard screen behavior as
it Query storage size instead of calculate size of installed APP. Due to
this design change now MediaProvider is queried for file sizes, but due
to unmounting of primary emulated volume it crashes.

We should not show Eject option for private Internal volume.

Author: ramneek.kalra@mediatek.com
Bug: 230689829
Test: atest com.android.settings.deviceinfo.VolumeOptionMenuControllerTest
      manual
      1. Insert sdcard or generate virtual disk using command : adb shell "sm set-virtual-disk true"
      2. Go to Settings -> Storage -> Sdcard/virtual disk -> Format as Internal -> do migrate data
      3. After above process completed, go to Settings-> Storage -> sd card/virtual disk and chose Eject menu option.
      4. Eject page gets open, Click on Eject button.

Change-Id: I98d09f75ee7c2cd5aae10808bd0e0cdf10da7582
This commit is contained in:
Arc Wang
2022-05-10 16:04:56 +08:00
parent 22cda47705
commit 87212cf504
2 changed files with 0 additions and 2 deletions

View File

@@ -132,7 +132,6 @@ public class VolumeOptionMenuController implements LifecycleObserver, OnCreateOp
if (mStorageEntry.isPrivate()) {
if (!mStorageEntry.isDefaultInternalStorage()) {
mRename.setVisible(true);
mUnmount.setVisible(true);
mFormatAsPortable.setVisible(true);
}

View File

@@ -142,7 +142,6 @@ public class VolumeOptionMenuControllerTest {
mController.onPrepareOptionsMenu(mMenu);
verify(mController.mRename, atLeastOnce()).setVisible(true);
verify(mController.mUnmount, atLeastOnce()).setVisible(true);
verify(mController.mFormatAsPortable, atLeastOnce()).setVisible(true);
verify(mController.mMount, never()).setVisible(true);
verify(mController.mFormat, never()).setVisible(true);