OSDN Git Service

Better public volumes handling on secondary users.
authorJeff Sharkey <jsharkey@android.com>
Wed, 28 Mar 2018 16:31:55 +0000 (10:31 -0600)
committerJeff Sharkey <jsharkey@android.com>
Wed, 28 Mar 2018 16:31:58 +0000 (10:31 -0600)
Public volumes are only mounted for a single user at a time, so only
show notifications and launch Intents for the relevant user.

Test: manual
Bug: 73642796
Change-Id: I012206bad031ed37659b6dbec2ef1eec389410da

packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java

index 7ffca17..d527465 100644 (file)
@@ -323,10 +323,10 @@ public class StorageNotification extends SystemUI {
 
         if (notif != null) {
             mNotificationManager.notifyAsUser(vol.getId(), SystemMessage.NOTE_STORAGE_PUBLIC,
-                    notif, UserHandle.ALL);
+                    notif, UserHandle.of(vol.getMountUserId()));
         } else {
             mNotificationManager.cancelAsUser(vol.getId(), SystemMessage.NOTE_STORAGE_PUBLIC,
-                    UserHandle.ALL);
+                    UserHandle.of(vol.getMountUserId()));
         }
     }