diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index af839d4481f75..e6f89a761e6bc 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -3092,8 +3092,7 @@ public final class ViewRootImpl implements ViewParent, if (changedVisibility || regainedFocus) { // Toasts are presented as notifications - don't present them as windows as well - boolean isToast = (mWindowAttributes == null) ? false - : (mWindowAttributes.type == TYPE_TOAST); + boolean isToast = mWindowAttributes.type == TYPE_TOAST; if (!isToast) { host.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); } @@ -3258,8 +3257,7 @@ public final class ViewRootImpl implements ViewParent, if (mAttachInfo.mThreadedRenderer != null && mSurface.isValid()) { mFullRedrawNeeded = true; try { - final WindowManager.LayoutParams lp = mWindowAttributes; - final Rect surfaceInsets = lp != null ? lp.surfaceInsets : null; + final Rect surfaceInsets = mWindowAttributes.surfaceInsets; mAttachInfo.mThreadedRenderer.initializeIfNeeded( mWidth, mHeight, mAttachInfo, mSurface, surfaceInsets); } catch (OutOfResourcesException e) {