From d276dd5efca519e99a222750097a9a7c01a17bb1 Mon Sep 17 00:00:00 2001 From: Aaron Liu Date: Thu, 3 Feb 2022 19:55:38 +0000 Subject: [PATCH] Home Controls: Fix column computation. When we enter home controls from a full screen media player and auto rotation is off, the columns were not being computed correctly. This is because we were getting the config resources from the application context and not the activity context. Bug: 203177915 Test: Manual Change-Id: Iec76d61b1506022746127b58d022656e82da99d3 --- .../android/systemui/controls/ui/ControlsUiControllerImpl.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt index 5a52fd0516ea9..59c291cf9e5cc 100644 --- a/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt +++ b/packages/SystemUI/src/com/android/systemui/controls/ui/ControlsUiControllerImpl.kt @@ -437,7 +437,7 @@ class ControlsUiControllerImpl @Inject constructor ( * number of columns. This helps prevent text truncation on these devices. */ private fun findMaxColumns(): Int { - val res = context.resources + val res = activityContext.resources var maxColumns = res.getInteger(R.integer.controls_max_columns) val maxColumnsAdjustWidth = res.getInteger(R.integer.controls_max_columns_adjust_below_width_dp)