Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 437d3139 authored by Michael Kolb's avatar Michael Kolb
Browse files

Make WindowInsets.isRound work with emulator

  Bug: 15775489

Change-Id: I53a14ccd3be776d46c9cea43c0d5d3f41674dd75
parent 4d30b1e6
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManager.DisplayListener;
import android.media.AudioManager;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.Debug;
import android.os.Handler;
@@ -119,6 +120,9 @@ public final class ViewRootImpl implements ViewParent,
    private static final String PROPERTY_PROFILE_RENDERING = "viewroot.profile_rendering";
    private static final String PROPERTY_MEDIA_DISABLED = "config.disable_media";

    // property used by emulator to determine display shape
    private static final String PROPERTY_DISPLAY_CIRCULAR = "ro.emulator.circular";

    /**
     * Maximum time we allow the user to roll the trackball enough to generate
     * a key event, before resetting the counters.
@@ -1157,7 +1161,9 @@ public final class ViewRootImpl implements ViewParent,
        if ((mWindowAttributes.flags & WindowManager.LayoutParams.FLAG_LAYOUT_IN_OVERSCAN) != 0
                && mDisplay.getDisplayId() == 0) {
            // we're fullscreen and not hosted in an ActivityView
            isRound = mContext.getResources().getBoolean(
            isRound = (Build.HARDWARE.contains("goldfish")
                    && SystemProperties.getBoolean(PROPERTY_DISPLAY_CIRCULAR, false))
                    || mContext.getResources().getBoolean(
                            com.android.internal.R.bool.config_windowIsRound);
        }
        host.dispatchApplyWindowInsets(new WindowInsets(