From 914aae9c936a05e5cf32f4eef91997570455b01a Mon Sep 17 00:00:00 2001 From: Yunfan Chen Date: Thu, 10 Apr 2025 15:14:11 +0900 Subject: [PATCH] Update Insets API call due to signature change The frameworks updated the Insets API signature to support relative insets to make the insets system works better under desktop mode and to support more flexible usage in the future. Update the corresponding call to match the changed signature. Test: InsetsStateTest InsetsPolicyTests Test: WindowContainerTests Flag: com.android.window.flags.relative_insets Bug: 277292497 Change-Id: Ib0d866514dcac33b72e1715f8442b695d9e9b3a0 --- .../com/android/quickstep/HomeVisibilityState.kt | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/HomeVisibilityState.kt b/quickstep/src/com/android/quickstep/HomeVisibilityState.kt index 020b9e2fab..2a9c7cb7dd 100644 --- a/quickstep/src/com/android/quickstep/HomeVisibilityState.kt +++ b/quickstep/src/com/android/quickstep/HomeVisibilityState.kt @@ -20,7 +20,6 @@ import android.os.RemoteException import android.util.Log import android.view.InsetsState import android.view.WindowInsets - import com.android.launcher3.Utilities import com.android.launcher3.config.FeatureFlags import com.android.launcher3.util.Executors @@ -55,10 +54,19 @@ class HomeVisibilityState { }, ) } + override fun onDisplayInsetsChanged(insetsState: InsetsState) { - val bottomInset = insetsState.calculateInsets(insetsState.displayFrame, - WindowInsets.Type.navigationBars(), false).bottom - navbarInsetPosition = insetsState.displayFrame.bottom - bottomInset + val displayFrame = insetsState.displayFrame + val bottomInset = + insetsState + .calculateInsets( + displayFrame, + displayFrame, + WindowInsets.Type.navigationBars(), + false, + ) + .bottom + navbarInsetPosition = displayFrame.bottom - bottomInset } } )