From 49e7ff9647e6547c2b852944a5435a05794b9951 Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 14 May 2015 16:18:53 -0700 Subject: 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 --- services/core/java/com/android/server/wm/WindowManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'services/core/java/com/android/server/wm') 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, -- cgit v1.1