mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Merge "Use DISPLAY_CATEGORY_ALL_INCLUDING_DISABLED for getDisplays" into tm-dev
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user