summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/MountService.java
diff options
context:
space:
mode:
Diffstat (limited to 'services/java/com/android/server/MountService.java')
-rw-r--r--services/java/com/android/server/MountService.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/java/com/android/server/MountService.java b/services/java/com/android/server/MountService.java
index 03480d19ba89..002ebeda208a 100644
--- a/services/java/com/android/server/MountService.java
+++ b/services/java/com/android/server/MountService.java
@@ -137,7 +137,11 @@ class MountService extends IMountService.Stub {
* Broadcasts the USB mass storage connected event to all clients.
*/
void notifyUmsConnected() {
- setUsbStorageNotificationVisibility(true);
+ String storageState = Environment.getExternalStorageState();
+ if (!storageState.equals(Environment.MEDIA_REMOVED) &&
+ !storageState.equals(Environment.MEDIA_BAD_REMOVAL)) {
+ setUsbStorageNotificationVisibility(true);
+ }
Intent intent = new Intent(Intent.ACTION_UMS_CONNECTED);
mContext.sendBroadcast(intent);
}