diff options
author | Adam Powell <adamp@google.com> | 2015-05-18 16:07:42 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2015-05-18 16:07:42 -0700 |
commit | 01f280d376218c5a007fc29f70b876375ad24204 (patch) | |
tree | 542475aea062cf106b13cd52c0f57d812b7ee7a2 /services/core/java/com/android/server | |
parent | 98465f99bb9aa2da3905241a0ca95b708100560b (diff) | |
download | frameworks_base-01f280d376218c5a007fc29f70b876375ad24204.zip frameworks_base-01f280d376218c5a007fc29f70b876375ad24204.tar.gz frameworks_base-01f280d376218c5a007fc29f70b876375ad24204.tar.bz2 |
Migrate uses of config_windowIsRound to Configuration.isScreenRound
Move existing code that previously relied on config_windowIsRound to
use the new Configuration.isScreenRound() method. Also move the system
property override for emulators over to the initial setup of a Display
so that the configuration property is consistent with existing
expectations.
Remove config_windowIsRound from symbols.xml. The symbol now only
exists as a default value redirect for overlays already configured to
supply this value.
Change-Id: I24e6564030a6051c3ac7262868983b43e13eee65
Diffstat (limited to 'services/core/java/com/android/server')
4 files changed, 9 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java index e516573..517a825 100644 --- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java +++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java @@ -17,6 +17,7 @@ package com.android.server.display; import android.content.res.Resources; +import android.os.Build; import com.android.server.LocalServices; import com.android.server.lights.Light; import com.android.server.lights.LightsManager; @@ -50,6 +51,8 @@ final class LocalDisplayAdapter extends DisplayAdapter { private static final String UNIQUE_ID_PREFIX = "local:"; + private static final String PROPERTY_EMULATOR_CIRCULAR = "ro.emulator.circular"; + private static final int[] BUILT_IN_DISPLAY_IDS_TO_SCAN = new int[] { SurfaceControl.BUILT_IN_DISPLAY_ID_MAIN, SurfaceControl.BUILT_IN_DISPLAY_ID_HDMI, @@ -273,8 +276,9 @@ final class LocalDisplayAdapter extends DisplayAdapter { com.android.internal.R.string.display_manager_built_in_display_name); mInfo.flags |= DisplayDeviceInfo.FLAG_DEFAULT_DISPLAY | DisplayDeviceInfo.FLAG_ROTATES_WITH_CONTENT; - if (res.getBoolean( - com.android.internal.R.bool.config_mainBuiltInDisplayIsRound)) { + if (res.getBoolean(com.android.internal.R.bool.config_mainBuiltInDisplayIsRound) + || (Build.HARDWARE.contains("goldfish") + && SystemProperties.getBoolean(PROPERTY_EMULATOR_CIRCULAR, false))) { mInfo.flags |= DisplayDeviceInfo.FLAG_ROUND; } mInfo.type = Display.TYPE_BUILT_IN; diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java index 185ef03..a4e9c68 100644 --- a/services/core/java/com/android/server/policy/PhoneWindowManager.java +++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java @@ -1220,9 +1220,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { }; private boolean isRoundWindow() { - return mContext.getResources().getBoolean(com.android.internal.R.bool.config_windowIsRound) - || (Build.HARDWARE.contains("goldfish") - && SystemProperties.getBoolean(ViewRootImpl.PROPERTY_EMULATOR_CIRCULAR, false)); + return mContext.getResources().getConfiguration().isScreenRound(); } /** {@inheritDoc} */ diff --git a/services/core/java/com/android/server/wm/AccessibilityController.java b/services/core/java/com/android/server/wm/AccessibilityController.java index 91ce739..482ae24 100644 --- a/services/core/java/com/android/server/wm/AccessibilityController.java +++ b/services/core/java/com/android/server/wm/AccessibilityController.java @@ -432,8 +432,7 @@ final class AccessibilityController { mDrawBorderInset = (int) mBorderWidth / 2; mWindow = new ViewportWindow(mContext); - if (mContext.getResources().getBoolean( - com.android.internal.R.bool.config_windowIsRound)) { + if (mContext.getResources().getConfiguration().isScreenRound()) { mCircularPath = new Path(); mWindowManager.getDefaultDisplay().getRealSize(mTempPoint); final int centerXY = mTempPoint.x / 2; diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index e43861c..d94f5d9 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -5923,8 +5923,7 @@ public class WindowManagerService extends IWindowManager.Stub public void updateCircularDisplayMaskIfNeeded() { // we're fullscreen and not hosted in an ActivityView - if (mContext.getResources().getBoolean( - com.android.internal.R.bool.config_windowIsRound) + if (mContext.getResources().getConfiguration().isScreenRound() && mContext.getResources().getBoolean( com.android.internal.R.bool.config_windowShowCircularMask)) { // Device configuration calls for a circular display mask, but we only enable the mask |