private void addInputWindowHandleLw(
      final InputWindowHandle inputWindowHandle,
      final WindowState child,
      int flags,
      final int type,
      final boolean isVisible,
      final boolean hasFocus,
      final boolean hasWallpaper) {
    // Add a window to our list of input windows.
    inputWindowHandle.name = child.toString();
    flags = child.getTouchableRegion(inputWindowHandle.touchableRegion, flags);
    inputWindowHandle.layoutParamsFlags = flags;
    inputWindowHandle.layoutParamsType = type;
    inputWindowHandle.dispatchingTimeoutNanos = child.getInputDispatchingTimeoutNanos();
    inputWindowHandle.visible = isVisible;
    inputWindowHandle.canReceiveKeys = child.canReceiveKeys();
    inputWindowHandle.hasFocus = hasFocus;
    inputWindowHandle.hasWallpaper = hasWallpaper;
    inputWindowHandle.paused = child.mAppToken != null ? child.mAppToken.paused : false;
    inputWindowHandle.layer = child.mLayer;
    inputWindowHandle.ownerPid = child.mSession.mPid;
    inputWindowHandle.ownerUid = child.mSession.mUid;
    inputWindowHandle.inputFeatures = child.mAttrs.inputFeatures;

    final Rect frame = child.mFrame;
    inputWindowHandle.frameLeft = frame.left;
    inputWindowHandle.frameTop = frame.top;
    inputWindowHandle.frameRight = frame.right;
    inputWindowHandle.frameBottom = frame.bottom;

    if (child.isDockedInEffect()) {
      // Adjust to account for non-resizeable tasks that's scrolled
      inputWindowHandle.frameLeft += child.mXOffset;
      inputWindowHandle.frameTop += child.mYOffset;
      inputWindowHandle.frameRight += child.mXOffset;
      inputWindowHandle.frameBottom += child.mYOffset;
    }

    if (child.mGlobalScale != 1) {
      // If we are scaling the window, input coordinates need
      // to be inversely scaled to map from what is on screen
      // to what is actually being touched in the UI.
      inputWindowHandle.scaleFactor = 1.0f / child.mGlobalScale;
    } else {
      inputWindowHandle.scaleFactor = 1;
    }

    if (DEBUG_INPUT) {
      Slog.d(TAG_WM, "addInputWindowHandle: " + child + ", " + inputWindowHandle);
    }
    addInputWindowHandleLw(inputWindowHandle);
  }