Program: 194630
Project: 194630
Buggy source:
/** 
 * {@inheritDoc} 
 */
@Override public void layoutWindowLw(WindowState win,WindowState attached){
  if ((win == mStatusBar && !canReceiveInput(win)) || win == mNavigationBar) {
    return;
  }
  final WindowManager.LayoutParams attrs=win.getAttrs();
  final boolean isDefaultDisplay=win.isDefaultDisplay();
  final boolean needsToOffsetInputMethodTarget=isDefaultDisplay && (win == mLastInputMethodTargetWindow && mLastInputMethodWindow != null);
  if (needsToOffsetInputMethodTarget) {
    if (DEBUG_LAYOUT)     Slog.i(TAG,"String_Node_Str");
    offsetInputMethodWindowLw(mLastInputMethodWindow);
  }
  final int fl=PolicyControl.getWindowFlags(win,attrs);
  final int sim=attrs.softInputMode;
  final int sysUiFl=PolicyControl.getSystemUiVisibility(win,null);
  final Rect pf=mTmpParentFrame;
  final Rect df=mTmpDisplayFrame;
  final Rect of=mTmpOverscanFrame;
  final Rect cf=mTmpContentFrame;
  final Rect vf=mTmpVisibleFrame;
  final Rect dcf=mTmpDecorFrame;
  final Rect sf=mTmpStableFrame;
  Rect osf=null;
  dcf.setEmpty();
  final boolean hasNavBar=(isDefaultDisplay && mHasNavigationBar && mNavigationBar != null && mNavigationBar.isVisibleLw());
  final int adjust=sim & SOFT_INPUT_MASK_ADJUST;
  if (isDefaultDisplay) {
    sf.set(mStableLeft,mStableTop,mStableRight,mStableBottom);
  }
 else {
    sf.set(mOverscanLeft,mOverscanTop,mOverscanRight,mOverscanBottom);
  }
  if (!isDefaultDisplay) {
    if (attached != null) {
      setAttachedWindowFrames(win,fl,adjust,attached,true,pf,df,of,cf,vf);
    }
 else {
      pf.left=df.left=of.left=cf.left=mOverscanScreenLeft;
      pf.top=df.top=of.top=cf.top=mOverscanScreenTop;
      pf.right=df.right=of.right=cf.right=mOverscanScreenLeft + mOverscanScreenWidth;
      pf.bottom=df.bottom=of.bottom=cf.bottom=mOverscanScreenTop + mOverscanScreenHeight;
    }
  }
 else   if (attrs.type == TYPE_INPUT_METHOD) {
    pf.left=df.left=of.left=cf.left=vf.left=mDockLeft;
    pf.top=df.top=of.top=cf.top=vf.top=mDockTop;
    pf.right=df.right=of.right=cf.right=vf.right=mDockRight;
    pf.bottom=df.bottom=of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
    cf.bottom=vf.bottom=mStableBottom;
    attrs.gravity=Gravity.BOTTOM;
    mDockLayer=win.getSurfaceLayer();
  }
 else   if (attrs.type == TYPE_VOICE_INTERACTION) {
    pf.left=df.left=of.left=cf.left=vf.left=mUnrestrictedScreenLeft;
    pf.top=df.top=of.top=mUnrestrictedScreenTop;
    pf.right=df.right=of.right=cf.right=vf.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
    pf.bottom=df.bottom=of.bottom=cf.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
    cf.bottom=vf.bottom=mStableBottom;
    cf.top=vf.top=mStableTop;
  }
 else   if (win == mStatusBar) {
    pf.left=df.left=of.left=mUnrestrictedScreenLeft;
    pf.top=df.top=of.top=mUnrestrictedScreenTop;
    pf.right=df.right=of.right=mUnrestrictedScreenWidth + mUnrestrictedScreenLeft;
    pf.bottom=df.bottom=of.bottom=mUnrestrictedScreenHeight + mUnrestrictedScreenTop;
    cf.left=vf.left=mStableLeft;
    cf.top=vf.top=mStableTop;
    cf.right=vf.right=mStableRight;
    vf.bottom=mStableBottom;
    cf.bottom=mContentBottom;
  }
 else {
    dcf.left=mSystemLeft;
    dcf.top=mSystemTop;
    dcf.right=mSystemRight;
    dcf.bottom=mSystemBottom;
    final boolean inheritTranslucentDecor=(attrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR) != 0;
    final boolean isAppWindow=attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
    final boolean topAtRest=win == mTopFullscreenOpaqueWindowState && !win.isAnimatingLw();
    if (isAppWindow && !inheritTranslucentDecor && !topAtRest) {
      if ((sysUiFl & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0 && (fl & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0 && (fl & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) == 0 && (fl & WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0) {
        dcf.top=mStableTop;
      }
      if ((fl & WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) == 0 && (sysUiFl & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0 && (fl & WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0) {
        dcf.bottom=mStableBottom;
        dcf.right=mStableRight;
      }
    }
    if ((fl & (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) == (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) {
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str");
      if (attached != null) {
        setAttachedWindowFrames(win,fl,adjust,attached,true,pf,df,of,cf,vf);
      }
 else {
        if (attrs.type == TYPE_STATUS_BAR_PANEL || attrs.type == TYPE_STATUS_BAR_SUB_PANEL) {
          pf.left=df.left=of.left=hasNavBar ? mDockLeft : mUnrestrictedScreenLeft;
          pf.top=df.top=of.top=mUnrestrictedScreenTop;
          pf.right=df.right=of.right=hasNavBar ? mRestrictedScreenLeft + mRestrictedScreenWidth : mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
          pf.bottom=df.bottom=of.bottom=hasNavBar ? mRestrictedScreenTop + mRestrictedScreenHeight : mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
          if (DEBUG_LAYOUT)           Slog.v(TAG,String.format("String_Node_Str",pf.left,pf.top,pf.right,pf.bottom));
        }
 else         if ((fl & FLAG_LAYOUT_IN_OVERSCAN) != 0 && attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
          pf.left=df.left=of.left=mOverscanScreenLeft;
          pf.top=df.top=of.top=mOverscanScreenTop;
          pf.right=df.right=of.right=mOverscanScreenLeft + mOverscanScreenWidth;
          pf.bottom=df.bottom=of.bottom=mOverscanScreenTop + mOverscanScreenHeight;
        }
 else         if (canHideNavigationBar() && (sysUiFl & View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) != 0 && attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
          pf.left=df.left=mOverscanScreenLeft;
          pf.top=df.top=mOverscanScreenTop;
          pf.right=df.right=mOverscanScreenLeft + mOverscanScreenWidth;
          pf.bottom=df.bottom=mOverscanScreenTop + mOverscanScreenHeight;
          of.left=mUnrestrictedScreenLeft;
          of.top=mUnrestrictedScreenTop;
          of.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
          of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
        }
 else {
          pf.left=df.left=mRestrictedOverscanScreenLeft;
          pf.top=df.top=mRestrictedOverscanScreenTop;
          pf.right=df.right=mRestrictedOverscanScreenLeft + mRestrictedOverscanScreenWidth;
          pf.bottom=df.bottom=mRestrictedOverscanScreenTop + mRestrictedOverscanScreenHeight;
          of.left=mUnrestrictedScreenLeft;
          of.top=mUnrestrictedScreenTop;
          of.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
          of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
        }
        if ((fl & FLAG_FULLSCREEN) == 0) {
          if (win.isVoiceInteraction()) {
            cf.left=mVoiceContentLeft;
            cf.top=mVoiceContentTop;
            cf.right=mVoiceContentRight;
            cf.bottom=mVoiceContentBottom;
          }
 else {
            if (adjust != SOFT_INPUT_ADJUST_RESIZE) {
              cf.left=mDockLeft;
              cf.top=mDockTop;
              cf.right=mDockRight;
              cf.bottom=mDockBottom;
            }
 else {
              cf.left=mContentLeft;
              cf.top=mContentTop;
              cf.right=mContentRight;
              cf.bottom=mContentBottom;
            }
          }
        }
 else {
          cf.left=mRestrictedScreenLeft;
          cf.top=mRestrictedScreenTop;
          cf.right=mRestrictedScreenLeft + mRestrictedScreenWidth;
          cf.bottom=mRestrictedScreenTop + mRestrictedScreenHeight;
        }
        applyStableConstraints(sysUiFl,fl,cf);
        if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
          vf.left=mCurLeft;
          vf.top=mCurTop;
          vf.right=mCurRight;
          vf.bottom=mCurBottom;
        }
 else {
          vf.set(cf);
        }
      }
    }
 else     if ((fl & FLAG_LAYOUT_IN_SCREEN) != 0 || (sysUiFl & (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)) != 0) {
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str");
      if (attrs.type == TYPE_STATUS_BAR_PANEL || attrs.type == TYPE_STATUS_BAR_SUB_PANEL) {
        pf.left=df.left=of.left=cf.left=hasNavBar ? mDockLeft : mUnrestrictedScreenLeft;
        pf.top=df.top=of.top=cf.top=mUnrestrictedScreenTop;
        pf.right=df.right=of.right=cf.right=hasNavBar ? mRestrictedScreenLeft + mRestrictedScreenWidth : mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=hasNavBar ? mRestrictedScreenTop + mRestrictedScreenHeight : mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
        if (DEBUG_LAYOUT)         Slog.v(TAG,String.format("String_Node_Str",pf.left,pf.top,pf.right,pf.bottom));
      }
 else       if (attrs.type == TYPE_NAVIGATION_BAR || attrs.type == TYPE_NAVIGATION_BAR_PANEL) {
        pf.left=df.left=of.left=mUnrestrictedScreenLeft;
        pf.top=df.top=of.top=mUnrestrictedScreenTop;
        pf.right=df.right=of.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
        if (DEBUG_LAYOUT)         Slog.v(TAG,String.format("String_Node_Str",pf.left,pf.top,pf.right,pf.bottom));
      }
 else       if ((attrs.type == TYPE_SECURE_SYSTEM_OVERLAY || attrs.type == TYPE_BOOT_PROGRESS) && ((fl & FLAG_FULLSCREEN) != 0)) {
        pf.left=df.left=of.left=cf.left=mOverscanScreenLeft;
        pf.top=df.top=of.top=cf.top=mOverscanScreenTop;
        pf.right=df.right=of.right=cf.right=mOverscanScreenLeft + mOverscanScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mOverscanScreenTop + mOverscanScreenHeight;
      }
 else       if (attrs.type == TYPE_BOOT_PROGRESS) {
        pf.left=df.left=of.left=cf.left=mOverscanScreenLeft;
        pf.top=df.top=of.top=cf.top=mOverscanScreenTop;
        pf.right=df.right=of.right=cf.right=mOverscanScreenLeft + mOverscanScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mOverscanScreenTop + mOverscanScreenHeight;
      }
 else       if (attrs.type == TYPE_WALLPAPER) {
        pf.left=df.left=mOverscanScreenLeft;
        pf.top=df.top=mOverscanScreenTop;
        pf.right=df.right=mOverscanScreenLeft + mOverscanScreenWidth;
        pf.bottom=df.bottom=mOverscanScreenTop + mOverscanScreenHeight;
        of.left=cf.left=mUnrestrictedScreenLeft;
        of.top=cf.top=mUnrestrictedScreenTop;
        of.right=cf.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
        of.bottom=cf.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
      }
 else       if ((fl & FLAG_LAYOUT_IN_OVERSCAN) != 0 && attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
        pf.left=df.left=of.left=cf.left=mOverscanScreenLeft;
        pf.top=df.top=of.top=cf.top=mOverscanScreenTop;
        pf.right=df.right=of.right=cf.right=mOverscanScreenLeft + mOverscanScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mOverscanScreenTop + mOverscanScreenHeight;
      }
 else       if (canHideNavigationBar() && (sysUiFl & View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) != 0 && (attrs.type == TYPE_STATUS_BAR || attrs.type == TYPE_TOAST || attrs.type == TYPE_VOICE_INTERACTION_STARTING || (attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW))) {
        pf.left=df.left=of.left=cf.left=mUnrestrictedScreenLeft;
        pf.top=df.top=of.top=cf.top=mUnrestrictedScreenTop;
        pf.right=df.right=of.right=cf.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
      }
 else {
        pf.left=df.left=of.left=cf.left=mRestrictedScreenLeft;
        pf.top=df.top=of.top=cf.top=mRestrictedScreenTop;
        pf.right=df.right=of.right=cf.right=mRestrictedScreenLeft + mRestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mRestrictedScreenTop + mRestrictedScreenHeight;
      }
      applyStableConstraints(sysUiFl,fl,cf);
      if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
        vf.left=mCurLeft;
        vf.top=mCurTop;
        vf.right=mCurRight;
        vf.bottom=mCurBottom;
      }
 else {
        vf.set(cf);
      }
    }
 else     if (attached != null) {
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str"+ attached);
      setAttachedWindowFrames(win,fl,adjust,attached,false,pf,df,of,cf,vf);
    }
 else {
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str");
      if (attrs.type == TYPE_STATUS_BAR_PANEL) {
        pf.left=df.left=of.left=cf.left=mRestrictedScreenLeft;
        pf.top=df.top=of.top=cf.top=mRestrictedScreenTop;
        pf.right=df.right=of.right=cf.right=mRestrictedScreenLeft + mRestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mRestrictedScreenTop + mRestrictedScreenHeight;
      }
 else       if (attrs.type == TYPE_TOAST || attrs.type == TYPE_SYSTEM_ALERT || attrs.type == TYPE_VOLUME_OVERLAY) {
        pf.left=df.left=of.left=cf.left=mStableLeft;
        pf.top=df.top=of.top=cf.top=mStableTop;
        pf.right=df.right=of.right=cf.right=mStableRight;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mStableBottom;
      }
 else {
        pf.left=mContentLeft;
        pf.top=mContentTop;
        pf.right=mContentRight;
        pf.bottom=mContentBottom;
        if (win.isVoiceInteraction()) {
          df.left=of.left=cf.left=mVoiceContentLeft;
          df.top=of.top=cf.top=mVoiceContentTop;
          df.right=of.right=cf.right=mVoiceContentRight;
          df.bottom=of.bottom=cf.bottom=mVoiceContentBottom;
        }
 else         if (adjust != SOFT_INPUT_ADJUST_RESIZE) {
          df.left=of.left=cf.left=mDockLeft;
          df.top=of.top=cf.top=mDockTop;
          df.right=of.right=cf.right=mDockRight;
          df.bottom=of.bottom=cf.bottom=mDockBottom;
        }
 else {
          df.left=of.left=cf.left=mContentLeft;
          df.top=of.top=cf.top=mContentTop;
          df.right=of.right=cf.right=mContentRight;
          df.bottom=of.bottom=cf.bottom=mContentBottom;
        }
        if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
          vf.left=mCurLeft;
          vf.top=mCurTop;
          vf.right=mCurRight;
          vf.bottom=mCurBottom;
        }
 else {
          vf.set(cf);
        }
      }
    }
  }
  if ((fl & FLAG_LAYOUT_NO_LIMITS) != 0 && attrs.type != TYPE_SYSTEM_ERROR) {
    df.left=df.top=-10000;
    df.right=df.bottom=10000;
    if (attrs.type != TYPE_WALLPAPER) {
      of.left=of.top=cf.left=cf.top=vf.left=vf.top=-10000;
      of.right=of.bottom=cf.right=cf.bottom=vf.right=vf.bottom=10000;
    }
  }
  final boolean useOutsets=attrs.type == TYPE_WALLPAPER || (fl & (WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN)) != 0;
  if (isDefaultDisplay && useOutsets) {
    osf=mTmpOutsetFrame;
    osf.set(cf.left,cf.top,cf.right,cf.bottom);
    int outset=ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources());
    if (outset > 0) {
      int rotation=Surface.ROTATION_0;
      try {
        rotation=mWindowManager.getRotation();
      }
 catch (      RemoteException e) {
      }
      if (rotation == Surface.ROTATION_0) {
        osf.bottom+=outset;
      }
 else       if (rotation == Surface.ROTATION_90) {
        osf.right+=outset;
      }
 else       if (rotation == Surface.ROTATION_180) {
        osf.top-=outset;
      }
 else       if (rotation == Surface.ROTATION_270) {
        osf.left-=outset;
      }
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + outset + "String_Node_Str"+ rotation+ "String_Node_Str"+ osf);
    }
  }
  if (DEBUG_LAYOUT)   Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str"+ Integer.toHexString(sim)+ "String_Node_Str"+ attached+ "String_Node_Str"+ attrs.type+ String.format("String_Node_Str",fl)+ "String_Node_Str"+ pf.toShortString()+ "String_Node_Str"+ df.toShortString()+ "String_Node_Str"+ of.toShortString()+ "String_Node_Str"+ cf.toShortString()+ "String_Node_Str"+ vf.toShortString()+ "String_Node_Str"+ dcf.toShortString()+ "String_Node_Str"+ sf.toShortString()+ "String_Node_Str"+ (osf == null ? "String_Node_Str" : osf.toShortString()));
  win.computeFrameLw(pf,df,of,cf,vf,dcf,sf,osf);
  if (attrs.type == TYPE_INPUT_METHOD && win.isVisibleOrBehindKeyguardLw() && !win.getGivenInsetsPendingLw()) {
    setLastInputMethodWindowLw(null,null);
    offsetInputMethodWindowLw(win);
  }
  if (attrs.type == TYPE_VOICE_INTERACTION && win.isVisibleOrBehindKeyguardLw() && !win.getGivenInsetsPendingLw()) {
    offsetVoiceInputWindowLw(win);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
@Override public void layoutWindowLw(WindowState win,WindowState attached){
  if ((win == mStatusBar && !canReceiveInput(win)) || win == mNavigationBar) {
    return;
  }
  final WindowManager.LayoutParams attrs=win.getAttrs();
  final boolean isDefaultDisplay=win.isDefaultDisplay();
  final boolean needsToOffsetInputMethodTarget=isDefaultDisplay && (win == mLastInputMethodTargetWindow && mLastInputMethodWindow != null);
  if (needsToOffsetInputMethodTarget) {
    if (DEBUG_LAYOUT)     Slog.i(TAG,"String_Node_Str");
    offsetInputMethodWindowLw(mLastInputMethodWindow);
  }
  final int fl=PolicyControl.getWindowFlags(win,attrs);
  final int sim=attrs.softInputMode;
  final int sysUiFl=PolicyControl.getSystemUiVisibility(win,null);
  final Rect pf=mTmpParentFrame;
  final Rect df=mTmpDisplayFrame;
  final Rect of=mTmpOverscanFrame;
  final Rect cf=mTmpContentFrame;
  final Rect vf=mTmpVisibleFrame;
  final Rect dcf=mTmpDecorFrame;
  final Rect sf=mTmpStableFrame;
  Rect osf=null;
  dcf.setEmpty();
  final boolean hasNavBar=(isDefaultDisplay && mHasNavigationBar && mNavigationBar != null && mNavigationBar.isVisibleLw());
  final int adjust=sim & SOFT_INPUT_MASK_ADJUST;
  if (isDefaultDisplay) {
    sf.set(mStableLeft,mStableTop,mStableRight,mStableBottom);
  }
 else {
    sf.set(mOverscanLeft,mOverscanTop,mOverscanRight,mOverscanBottom);
  }
  if (!isDefaultDisplay) {
    if (attached != null) {
      setAttachedWindowFrames(win,fl,adjust,attached,true,pf,df,of,cf,vf);
    }
 else {
      pf.left=df.left=of.left=cf.left=mOverscanScreenLeft;
      pf.top=df.top=of.top=cf.top=mOverscanScreenTop;
      pf.right=df.right=of.right=cf.right=mOverscanScreenLeft + mOverscanScreenWidth;
      pf.bottom=df.bottom=of.bottom=cf.bottom=mOverscanScreenTop + mOverscanScreenHeight;
    }
  }
 else   if (attrs.type == TYPE_INPUT_METHOD) {
    pf.left=df.left=of.left=cf.left=vf.left=mDockLeft;
    pf.top=df.top=of.top=cf.top=vf.top=mDockTop;
    pf.right=df.right=of.right=cf.right=vf.right=mDockRight;
    pf.bottom=df.bottom=of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
    cf.bottom=vf.bottom=mStableBottom;
    attrs.gravity=Gravity.BOTTOM;
    mDockLayer=win.getSurfaceLayer();
  }
 else   if (attrs.type == TYPE_VOICE_INTERACTION) {
    pf.left=df.left=of.left=mUnrestrictedScreenLeft;
    pf.top=df.top=of.top=mUnrestrictedScreenTop;
    pf.right=df.right=of.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
    pf.bottom=df.bottom=of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
    cf.bottom=vf.bottom=mStableBottom;
    cf.right=vf.right=mStableRight;
    cf.left=vf.left=mStableLeft;
    cf.top=vf.top=mStableTop;
  }
 else   if (win == mStatusBar) {
    pf.left=df.left=of.left=mUnrestrictedScreenLeft;
    pf.top=df.top=of.top=mUnrestrictedScreenTop;
    pf.right=df.right=of.right=mUnrestrictedScreenWidth + mUnrestrictedScreenLeft;
    pf.bottom=df.bottom=of.bottom=mUnrestrictedScreenHeight + mUnrestrictedScreenTop;
    cf.left=vf.left=mStableLeft;
    cf.top=vf.top=mStableTop;
    cf.right=vf.right=mStableRight;
    vf.bottom=mStableBottom;
    cf.bottom=mContentBottom;
  }
 else {
    dcf.left=mSystemLeft;
    dcf.top=mSystemTop;
    dcf.right=mSystemRight;
    dcf.bottom=mSystemBottom;
    final boolean inheritTranslucentDecor=(attrs.privateFlags & WindowManager.LayoutParams.PRIVATE_FLAG_INHERIT_TRANSLUCENT_DECOR) != 0;
    final boolean isAppWindow=attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_APPLICATION_WINDOW;
    final boolean topAtRest=win == mTopFullscreenOpaqueWindowState && !win.isAnimatingLw();
    if (isAppWindow && !inheritTranslucentDecor && !topAtRest) {
      if ((sysUiFl & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0 && (fl & WindowManager.LayoutParams.FLAG_FULLSCREEN) == 0 && (fl & WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS) == 0 && (fl & WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0) {
        dcf.top=mStableTop;
      }
      if ((fl & WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION) == 0 && (sysUiFl & View.SYSTEM_UI_FLAG_HIDE_NAVIGATION) == 0 && (fl & WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS) == 0) {
        dcf.bottom=mStableBottom;
        dcf.right=mStableRight;
      }
    }
    if ((fl & (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) == (FLAG_LAYOUT_IN_SCREEN | FLAG_LAYOUT_INSET_DECOR)) {
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str");
      if (attached != null) {
        setAttachedWindowFrames(win,fl,adjust,attached,true,pf,df,of,cf,vf);
      }
 else {
        if (attrs.type == TYPE_STATUS_BAR_PANEL || attrs.type == TYPE_STATUS_BAR_SUB_PANEL) {
          pf.left=df.left=of.left=hasNavBar ? mDockLeft : mUnrestrictedScreenLeft;
          pf.top=df.top=of.top=mUnrestrictedScreenTop;
          pf.right=df.right=of.right=hasNavBar ? mRestrictedScreenLeft + mRestrictedScreenWidth : mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
          pf.bottom=df.bottom=of.bottom=hasNavBar ? mRestrictedScreenTop + mRestrictedScreenHeight : mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
          if (DEBUG_LAYOUT)           Slog.v(TAG,String.format("String_Node_Str",pf.left,pf.top,pf.right,pf.bottom));
        }
 else         if ((fl & FLAG_LAYOUT_IN_OVERSCAN) != 0 && attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
          pf.left=df.left=of.left=mOverscanScreenLeft;
          pf.top=df.top=of.top=mOverscanScreenTop;
          pf.right=df.right=of.right=mOverscanScreenLeft + mOverscanScreenWidth;
          pf.bottom=df.bottom=of.bottom=mOverscanScreenTop + mOverscanScreenHeight;
        }
 else         if (canHideNavigationBar() && (sysUiFl & View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) != 0 && attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
          pf.left=df.left=mOverscanScreenLeft;
          pf.top=df.top=mOverscanScreenTop;
          pf.right=df.right=mOverscanScreenLeft + mOverscanScreenWidth;
          pf.bottom=df.bottom=mOverscanScreenTop + mOverscanScreenHeight;
          of.left=mUnrestrictedScreenLeft;
          of.top=mUnrestrictedScreenTop;
          of.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
          of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
        }
 else {
          pf.left=df.left=mRestrictedOverscanScreenLeft;
          pf.top=df.top=mRestrictedOverscanScreenTop;
          pf.right=df.right=mRestrictedOverscanScreenLeft + mRestrictedOverscanScreenWidth;
          pf.bottom=df.bottom=mRestrictedOverscanScreenTop + mRestrictedOverscanScreenHeight;
          of.left=mUnrestrictedScreenLeft;
          of.top=mUnrestrictedScreenTop;
          of.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
          of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
        }
        if ((fl & FLAG_FULLSCREEN) == 0) {
          if (win.isVoiceInteraction()) {
            cf.left=mVoiceContentLeft;
            cf.top=mVoiceContentTop;
            cf.right=mVoiceContentRight;
            cf.bottom=mVoiceContentBottom;
          }
 else {
            if (adjust != SOFT_INPUT_ADJUST_RESIZE) {
              cf.left=mDockLeft;
              cf.top=mDockTop;
              cf.right=mDockRight;
              cf.bottom=mDockBottom;
            }
 else {
              cf.left=mContentLeft;
              cf.top=mContentTop;
              cf.right=mContentRight;
              cf.bottom=mContentBottom;
            }
          }
        }
 else {
          cf.left=mRestrictedScreenLeft;
          cf.top=mRestrictedScreenTop;
          cf.right=mRestrictedScreenLeft + mRestrictedScreenWidth;
          cf.bottom=mRestrictedScreenTop + mRestrictedScreenHeight;
        }
        applyStableConstraints(sysUiFl,fl,cf);
        if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
          vf.left=mCurLeft;
          vf.top=mCurTop;
          vf.right=mCurRight;
          vf.bottom=mCurBottom;
        }
 else {
          vf.set(cf);
        }
      }
    }
 else     if ((fl & FLAG_LAYOUT_IN_SCREEN) != 0 || (sysUiFl & (View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)) != 0) {
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str");
      if (attrs.type == TYPE_STATUS_BAR_PANEL || attrs.type == TYPE_STATUS_BAR_SUB_PANEL) {
        pf.left=df.left=of.left=cf.left=hasNavBar ? mDockLeft : mUnrestrictedScreenLeft;
        pf.top=df.top=of.top=cf.top=mUnrestrictedScreenTop;
        pf.right=df.right=of.right=cf.right=hasNavBar ? mRestrictedScreenLeft + mRestrictedScreenWidth : mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=hasNavBar ? mRestrictedScreenTop + mRestrictedScreenHeight : mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
        if (DEBUG_LAYOUT)         Slog.v(TAG,String.format("String_Node_Str",pf.left,pf.top,pf.right,pf.bottom));
      }
 else       if (attrs.type == TYPE_NAVIGATION_BAR || attrs.type == TYPE_NAVIGATION_BAR_PANEL) {
        pf.left=df.left=of.left=mUnrestrictedScreenLeft;
        pf.top=df.top=of.top=mUnrestrictedScreenTop;
        pf.right=df.right=of.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
        if (DEBUG_LAYOUT)         Slog.v(TAG,String.format("String_Node_Str",pf.left,pf.top,pf.right,pf.bottom));
      }
 else       if ((attrs.type == TYPE_SECURE_SYSTEM_OVERLAY || attrs.type == TYPE_BOOT_PROGRESS) && ((fl & FLAG_FULLSCREEN) != 0)) {
        pf.left=df.left=of.left=cf.left=mOverscanScreenLeft;
        pf.top=df.top=of.top=cf.top=mOverscanScreenTop;
        pf.right=df.right=of.right=cf.right=mOverscanScreenLeft + mOverscanScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mOverscanScreenTop + mOverscanScreenHeight;
      }
 else       if (attrs.type == TYPE_BOOT_PROGRESS) {
        pf.left=df.left=of.left=cf.left=mOverscanScreenLeft;
        pf.top=df.top=of.top=cf.top=mOverscanScreenTop;
        pf.right=df.right=of.right=cf.right=mOverscanScreenLeft + mOverscanScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mOverscanScreenTop + mOverscanScreenHeight;
      }
 else       if (attrs.type == TYPE_WALLPAPER) {
        pf.left=df.left=mOverscanScreenLeft;
        pf.top=df.top=mOverscanScreenTop;
        pf.right=df.right=mOverscanScreenLeft + mOverscanScreenWidth;
        pf.bottom=df.bottom=mOverscanScreenTop + mOverscanScreenHeight;
        of.left=cf.left=mUnrestrictedScreenLeft;
        of.top=cf.top=mUnrestrictedScreenTop;
        of.right=cf.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
        of.bottom=cf.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
      }
 else       if ((fl & FLAG_LAYOUT_IN_OVERSCAN) != 0 && attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW) {
        pf.left=df.left=of.left=cf.left=mOverscanScreenLeft;
        pf.top=df.top=of.top=cf.top=mOverscanScreenTop;
        pf.right=df.right=of.right=cf.right=mOverscanScreenLeft + mOverscanScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mOverscanScreenTop + mOverscanScreenHeight;
      }
 else       if (canHideNavigationBar() && (sysUiFl & View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) != 0 && (attrs.type == TYPE_STATUS_BAR || attrs.type == TYPE_TOAST || attrs.type == TYPE_VOICE_INTERACTION_STARTING || (attrs.type >= WindowManager.LayoutParams.FIRST_APPLICATION_WINDOW && attrs.type <= WindowManager.LayoutParams.LAST_SUB_WINDOW))) {
        pf.left=df.left=of.left=cf.left=mUnrestrictedScreenLeft;
        pf.top=df.top=of.top=cf.top=mUnrestrictedScreenTop;
        pf.right=df.right=of.right=cf.right=mUnrestrictedScreenLeft + mUnrestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mUnrestrictedScreenTop + mUnrestrictedScreenHeight;
      }
 else {
        pf.left=df.left=of.left=cf.left=mRestrictedScreenLeft;
        pf.top=df.top=of.top=cf.top=mRestrictedScreenTop;
        pf.right=df.right=of.right=cf.right=mRestrictedScreenLeft + mRestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mRestrictedScreenTop + mRestrictedScreenHeight;
      }
      applyStableConstraints(sysUiFl,fl,cf);
      if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
        vf.left=mCurLeft;
        vf.top=mCurTop;
        vf.right=mCurRight;
        vf.bottom=mCurBottom;
      }
 else {
        vf.set(cf);
      }
    }
 else     if (attached != null) {
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str"+ attached);
      setAttachedWindowFrames(win,fl,adjust,attached,false,pf,df,of,cf,vf);
    }
 else {
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str");
      if (attrs.type == TYPE_STATUS_BAR_PANEL) {
        pf.left=df.left=of.left=cf.left=mRestrictedScreenLeft;
        pf.top=df.top=of.top=cf.top=mRestrictedScreenTop;
        pf.right=df.right=of.right=cf.right=mRestrictedScreenLeft + mRestrictedScreenWidth;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mRestrictedScreenTop + mRestrictedScreenHeight;
      }
 else       if (attrs.type == TYPE_TOAST || attrs.type == TYPE_SYSTEM_ALERT || attrs.type == TYPE_VOLUME_OVERLAY) {
        pf.left=df.left=of.left=cf.left=mStableLeft;
        pf.top=df.top=of.top=cf.top=mStableTop;
        pf.right=df.right=of.right=cf.right=mStableRight;
        pf.bottom=df.bottom=of.bottom=cf.bottom=mStableBottom;
      }
 else {
        pf.left=mContentLeft;
        pf.top=mContentTop;
        pf.right=mContentRight;
        pf.bottom=mContentBottom;
        if (win.isVoiceInteraction()) {
          df.left=of.left=cf.left=mVoiceContentLeft;
          df.top=of.top=cf.top=mVoiceContentTop;
          df.right=of.right=cf.right=mVoiceContentRight;
          df.bottom=of.bottom=cf.bottom=mVoiceContentBottom;
        }
 else         if (adjust != SOFT_INPUT_ADJUST_RESIZE) {
          df.left=of.left=cf.left=mDockLeft;
          df.top=of.top=cf.top=mDockTop;
          df.right=of.right=cf.right=mDockRight;
          df.bottom=of.bottom=cf.bottom=mDockBottom;
        }
 else {
          df.left=of.left=cf.left=mContentLeft;
          df.top=of.top=cf.top=mContentTop;
          df.right=of.right=cf.right=mContentRight;
          df.bottom=of.bottom=cf.bottom=mContentBottom;
        }
        if (adjust != SOFT_INPUT_ADJUST_NOTHING) {
          vf.left=mCurLeft;
          vf.top=mCurTop;
          vf.right=mCurRight;
          vf.bottom=mCurBottom;
        }
 else {
          vf.set(cf);
        }
      }
    }
  }
  if ((fl & FLAG_LAYOUT_NO_LIMITS) != 0 && attrs.type != TYPE_SYSTEM_ERROR) {
    df.left=df.top=-10000;
    df.right=df.bottom=10000;
    if (attrs.type != TYPE_WALLPAPER) {
      of.left=of.top=cf.left=cf.top=vf.left=vf.top=-10000;
      of.right=of.bottom=cf.right=cf.bottom=vf.right=vf.bottom=10000;
    }
  }
  final boolean useOutsets=attrs.type == TYPE_WALLPAPER || (fl & (WindowManager.LayoutParams.FLAG_FULLSCREEN | WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN)) != 0;
  if (isDefaultDisplay && useOutsets) {
    osf=mTmpOutsetFrame;
    osf.set(cf.left,cf.top,cf.right,cf.bottom);
    int outset=ScreenShapeHelper.getWindowOutsetBottomPx(mContext.getResources());
    if (outset > 0) {
      int rotation=Surface.ROTATION_0;
      try {
        rotation=mWindowManager.getRotation();
      }
 catch (      RemoteException e) {
      }
      if (rotation == Surface.ROTATION_0) {
        osf.bottom+=outset;
      }
 else       if (rotation == Surface.ROTATION_90) {
        osf.right+=outset;
      }
 else       if (rotation == Surface.ROTATION_180) {
        osf.top-=outset;
      }
 else       if (rotation == Surface.ROTATION_270) {
        osf.left-=outset;
      }
      if (DEBUG_LAYOUT)       Slog.v(TAG,"String_Node_Str" + outset + "String_Node_Str"+ rotation+ "String_Node_Str"+ osf);
    }
  }
  if (DEBUG_LAYOUT)   Slog.v(TAG,"String_Node_Str" + attrs.getTitle() + "String_Node_Str"+ Integer.toHexString(sim)+ "String_Node_Str"+ attached+ "String_Node_Str"+ attrs.type+ String.format("String_Node_Str",fl)+ "String_Node_Str"+ pf.toShortString()+ "String_Node_Str"+ df.toShortString()+ "String_Node_Str"+ of.toShortString()+ "String_Node_Str"+ cf.toShortString()+ "String_Node_Str"+ vf.toShortString()+ "String_Node_Str"+ dcf.toShortString()+ "String_Node_Str"+ sf.toShortString()+ "String_Node_Str"+ (osf == null ? "String_Node_Str" : osf.toShortString()));
  win.computeFrameLw(pf,df,of,cf,vf,dcf,sf,osf);
  if (attrs.type == TYPE_INPUT_METHOD && win.isVisibleOrBehindKeyguardLw() && !win.getGivenInsetsPendingLw()) {
    setLastInputMethodWindowLw(null,null);
    offsetInputMethodWindowLw(win);
  }
  if (attrs.type == TYPE_VOICE_INTERACTION && win.isVisibleOrBehindKeyguardLw() && !win.getGivenInsetsPendingLw()) {
    offsetVoiceInputWindowLw(win);
  }
}