Permalink
Browse files

Fix SystemUI FC due to Google Assistant

We could call just the onConfigurationChanged but there's no need
to do the "visible" boolean checks when we create the view the first
time

06-01 05:42:11.873 D/AndroidRuntime( 8424): Shutting down VM
06-01 05:42:11.873 E/AndroidRuntime( 8424): FATAL EXCEPTION: main
06-01 05:42:11.873 E/AndroidRuntime( 8424): Process: com.android.systemui, PID: 8424
06-01 05:42:11.873 E/AndroidRuntime( 8424): java.lang.NullPointerException: Attempt to invoke virtual method 'com.android.systemui.assist.AssistOrbView com.android.systemui.assist.AssistOrbContainer.getOrb()' on a null object reference
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at com.android.systemui.assist.AssistManager.maybeSwapSearchIcon(AssistManager.java:249)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at com.android.systemui.assist.AssistManager.showOrb(AssistManager.java:170)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at com.android.systemui.assist.AssistManager.startAssist(AssistManager.java:138)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at com.android.systemui.statusbar.BaseStatusBar.startAssist(BaseStatusBar.java:2836)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at com.android.systemui.statusbar.CommandQueue$H.handleMessage(CommandQueue.java:518)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at android.os.Handler.dispatchMessage(Handler.java:102)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at android.os.Looper.loop(Looper.java:154)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at android.app.ActivityThread.main(ActivityThread.java:6171)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at java.lang.reflect.Method.invoke(Native Method)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:891)
06-01 05:42:11.873 E/AndroidRuntime( 8424): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:781)

Change-Id: Ia9a0ad83cc2be024e41712edfd36209efb6b198d
  • Loading branch information...
ezio84 authored and akhilnarang committed Jun 1, 2017
1 parent a4d6ee7 commit a38e325b0dd4f73b08bee133437202b42856a782
Showing with 15 additions and 9 deletions.
  1. +15 −9 packages/SystemUI/src/com/android/systemui/assist/AssistManager.java
@@ -109,15 +109,7 @@ public void onConfigurationChanged() {
visible = mView.isShowing();
mWindowManager.removeView(mView);
}
mView = (AssistOrbContainer) LayoutInflater.from(mContext).inflate(
R.layout.assist_orb, null);
mView.setVisibility(View.GONE);
mView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
WindowManager.LayoutParams lp = getLayoutParams();
mWindowManager.addView(mView, lp);
createOrbView();
if (visible) {
mView.show(true /* show */, false /* animate */);
}
@@ -170,10 +162,24 @@ public void hideAssist() {
}
private void showOrb(@NonNull ComponentName assistComponent, boolean isService) {
if (mView == null) {
createOrbView();
}
maybeSwapSearchIcon(assistComponent, isService);
mView.show(true /* show */, true /* animate */);
}
private void createOrbView() {
mView = (AssistOrbContainer) LayoutInflater.from(mContext).inflate(
R.layout.assist_orb, null);
mView.setVisibility(View.GONE);
mView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
WindowManager.LayoutParams lp = getLayoutParams();
mWindowManager.addView(mView, lp);
}
private void startAssistInternal(Bundle args, @NonNull ComponentName assistComponent,
boolean isService) {
if (isService) {

0 comments on commit a38e325

Please sign in to comment.