summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI
diff options
context:
space:
mode:
authorJeff Sharkey <jsharkey@android.com>2015-04-18 16:20:27 -0700
committerJeff Sharkey <jsharkey@android.com>2015-04-18 16:20:30 -0700
commit27de30d31c3e79bc429cb71aed9681c55243f18d (patch)
treeec77e0d04bdabf49601d2e400c42ea134420727d /packages/SystemUI
parent7e92ef3a1146102806fa0543ef12e09231c55639 (diff)
downloadframeworks_base-27de30d31c3e79bc429cb71aed9681c55243f18d.zip
frameworks_base-27de30d31c3e79bc429cb71aed9681c55243f18d.tar.gz
frameworks_base-27de30d31c3e79bc429cb71aed9681c55243f18d.tar.bz2
Wire up non-visible volumes, more states.
Adds logic to ExternalStorageProvider to scan non-visible volumes, such as USB OTG devices. We use internal paths when surfacing these volumes, which also optimizes around the FUSE daemon for public devices. Also dumps internal state when requested. VolumeInfo now directly contains DiskInfo, which means it's snapshotted when sending events, avoiding teardown races. Switch notifications to use this DiskInfo directly. Finish wiring up new volume state, including helper methods to make it readable/writable state clearer. Handle disks and volumes with spaces in their labels. Bug: 19993667 Change-Id: I5c75e5658a6415976811477aebafee7694bde0f4
Diffstat (limited to 'packages/SystemUI')
-rw-r--r--packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index 4a441c7..ecd1a2f 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -60,7 +60,7 @@ public class StorageNotification extends SystemUI {
// Avoid kicking notifications when getting early metadata before
// mounted. If already mounted, we're being kicked because of a
// nickname or init'ed change.
- if (vol.getState() == VolumeInfo.STATE_MOUNTED) {
+ if (vol.isMountedReadable()) {
onVolumeStateChangedInternal(vol, vol.getState(), vol.getState());
}
}
@@ -111,6 +111,7 @@ public class StorageNotification extends SystemUI {
onVolumeChecking(vol);
break;
case VolumeInfo.STATE_MOUNTED:
+ case VolumeInfo.STATE_MOUNTED_READ_ONLY:
onVolumeMounted(vol);
break;
case VolumeInfo.STATE_FORMATTING:
@@ -136,7 +137,7 @@ public class StorageNotification extends SystemUI {
}
private void onVolumeChecking(VolumeInfo vol) {
- final DiskInfo disk = mStorageManager.findDiskById(vol.getDiskId());
+ final DiskInfo disk = vol.getDisk();
final CharSequence title = mContext.getString(
R.string.ext_media_checking_notification_title, disk.getDescription());
final CharSequence text = mContext.getString(
@@ -156,7 +157,7 @@ public class StorageNotification extends SystemUI {
// Don't annoy when user dismissed in past
if (vol.isSnoozed()) return;
- final DiskInfo disk = mStorageManager.findDiskById(vol.getDiskId());
+ final DiskInfo disk = vol.getDisk();
final Notification notif;
if (disk.isAdoptable() && !vol.isInited()) {
final CharSequence title = disk.getDescription();
@@ -198,7 +199,7 @@ public class StorageNotification extends SystemUI {
}
private void onVolumeEjecting(VolumeInfo vol) {
- final DiskInfo disk = mStorageManager.findDiskById(vol.getDiskId());
+ final DiskInfo disk = vol.getDisk();
final CharSequence title = mContext.getString(
R.string.ext_media_unmounting_notification_title, disk.getDescription());
final CharSequence text = mContext.getString(
@@ -215,7 +216,7 @@ public class StorageNotification extends SystemUI {
}
private void onVolumeUnmountable(VolumeInfo vol) {
- final DiskInfo disk = mStorageManager.findDiskById(vol.getDiskId());
+ final DiskInfo disk = vol.getDisk();
final CharSequence title = mContext.getString(
R.string.ext_media_unmountable_notification_title, disk.getDescription());
final CharSequence text = mContext.getString(
@@ -236,7 +237,7 @@ public class StorageNotification extends SystemUI {
return;
}
- final DiskInfo disk = mStorageManager.findDiskById(vol.getDiskId());
+ final DiskInfo disk = vol.getDisk();
final CharSequence title = mContext.getString(
R.string.ext_media_nomedia_notification_title, disk.getDescription());
final CharSequence text = mContext.getString(
@@ -256,7 +257,7 @@ public class StorageNotification extends SystemUI {
return;
}
- final DiskInfo disk = mStorageManager.findDiskById(vol.getDiskId());
+ final DiskInfo disk = vol.getDisk();
final CharSequence title = mContext.getString(
R.string.ext_media_badremoval_notification_title, disk.getDescription());
final CharSequence text = mContext.getString(