From ec295771f7675e8a8163a162419f43f7b5830fc1 Mon Sep 17 00:00:00 2001 From: Nicolo' Mazzucato Date: Sat, 26 Mar 2022 00:19:12 +0000 Subject: [PATCH] Fix DeviceFoldStateProviderTest topActivityType is available directly from taskInfo. In the test, the windowConfiguration was not mocked correctly. Fixes: 226967913 Test: atest DeviceFoldStateProviderTest Change-Id: Ia0f2114ff675d943a7e2c2555aa0d11b854883a0 --- .../systemui/unfold/updates/DeviceFoldStateProvider.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt b/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt index eb1181d98bec4..ed973d6a68544 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt +++ b/packages/SystemUI/shared/src/com/android/systemui/unfold/updates/DeviceFoldStateProvider.kt @@ -126,12 +126,7 @@ constructor( */ private fun getClosingThreshold(): Int? { val activityType = - activityManager - .getRunningTasks(/* maxNum= */ 1) - ?.getOrNull(0) - ?.configuration - ?.windowConfiguration - ?.activityType + activityManager.getRunningTasks(/* maxNum= */ 1)?.getOrNull(0)?.topActivityType ?: return null if (DEBUG) {