Merge "Remove unnecessary null checking on ViewRootImpl#mWindowAttribute"

This commit is contained in:
TreeHugger Robot
2020-09-16 12:39:22 +00:00
committed by Android (Google) Code Review

View File

@@ -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) {