summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Adrian Roos <roosa@google.com> 2014-09-09 16:35:07 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2014-09-09 16:35:09 +0000
commite60d6ed7cbd19d59bacdb8dfe6683a4e6281123d (patch)
treee8519dc5069a44f3e29b6f377c9781171d74130e
parentfbc3f1984a1630186b8f37f8be951ae3033441ce (diff)
parent1e4ecf8e7b9351c772d4545adcf89493966da73d (diff)
Merge "Don't crash if there's no QS panel" into lmp-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
index dc491183b4f0..685c184a672a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/MultiUserSwitch.java
@@ -74,8 +74,10 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener
mKeyguardUserSwitcher.show(true /* animate */);
}
} else {
- mQsPanel.showDetailAdapter(true,
- mQsPanel.getHost().getUserSwitcherController().userDetailAdapter);
+ if (mQsPanel != null) {
+ mQsPanel.showDetailAdapter(true,
+ mQsPanel.getHost().getUserSwitcherController().userDetailAdapter);
+ }
}
} else {
Intent intent = ContactsContract.QuickContact.composeQuickContactsIntent(
@@ -93,9 +95,12 @@ public class MultiUserSwitch extends FrameLayout implements View.OnClickListener
final UserManager um = UserManager.get(getContext());
String text;
if (um.isUserSwitcherEnabled()) {
- UserSwitcherController controller = mQsPanel.getHost()
- .getUserSwitcherController();
- String currentUser = controller.getCurrentUserName(mContext);
+ String currentUser = null;
+ if (mQsPanel != null) {
+ UserSwitcherController controller = mQsPanel.getHost()
+ .getUserSwitcherController();
+ currentUser = controller.getCurrentUserName(mContext);
+ }
if (TextUtils.isEmpty(currentUser)) {
text = mContext.getString(R.string.accessibility_multi_user_switch_switcher);
} else {