diff options
| author | 2014-06-21 20:15:24 +0000 | |
|---|---|---|
| committer | 2014-06-21 20:15:24 +0000 | |
| commit | 71f65485bf47c8bfbae2b3a0a9573b311668b4a2 (patch) | |
| tree | 6bcf69eb71dfc4d6683dc0f5caad396b60a2d844 | |
| parent | 82d013d45ab86ee1a4e1a64960f6ac1260d66a66 (diff) | |
| parent | db9fed74c2bbf97157683b47f3cbdcd04c729839 (diff) | |
am db9fed74: Merge "Make WindowInsets.isRound work with emulator" into klp-modular-dev
* commit 'db9fed74c2bbf97157683b47f3cbdcd04c729839':
Make WindowInsets.isRound work with emulator
| -rw-r--r-- | core/java/android/view/ViewRootImpl.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java index 1cb047338cfe..b3a66f03de37 100644 --- a/core/java/android/view/ViewRootImpl.java +++ b/core/java/android/view/ViewRootImpl.java @@ -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,8 +1161,10 @@ 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( - com.android.internal.R.bool.config_windowIsRound); + 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( mFitSystemWindowsInsets, isRound)); |