Fix layout measuring for dialogs

The FrameLayout created by the Window Manager is supposed to be the root
of a new window. So it should measure its children as such. This adapts
the measuring of the FrameLayout to mimic ViewRootImpl#measureHierarchy.

Bug: 197931929
Test: checked in Studio that it fixes dialogs for Compose
Change-Id: I13b51fb793f674f563a73673c827f6ef6fd5c0ce
(cherry picked from commit f2a5e7f49cdb31a6a35e387197db09603020afb2)
2 files changed