Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b

Replace the existing usages of now-deprecated API
WindowManager.getDefaultDisplay() with WindowMetrics or
Context.getDisplay() in frameworks/base.

Bug: 128338354
Test: Build, auto test
Change-Id: I02d38a022c5e0e6e9d699f03d35b65d6c8126da9
This commit is contained in:
Andrii Kulian
2020-01-26 20:59:07 -08:00
parent ea325634d3
commit e57f2dc246
42 changed files with 165 additions and 170 deletions

View File

@@ -222,7 +222,8 @@ public class TouchUtils {
*/
public static void dragViewToBottom(InstrumentationTestCase test, Activity activity, View v,
int stepCount) {
int screenHeight = activity.getWindowManager().getDefaultDisplay().getHeight();
int screenHeight =
activity.getWindowManager().getCurrentWindowMetrics().getSize().getHeight();
int[] xy = new int[2];
v.getLocationOnScreen(xy);