Permalink
Browse files

SystemUI: when dynamically mounted disk is ejected(flashdisk, harddis…

…k, ...) don't create notification event dismissable in statusbar
  • Loading branch information...
1 parent bb2da58 commit 23ed74371d1fcc3489c1ba91cc04126419abf714 @havlenapetr committed Apr 18, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -226,14 +226,26 @@ private void onStorageStateChangedAsync(String path, String oldState, String new
updateUsbMassStorageNotification(mUmsAvailable);
} else if (newState.equals(Environment.MEDIA_REMOVED)) {
/*
+ * check if removed media wasn't dynamically mounted disk
+ * (flashdisk or harddisk)
+ */
+ boolean dynamicMediaRemoved = true;
+ for(String volPath : mStorageManager.getVolumePaths()) {
+ if(volPath.equals(path)) {
+ dynamicMediaRemoved = false;
+ break;
+ }
+ }
+
+ /*
* Storage has been removed. Show nomedia media notification,
* and disable UMS notification regardless of connection state.
*/
setMediaStorageNotification(
com.android.internal.R.string.ext_media_nomedia_notification_title,
com.android.internal.R.string.ext_media_nomedia_notification_message,
com.android.internal.R.drawable.stat_notify_sdcard_usb,
- true, false, null);
+ true, dynamicMediaRemoved, null);
updateUsbMassStorageNotification(false);
} else if (newState.equals(Environment.MEDIA_BAD_REMOVAL)) {
/*

0 comments on commit 23ed743

Please sign in to comment.