Consider multi-window envs to calc the center of display

This CL changes the way of calculating the center position of the activity to take multi-window envs (e.g. ARC) into account.
In multi-window envs, since there can be many windows on the actual display, the center of the activity display is not always equal to the center of the actual display.
Because WindowManager#getDefaultDisplay is deprecated and does not consider multi-window envs, we should use WindowManager#getCurrentWindowMetrics instead, which is a new API in level 30.

Bug: 168439133
Test: atest android.app.cts.InstrumentationTest#testSendPointerSync
Change-Id: I710b49f69432d2ee7173a396f2853cb4672e0360
1 file changed