diff options
author | Jeff Sharkey <jsharkey@android.com> | 2015-04-14 10:30:34 -0700 |
---|---|---|
committer | Jeff Sharkey <jsharkey@android.com> | 2015-04-14 16:46:27 -0700 |
commit | 56bd3129138b525b0f2eba52bd4fa140f23e792c (patch) | |
tree | bae7c23c4d5aa00da32c7c43e612b7e37e7d1067 /services/core/java/com/android/server/MountService.java | |
parent | d1500d8ff1ba70cd723076d94a994cdfcc1a64fb (diff) | |
download | frameworks_base-56bd3129138b525b0f2eba52bd4fa140f23e792c.zip frameworks_base-56bd3129138b525b0f2eba52bd4fa140f23e792c.tar.gz frameworks_base-56bd3129138b525b0f2eba52bd4fa140f23e792c.tar.bz2 |
Checkpoint of storage notifications.
Rewrite of storage notifications to support multiple disks/volumes,
handling the state of each independently. Update strings to match
spec. Include actions to jump into wizard when adoptable, otherwise
browse or eject.
Move browse intent creation to common place on VolumeInfo. Also add
well-formed extra names. VolumeInfo now carries the parent disk ID
along with it to avoid races when unmounting.
Bug: 19993667
Change-Id: I236ddc7f8112490355f438b828bec8d40c331fdd
Diffstat (limited to 'services/core/java/com/android/server/MountService.java')
-rw-r--r-- | services/core/java/com/android/server/MountService.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/MountService.java b/services/core/java/com/android/server/MountService.java index cac2f5c..a99f387 100644 --- a/services/core/java/com/android/server/MountService.java +++ b/services/core/java/com/android/server/MountService.java @@ -740,19 +740,29 @@ class MountService extends IMountService.Stub } case VoldResponseCode.DISK_VOLUME_CREATED: { if (cooked.length != 3) break; - final DiskInfo disk = mDisks.get(cooked[1]); + final String diskId = cooked[1]; final String volId = cooked[2]; + final DiskInfo disk = mDisks.get(diskId); if (disk != null) { - disk.volumes = ArrayUtils.appendElement(String.class, disk.volumes, volId); + disk.volumeIds = ArrayUtils.appendElement(String.class, disk.volumeIds, volId); + } + final VolumeInfo vol = mVolumes.get(volId); + if (vol != null) { + vol.diskId = diskId; } break; } case VoldResponseCode.DISK_VOLUME_DESTROYED: { if (cooked.length != 3) break; - final DiskInfo disk = mDisks.get(cooked[1]); + final String diskId = cooked[1]; final String volId = cooked[2]; + final DiskInfo disk = mDisks.get(diskId); if (disk != null) { - disk.volumes = ArrayUtils.removeElement(String.class, disk.volumes, volId); + disk.volumeIds = ArrayUtils.removeElement(String.class, disk.volumeIds, volId); + } + final VolumeInfo vol = mVolumes.get(volId); + if (vol != null) { + vol.diskId = null; } break; } |