Listen to DisplayController for ignoreAutoRotateSettings

- Also skip most of initDeviceProfile/onIdpChanged if DeviceProfile didn't actually change to effectively skip the 2nd unexpected onConfigurationChangeded caused by setRequestedOrientation (b/211763738)

Test: Change display size while in app or at home screen
Fix: 240019605
Change-Id: If307742639bd269622140a7da0dc900887c67937
This commit is contained in:
Alex Chau
2022-07-27 14:08:23 +01:00
parent bb76b99c56
commit 6209af67d3
3 changed files with 28 additions and 12 deletions

View File

@@ -278,11 +278,11 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
public final float fontScale;
private final int densityDpi;
public final NavigationMode navigationMode;
private final PortraitSize mScreenSizeDp;
// WindowBounds
public final WindowBounds realBounds;
public final Set<WindowBounds> supportedBounds = new ArraySet<>();
private final ArrayMap<CachedDisplayInfo, WindowBounds[]> mPerDisplayBounds =
new ArrayMap<>();
@@ -310,7 +310,7 @@ public class DisplayController implements ComponentCallbacks, SafeCloseable {
mPerDisplayBounds.putAll(perDisplayBoundsCache);
WindowBounds[] cachedValue = mPerDisplayBounds.get(normalizedDisplayInfo);
WindowBounds realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
realBounds = wmProxy.getRealBounds(displayInfoContext, displayInfo);
if (cachedValue == null) {
// Unexpected normalizedDisplayInfo is found, recreate the cache
Log.e(TAG, "Unexpected normalizedDisplayInfo found, invalidating cache");