Use normalized CachedDisplayInfo as key

- For system Launcher, migrate to use getPossibleMaximumWindowMetrics instead of getDisplays
- Removed usage of displayId
- In estimateInternalDisplayBounds, use CachedDisplayInfo directly as a key
- When cache retunrs null for the current display (e.g. the 3P launcher case), invalidate the cache and estimate again, and only add to supportedBounds if current display is not found in the new cache

Bug: 227459045
Bug: 198965093
Test: manual
Change-Id: Ibcc05ba483ed31a40d16e3cf49c3f3d43af68cf6
This commit is contained in:
Alex Chau
2022-06-07 14:03:43 +01:00
parent d3a7d37a57
commit 661f02de18
9 changed files with 159 additions and 177 deletions

View File

@@ -234,7 +234,8 @@ public class InvariantDeviceProfile {
/*allowDisabledGrid=*/false),
defaultDeviceType);
Info myInfo = new Info(context, display);
Context displayContext = context.createDisplayContext(display);
Info myInfo = new Info(displayContext);
@DeviceType int deviceType = getDeviceType(myInfo);
DisplayOption myDisplayOption = invDistWeightedInterpolate(
myInfo,
@@ -642,7 +643,7 @@ public class InvariantDeviceProfile {
+ "\nconfig: " + config
+ "\ndisplayMetrics: " + res.getDisplayMetrics()
+ "\nrotation: " + rotation
+ "\n" + stringWriter.toString(),
+ "\n" + stringWriter,
new Exception());
}
return getBestMatch(screenWidth, screenHeight, rotation);