diff options
author | Adam Powell <adamp@google.com> | 2015-05-14 16:18:53 -0700 |
---|---|---|
committer | Adam Powell <adamp@google.com> | 2015-05-18 14:13:33 -0700 |
commit | 49e7ff9647e6547c2b852944a5435a05794b9951 (patch) | |
tree | 7f58ae2e1e3128b3f1864a29162aaa1716919e2b /services/core/java/com/android/server/wm | |
parent | 855d5495ffbd9d0e2dfbd22def462247a1a4e61b (diff) | |
download | frameworks_base-49e7ff9647e6547c2b852944a5435a05794b9951.zip frameworks_base-49e7ff9647e6547c2b852944a5435a05794b9951.tar.gz frameworks_base-49e7ff9647e6547c2b852944a5435a05794b9951.tar.bz2 |
Add Configuration data for round displays
Add round values to the screenLayout field for Configuration
and a convenience method to check roundness.
Plumb this through the DisplayManager, making roundness the property
of a DisplayAdapter. The built-in main display will read the
configuration resource config_mainBuiltInDisplayIsRound to determine
its roundness. Device-specific resource overlays should set this to
true for devices with round primary displays.
By default, this config resource inherits from the existing
config_windowIsRound value currently used by some Android Wear
device configurations.
This change awaits another for aapt/native resources code to make the
resource filtering system aware of this property.
Change-Id: I1daced7ca6d6e172789e7c32bebfd43753bfa2ae
Diffstat (limited to 'services/core/java/com/android/server/wm')
-rw-r--r-- | services/core/java/com/android/server/wm/WindowManagerService.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java index 3644506..e43861c 100644 --- a/services/core/java/com/android/server/wm/WindowManagerService.java +++ b/services/core/java/com/android/server/wm/WindowManagerService.java @@ -7341,6 +7341,11 @@ public class WindowManagerService extends IWindowManager.Stub computeSizeRangesAndScreenLayout(displayInfo, rotated, dw, dh, mDisplayMetrics.density, config); + config.screenLayout = (config.screenLayout & ~Configuration.SCREENLAYOUT_ROUND_MASK) + | ((displayInfo.flags & Display.FLAG_ROUND) != 0 + ? Configuration.SCREENLAYOUT_ROUND_YES + : Configuration.SCREENLAYOUT_ROUND_NO); + config.compatScreenWidthDp = (int)(config.screenWidthDp / mCompatibleScreenScale); config.compatScreenHeightDp = (int)(config.screenHeightDp / mCompatibleScreenScale); config.compatSmallestScreenWidthDp = computeCompatSmallestWidth(rotated, |