mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 17:06:49 +00:00
Moving away from obsolete Display#getRealSize().
Step 1: use both new and old APIs and make sure they return the same values. Bug: 202567877, 227307209 Test: presubmit Change-Id: I86fbb0ca089a88b5ff787a5c353664a192fb7e79
This commit is contained in:
@@ -877,10 +877,9 @@ public final class LauncherInstrumentation {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the Workspace object.
|
||||
* @deprecated use goHome().
|
||||
* Presses nav bar home button.
|
||||
*
|
||||
* @return the Workspace object.
|
||||
*/
|
||||
@Deprecated
|
||||
public Workspace pressHome() {
|
||||
@@ -1653,6 +1652,13 @@ public final class LauncherInstrumentation {
|
||||
Point getRealDisplaySize() {
|
||||
final Point size = new Point();
|
||||
getContext().getSystemService(WindowManager.class).getDefaultDisplay().getRealSize(size);
|
||||
final Rect winMetricsHeight = getContext().getSystemService(WindowManager.class)
|
||||
.getMaximumWindowMetrics()
|
||||
.getBounds();
|
||||
final Point winMetricsSize = new Point(winMetricsHeight.width(), winMetricsHeight.height());
|
||||
if (!winMetricsSize.equals(size)) {
|
||||
fail("Display size mismatch: " + size + " vs " + winMetricsSize);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user