diff --git a/GITHUB_CHANGELOG.md b/GITHUB_CHANGELOG.md index 52d469ec5f..db76d497e6 100644 --- a/GITHUB_CHANGELOG.md +++ b/GITHUB_CHANGELOG.md @@ -49,7 +49,10 @@ Compatibility list: * Assume flags `enableMovingContentIntoPrivateSpace` is false when ClassNotFoundException on Android 16 devices * Rare NoSuchMethodError crash on SurfaceControl setEarlyWakeupStart and setEarlyWakeupEnd * Properly align built-in smartspace in workspace -* Android +* Use WM Proxy from Lawnchair instead of System, fix Android 8.1/9/10/11/12.0/12.1 regarding SE, NSME like SystemBarUtils -> (dWkyIGw9), (reworked CllOXHJv) + * Comment regarding estimate bounds on foldable have been added + * LawnchairWindowManagerProxy have been migrated to Dagger + * SystemWindowManagerProxy have been left unused #### Known Bugs * Preview can't show device wallpaper -> (lIxkAYGg) diff --git a/lawnchair/src/app/lawnchair/util/LawnchairWindowManagerProxy.kt b/lawnchair/src/app/lawnchair/util/LawnchairWindowManagerProxy.kt index 393c759763..64fbf1223e 100644 --- a/lawnchair/src/app/lawnchair/util/LawnchairWindowManagerProxy.kt +++ b/lawnchair/src/app/lawnchair/util/LawnchairWindowManagerProxy.kt @@ -6,6 +6,7 @@ import android.graphics.Insets import android.graphics.Rect import android.hardware.display.DisplayManager import android.util.ArrayMap +import android.util.Log import android.view.Display import android.view.Display.DEFAULT_DISPLAY import android.view.DisplayCutout @@ -30,10 +31,27 @@ import kotlin.math.max @LauncherAppSingleton class LawnchairWindowManagerProxy @Inject constructor() : WindowManagerProxy(Utilities.ATLEAST_T) { + @Suppress("PropertyName") + val TAG = "LC-WindowManagerProxy" + override fun estimateInternalDisplayBounds(displayInfoContext: Context): ArrayMap> { + // Lawnchair-TODO(Foldable): See estimateInternalDisplayBounds in [SystemWindowManagerProxy] + // Wait... If SWMP fallback to getMaximumWindowMetrics from [WindowManager] public APIs + // That means that we can combine getMaximumWindowMetrics with getCurrentWindowMetrics! + // Wait... but doesn't that only account for two screens? What if there were more than two + // Until then *this* is a good enough solutions + // Wait... Launcher calls eIDB every time you interact, what happened if you switched screen + // to the screen with maximum window metrics screen? won't that cause duplicate with + // getCurrentWindowMetrics? + // + // True... we duplicate it, and cache it? Is there a better way to do this? + // We can't just call [getPossibleMaximumWindowMetrics] because it's an internal apis, + // reflection won't work. Thanks @SystemApi val info = getDisplayInfo(displayInfoContext).normalize(this) val bounds = estimateWindowBounds(displayInfoContext, info) - return ArrayMap>().apply { put(info, bounds) } + val result = ArrayMap>().apply { put(info, bounds) } + Log.d(TAG, "estimateInternalDisplayBounds: $result") + return result } override fun getRealBounds(displayInfoContext: Context, info: CachedDisplayInfo): WindowBounds { diff --git a/quickstep/src/com/android/quickstep/util/SystemWindowManagerProxy.java b/quickstep/src/com/android/quickstep/util/SystemWindowManagerProxy.java index 7cb73ab4a7..b3ab4df1b6 100644 --- a/quickstep/src/com/android/quickstep/util/SystemWindowManagerProxy.java +++ b/quickstep/src/com/android/quickstep/util/SystemWindowManagerProxy.java @@ -48,6 +48,7 @@ import javax.inject.Inject; */ @LauncherAppSingleton public class SystemWindowManagerProxy extends WindowManagerProxy { + // LC-Note: This is pretty much unused by Launcher3, see [LawnchairWindowManagerProxy] private final DesktopVisibilityController mDesktopVisibilityController;