Fix DisplayPolicyLayoutTests

WindowTestsBase.createWindow() would not only create a WindowState
object, but would also create its parents and add it to the scene
graph. When WindowTestsBase is creating the StackWindowController, it
will invoke controller.onOverrideConfigurationChanged() which
eventually requests a traversal to layout all the windows. The layout
caused by the traversal has chances to impact the test.

DisplayPolicyLayoutTests uses its own display frame to perform the
layout. The width and height are arbitrary which may not be the same
as the width and height of the mDisplayContent in the scene graph.
So if the layout is performed by the mDisplayContent (instead of
DisplayPolicyLayoutTests), the window frames will be different.

With this change, we use the mGlobalLock to protect our tests. It
ensures that no one would modify the window frames computed by
layoutWindowLw() when we are testing them.

Bug: 120075361
Test: atest DisplayPolicyInsetsTests \
            DisplayPolicyLayoutTests \
            DisplayPolicyTests
Change-Id: I11420d3ddfc1d0610d000919574ad5bfba27345a
1 file changed