Merge "Remove property of window insets lazy getter" into udc-dev
This commit is contained in:
@@ -54,9 +54,6 @@ import java.util.function.Supplier;
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public final class WindowMetricsController {
|
public final class WindowMetricsController {
|
||||||
// TODO(b/151908239): Remove and always enable this if it is stable.
|
|
||||||
private static final boolean LAZY_WINDOW_INSETS = android.os.SystemProperties.getBoolean(
|
|
||||||
"persist.wm.debug.win_metrics_lazy_insets", true);
|
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
|
|
||||||
public WindowMetricsController(@NonNull Context context) {
|
public WindowMetricsController(@NonNull Context context) {
|
||||||
@@ -98,9 +95,7 @@ public final class WindowMetricsController {
|
|||||||
final IBinder token = Context.getToken(mContext);
|
final IBinder token = Context.getToken(mContext);
|
||||||
final Supplier<WindowInsets> insetsSupplier = () -> getWindowInsetsFromServerForDisplay(
|
final Supplier<WindowInsets> insetsSupplier = () -> getWindowInsetsFromServerForDisplay(
|
||||||
mContext.getDisplayId(), token, bounds, isScreenRound, windowingMode);
|
mContext.getDisplayId(), token, bounds, isScreenRound, windowingMode);
|
||||||
return LAZY_WINDOW_INSETS
|
return new WindowMetrics(new Rect(bounds), insetsSupplier, density);
|
||||||
? new WindowMetrics(new Rect(bounds), insetsSupplier, density)
|
|
||||||
: new WindowMetrics(new Rect(bounds), insetsSupplier.get(), density);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user