Merge "Use DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED for getDisplays" into tm-dev

This commit is contained in:
Alex Chau
2022-06-09 17:40:07 +00:00
committed by Android (Google) Code Review
2 changed files with 15 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
package com.android.quickstep.util;
import android.content.Context;
import android.hardware.display.DisplayManager;
import android.view.Display;
import com.android.launcher3.util.window.WindowManagerProxy;
@@ -43,4 +44,10 @@ public class SystemWindowManagerProxy extends WindowManagerProxy {
public int getRotation(Context context) {
return context.getResources().getConfiguration().windowConfiguration.getRotation();
}
@Override
protected Display[] getDisplays(Context context) {
return context.getSystemService(DisplayManager.class).getDisplays(
DisplayManager.DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED);
}
}

View File

@@ -90,7 +90,7 @@ public class WindowManagerProxy implements ResourceBasedOverride {
*/
public ArrayMap<String, Pair<CachedDisplayInfo, WindowBounds[]>> estimateInternalDisplayBounds(
Context context) {
Display[] displays = context.getSystemService(DisplayManager.class).getDisplays();
Display[] displays = getDisplays(context);
ArrayMap<String, Pair<CachedDisplayInfo, WindowBounds[]>> result = new ArrayMap<>();
for (Display display : displays) {
if (isInternalDisplay(display)) {
@@ -355,4 +355,11 @@ public class WindowManagerProxy implements ResourceBasedOverride {
}
return d.getRotation();
}
/**
* Returns all currently valid logical displays.
*/
protected Display[] getDisplays(Context context) {
return context.getSystemService(DisplayManager.class).getDisplays();
}
}