summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/view/ViewRootImpl.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/java/android/view/ViewRootImpl.java b/core/java/android/view/ViewRootImpl.java
index 7d5881c..4fe1062 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_EMULATOR_CIRCULAR = "ro.emulator.circular";
+
/**
* Maximum time we allow the user to roll the trackball enough to generate
* a key event, before resetting the counters.
@@ -322,6 +326,8 @@ public final class ViewRootImpl implements ViewParent,
/** Set to true once doDie() has been called. */
private boolean mRemoved;
+ private boolean mIsEmulator;
+
/**
* Consistency verifier for debugging purposes.
*/
@@ -1157,8 +1163,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(
- com.android.internal.R.bool.config_windowIsRound);
+ isRound = (mIsEmulator && SystemProperties.getBoolean(PROPERTY_EMULATOR_CIRCULAR, false))
+ || mContext.getResources().getBoolean(
+ com.android.internal.R.bool.config_windowIsRound);
}
host.dispatchApplyWindowInsets(new WindowInsets(
mFitSystemWindowsInsets, isRound));
@@ -5378,6 +5385,9 @@ public final class ViewRootImpl implements ViewParent,
mHandler.sendEmptyMessageDelayed(MSG_INVALIDATE_WORLD, 200);
}
}
+
+ // detect emulator
+ mIsEmulator = Build.HARDWARE.contains("goldfish");
}
});
}