Use AplicationContext for getWindowCornerRadius on DEFAULT_DISPLAY

- ag/32861507 changed getWindowCornerRadius to use DisplayContext, which does not get updated on configuartion changes, this caused potentially regression of having wrong corner radius after configuration changes
- ag/32896744  attempted to fix this with window context, get is rolled back due to perfroamcne regression
- This CL is a temp fix to make DEFAULT_DISPLAY continue usign AplicationContext for getWindowCornerRadius, if the AplicationContext is associated to a display, and otherwise fallback to displayContext

Bug: 408988616
Test: manual
Flag: EXEMPT bug fix
Change-Id: I72dbcfb7cd6cdc6783e96768b4f4b51b76d9a245
This commit is contained in:
Alex Chau
2025-04-10 15:48:34 +01:00
parent 5e619cd675
commit 2e7ef70770
@@ -149,8 +149,13 @@ public class RotationTouchHelper implements DisplayInfoChangeListener {
mSystemUiProxy = systemUiProxy;
Resources resources = mApplicationContext.getResources();
// TODO(b/408988616): Find a better solution for external display to have resources updated
// after configuration changes.
Context displayAssociatedContext =
mApplicationContext.getAssociatedDisplayId() == mDisplayId
? mApplicationContext : displayContext;
mOrientationTouchTransformer = new OrientationTouchTransformer(resources, mMode,
() -> QuickStepContract.getWindowCornerRadius(displayContext));
() -> QuickStepContract.getWindowCornerRadius(displayAssociatedContext));
// Register for navigation mode and rotation changes
mDisplayController.addChangeListenerForDisplay(this, mDisplayId);