summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/usb
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-09-23 17:08:57 -0700
committerDianne Hackborn <hackbod@google.com>2012-09-24 10:55:46 -0700
commit50cdf7c3069eb2cf82acbad73c322b7a5f3af4b1 (patch)
treeaf1acc3ce0293d1ed797ecf0b7210464eb76e67c /packages/SystemUI/src/com/android/systemui/usb
parent6b3292ce5b3908c7433503f64c852cf2b27718ed (diff)
downloadframeworks_base-50cdf7c3069eb2cf82acbad73c322b7a5f3af4b1.zip
frameworks_base-50cdf7c3069eb2cf82acbad73c322b7a5f3af4b1.tar.gz
frameworks_base-50cdf7c3069eb2cf82acbad73c322b7a5f3af4b1.tar.bz2
Fix issue #7214090: Need to be able to post notifications to all users
Also fix a bunch of system services that should be doing this. And while doing that, found I needed to fix PendingIntent to evaluate USER_CURRENT at the point of sending, not creation. Note that this may end up with us having some notification shown to non-primary users that lead to settings UI that should only be for the primary user (such as the vpn notification). I'm not sure what to do about this, maybe we need a different UI to come up there or something, but showing the actual notification for those users at least seems less broken than not telling them at all. Change-Id: Iffc51e2d7c847e3d05064d292ab93937646a1ab7
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/usb')
-rw-r--r--packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java17
1 files changed, 11 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
index 7dff549..c55b5bc 100644
--- a/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
+++ b/packages/SystemUI/src/com/android/systemui/usb/StorageNotification.java
@@ -25,6 +25,7 @@ import android.content.res.Resources;
import android.os.Environment;
import android.os.Handler;
import android.os.HandlerThread;
+import android.os.UserHandle;
import android.os.storage.StorageEventListener;
import android.os.storage.StorageManager;
import android.provider.Settings;
@@ -311,7 +312,8 @@ public class StorageNotification extends StorageEventListener {
mUsbStorageNotification.tickerText = title;
if (pi == null) {
Intent intent = new Intent();
- pi = PendingIntent.getBroadcast(mContext, 0, intent, 0);
+ pi = PendingIntent.getBroadcastAsUser(mContext, 0, intent, 0,
+ UserHandle.CURRENT);
}
mUsbStorageNotification.setLatestEventInfo(mContext, title, message, pi);
@@ -336,9 +338,10 @@ public class StorageNotification extends StorageEventListener {
final int notificationId = mUsbStorageNotification.icon;
if (visible) {
- notificationManager.notify(notificationId, mUsbStorageNotification);
+ notificationManager.notifyAsUser(null, notificationId, mUsbStorageNotification,
+ UserHandle.ALL);
} else {
- notificationManager.cancel(notificationId);
+ notificationManager.cancelAsUser(null, notificationId, UserHandle.ALL);
}
}
@@ -398,7 +401,8 @@ public class StorageNotification extends StorageEventListener {
mMediaStorageNotification.tickerText = title;
if (pi == null) {
Intent intent = new Intent();
- pi = PendingIntent.getBroadcast(mContext, 0, intent, 0);
+ pi = PendingIntent.getBroadcastAsUser(mContext, 0, intent, 0,
+ UserHandle.CURRENT);
}
mMediaStorageNotification.icon = icon;
@@ -407,9 +411,10 @@ public class StorageNotification extends StorageEventListener {
final int notificationId = mMediaStorageNotification.icon;
if (visible) {
- notificationManager.notify(notificationId, mMediaStorageNotification);
+ notificationManager.notifyAsUser(null, notificationId,
+ mMediaStorageNotification, UserHandle.ALL);
} else {
- notificationManager.cancel(notificationId);
+ notificationManager.cancelAsUser(null, notificationId, UserHandle.ALL);
}
}
}