Loading core/java/com/android/internal/policy/ScreenDecorationsUtils.java +15 −4 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package com.android.internal.policy; import com.android.internal.R; import android.content.res.Resources; import com.android.internal.R; /** * Utility functions for screen decorations used by both window manager and System UI. */ Loading @@ -31,15 +31,19 @@ public class ScreenDecorationsUtils { * scaling, this means that we don't have to reload them on config changes. */ public static float getWindowCornerRadius(Resources resources) { if (!supportsRoundedCornersOnWindows(resources)) { return 0f; } // Radius that should be used in case top or bottom aren't defined. float defaultRadius = resources.getDimension(R.dimen.rounded_corner_radius); float topRadius = resources.getDimension(R.dimen.rounded_corner_radius_top); if (topRadius == 0) { if (topRadius == 0f) { topRadius = defaultRadius; } float bottomRadius = resources.getDimension(R.dimen.rounded_corner_radius_bottom); if (bottomRadius == 0) { if (bottomRadius == 0f) { bottomRadius = defaultRadius; } Loading @@ -47,4 +51,11 @@ public class ScreenDecorationsUtils { // completely cover the display. return Math.min(topRadius, bottomRadius); } /** * If live rounded corners are supported on windows. */ public static boolean supportsRoundedCornersOnWindows(Resources resources) { return resources.getBoolean(R.bool.config_supportsRoundedCornersOnWindows); } } core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -3648,4 +3648,8 @@ set in AndroidManifest. {@see android.view.Display#FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS} --> <string name="config_secondaryHomeComponent" translatable="false">com.android.launcher3/com.android.launcher3.SecondaryDisplayLauncher</string> <!-- If device supports corner radius on windows. This should be turned off on low-end devices to improve animation performance. --> <bool name="config_supportsRoundedCornersOnWindows">true</bool> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3515,6 +3515,7 @@ <java-symbol type="dimen" name="rounded_corner_radius" /> <java-symbol type="dimen" name="rounded_corner_radius_top" /> <java-symbol type="dimen" name="rounded_corner_radius_bottom" /> <java-symbol type="bool" name="config_supportsRoundedCornersOnWindows" /> <java-symbol type="string" name="config_defaultModuleMetadataProvider" /> Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -76,4 +76,10 @@ interface ISystemUiProxy { */ float getWindowCornerRadius() = 10; /** * If device supports live rounded corners on windows. * This might be turned off for performance reasons */ boolean supportsRoundedCornersOnWindows() = 11; } packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +15 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private float mBackButtonAlpha; private MotionEvent mStatusBarGestureDownEvent; private float mWindowCornerRadius; private boolean mSupportsRoundedCornersOnWindows; private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() { Loading Loading @@ -244,6 +245,18 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public boolean supportsRoundedCornersOnWindows() { if (!verifyCaller("supportsRoundedCornersOnWindows")) { return false; } long token = Binder.clearCallingIdentity(); try { return mSupportsRoundedCornersOnWindows; } finally { Binder.restoreCallingIdentity(token); } } private boolean verifyCaller(String reason) { final int callerId = Binder.getCallingUserHandle().getIdentifier(); if (callerId != mCurrentBoundedUserId) { Loading Loading @@ -353,6 +366,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mInteractionFlags = Prefs.getInt(mContext, Prefs.Key.QUICK_STEP_INTERACTION_FLAGS, getDefaultInteractionFlags()); mWindowCornerRadius = ScreenDecorationsUtils.getWindowCornerRadius(mContext.getResources()); mSupportsRoundedCornersOnWindows = ScreenDecorationsUtils .supportsRoundedCornersOnWindows(mContext.getResources()); // Listen for the package update changes. if (mDeviceProvisionedController.getCurrentUser() == UserHandle.USER_SYSTEM) { Loading Loading
core/java/com/android/internal/policy/ScreenDecorationsUtils.java +15 −4 Original line number Diff line number Diff line Loading @@ -16,10 +16,10 @@ package com.android.internal.policy; import com.android.internal.R; import android.content.res.Resources; import com.android.internal.R; /** * Utility functions for screen decorations used by both window manager and System UI. */ Loading @@ -31,15 +31,19 @@ public class ScreenDecorationsUtils { * scaling, this means that we don't have to reload them on config changes. */ public static float getWindowCornerRadius(Resources resources) { if (!supportsRoundedCornersOnWindows(resources)) { return 0f; } // Radius that should be used in case top or bottom aren't defined. float defaultRadius = resources.getDimension(R.dimen.rounded_corner_radius); float topRadius = resources.getDimension(R.dimen.rounded_corner_radius_top); if (topRadius == 0) { if (topRadius == 0f) { topRadius = defaultRadius; } float bottomRadius = resources.getDimension(R.dimen.rounded_corner_radius_bottom); if (bottomRadius == 0) { if (bottomRadius == 0f) { bottomRadius = defaultRadius; } Loading @@ -47,4 +51,11 @@ public class ScreenDecorationsUtils { // completely cover the display. return Math.min(topRadius, bottomRadius); } /** * If live rounded corners are supported on windows. */ public static boolean supportsRoundedCornersOnWindows(Resources resources) { return resources.getBoolean(R.bool.config_supportsRoundedCornersOnWindows); } }
core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -3648,4 +3648,8 @@ set in AndroidManifest. {@see android.view.Display#FLAG_SHOULD_SHOW_SYSTEM_DECORATIONS} --> <string name="config_secondaryHomeComponent" translatable="false">com.android.launcher3/com.android.launcher3.SecondaryDisplayLauncher</string> <!-- If device supports corner radius on windows. This should be turned off on low-end devices to improve animation performance. --> <bool name="config_supportsRoundedCornersOnWindows">true</bool> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -3515,6 +3515,7 @@ <java-symbol type="dimen" name="rounded_corner_radius" /> <java-symbol type="dimen" name="rounded_corner_radius_top" /> <java-symbol type="dimen" name="rounded_corner_radius_bottom" /> <java-symbol type="bool" name="config_supportsRoundedCornersOnWindows" /> <java-symbol type="string" name="config_defaultModuleMetadataProvider" /> Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/ISystemUiProxy.aidl +6 −0 Original line number Diff line number Diff line Loading @@ -76,4 +76,10 @@ interface ISystemUiProxy { */ float getWindowCornerRadius() = 10; /** * If device supports live rounded corners on windows. * This might be turned off for performance reasons */ boolean supportsRoundedCornersOnWindows() = 11; }
packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java +15 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,7 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis private float mBackButtonAlpha; private MotionEvent mStatusBarGestureDownEvent; private float mWindowCornerRadius; private boolean mSupportsRoundedCornersOnWindows; private ISystemUiProxy mSysUiProxy = new ISystemUiProxy.Stub() { Loading Loading @@ -244,6 +245,18 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis } } public boolean supportsRoundedCornersOnWindows() { if (!verifyCaller("supportsRoundedCornersOnWindows")) { return false; } long token = Binder.clearCallingIdentity(); try { return mSupportsRoundedCornersOnWindows; } finally { Binder.restoreCallingIdentity(token); } } private boolean verifyCaller(String reason) { final int callerId = Binder.getCallingUserHandle().getIdentifier(); if (callerId != mCurrentBoundedUserId) { Loading Loading @@ -353,6 +366,8 @@ public class OverviewProxyService implements CallbackController<OverviewProxyLis mInteractionFlags = Prefs.getInt(mContext, Prefs.Key.QUICK_STEP_INTERACTION_FLAGS, getDefaultInteractionFlags()); mWindowCornerRadius = ScreenDecorationsUtils.getWindowCornerRadius(mContext.getResources()); mSupportsRoundedCornersOnWindows = ScreenDecorationsUtils .supportsRoundedCornersOnWindows(mContext.getResources()); // Listen for the package update changes. if (mDeviceProvisionedController.getCurrentUser() == UserHandle.USER_SYSTEM) { Loading