Refine the bounds of the wrap-content sides

Previously, the maximum length the client window can get for the
wrap-content side is the non-decor display width (or height) which
doesn't take the system bar visibilities into account.

This CL gives the wrap-content window more space if any of the system
bars is hidden.

This CL also refines the logic of selecting the fake control target
which is not always the focused window.

Fix: 193978485
Test: Open "Start Recording?" dialog on YouTube in fullscreen mode.
      See if the dialog can fill the screen while its content is not
      fully displayed.
      Swipe down from top, and see if the dialog is shifted down.
Change-Id: I3f7a71729196311e8f7406c6e07f68d23febe9a6
2 files changed