Fix USB OTG hot plug out nndexOutOfBoundsException
Open Settings, then open Storage , plug in USB OTG with Disk, select Disk, open Files, play a video, press the back key, hot plug out USB OTG, the IndexOutOfBoundsException will happen
The root cause is when received the onVolumeStateChanged in StorageEventListener in StorageDashboardFragment, the volumeInfo
status is VolumeInfo.STATE_UNMOUNTED or VolumeInfo.STATE_EJECTING, mSelectedStorageEntry set to changedStorageEntry, cause the fail.
This is a fix for CL 225095144 bug.
Bug: 247737688
Test: Manual
Change-Id: I9535c49d65c42a8dfa8ccf4e271ae973d944d4b9
1 file changed