Merge "Moving away from obsolete Display#getRealSize()." into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2c52c31571
@@ -1650,16 +1650,10 @@ 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)
|
||||
final Rect displayBounds = 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;
|
||||
return new Point(displayBounds.width(), displayBounds.height());
|
||||
}
|
||||
|
||||
public void enableDebugTracing() {
|
||||
|
||||
Reference in New Issue
Block a user