summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kenny Guy <kennyguy@google.com> 2014-11-28 22:18:14 +0000
committer Kenny Guy <kennyguy@google.com> 2014-11-28 22:18:14 +0000
commit44fc65f6d0561b382b4e48e35a014344de93eee2 (patch)
tree45f42a02fb463549abcddbc116b5439200e4b36d
parent09eeab7cbffae64add657f1a1e7ab6c7f20b6d9b (diff)
Allow apps from managed profles to close notification shade.
Listen for ACTION_CLOSE_SYSTEM_DIALOGS for all users so that apps running in the managed profile can close the notification shade. Bug: 18255982 Change-Id: I6b70eb39d182a0766eef24421fae45f033efa9e9
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java14
2 files changed, 14 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
index 4a16f8d8aa0f..581b30f8aae2 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java
@@ -689,6 +689,12 @@ public abstract class BaseStatusBar extends SystemUI implements
}
}
+ protected boolean isCurrentProfile(int userId) {
+ synchronized (mCurrentProfiles) {
+ return mCurrentProfiles.get(userId) != null;
+ }
+ }
+
@Override
public String getCurrentMediaNotificationKey() {
return null;
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
index 54eb18c2249c..b275905d3278 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java
@@ -922,7 +922,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
filter.addAction("fake_artwork");
}
filter.addAction(ACTION_DEMO);
- context.registerReceiver(mBroadcastReceiver, filter);
+ context.registerReceiverAsUser(mBroadcastReceiver, UserHandle.ALL, filter, null, null);
// listen for USER_SETUP_COMPLETE setting (per-user)
resetUserSetupObserver();
@@ -3102,12 +3102,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
if (DEBUG) Log.v(TAG, "onReceive: " + intent);
String action = intent.getAction();
if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)) {
- int flags = CommandQueue.FLAG_EXCLUDE_NONE;
- String reason = intent.getStringExtra("reason");
- if (reason != null && reason.equals(SYSTEM_DIALOG_REASON_RECENT_APPS)) {
- flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;
+ if (isCurrentProfile(getSendingUserId())) {
+ int flags = CommandQueue.FLAG_EXCLUDE_NONE;
+ String reason = intent.getStringExtra("reason");
+ if (reason != null && reason.equals(SYSTEM_DIALOG_REASON_RECENT_APPS)) {
+ flags |= CommandQueue.FLAG_EXCLUDE_RECENTS_PANEL;
+ }
+ animateCollapsePanels(flags);
}
- animateCollapsePanels(flags);
}
else if (Intent.ACTION_SCREEN_OFF.equals(action)) {
mScreenOn = false;