Do not assume presence of status bar service in GlobalActions

Bug: 36530618
Change-Id: I5f94fe52a5814b22f433fabefad2f509bf713d13
This commit is contained in:
Erik Wolsheimer
2017-03-23 12:56:57 -07:00
parent ca2cd33be1
commit 25a06db391

View File

@@ -43,7 +43,11 @@ class GlobalActions implements GlobalActionsListener {
mLegacyGlobalActions = new LegacyGlobalActions(context, windowManagerFuncs,
this::onGlobalActionsDismissed);
mStatusBarInternal = LocalServices.getService(StatusBarManagerInternal.class);
mStatusBarInternal.setGlobalActionsListener(this);
// Some form factors do not have a status bar.
if (mStatusBarInternal != null) {
mStatusBarInternal.setGlobalActionsListener(this);
}
}
public void showDialog(boolean keyguardShowing, boolean deviceProvisioned) {