diff --git a/packages/SystemUI/res/values-sw600dp-land/config.xml b/packages/SystemUI/res/values-sw600dp-land/config.xml
index e2b2e2590b23f..369e45cd44948 100644
--- a/packages/SystemUI/res/values-sw600dp-land/config.xml
+++ b/packages/SystemUI/res/values-sw600dp-land/config.xml
@@ -18,6 +18,10 @@
2
+ 2
+ 4
+ 8
+
true
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index 478bf9aa6afb7..56262f7026255 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -86,7 +86,10 @@
true
- 4
+ 4
+
+
+ 2
2
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
index 4cd4048f72868..e3c241c372a7b 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java
@@ -33,18 +33,16 @@ import com.android.systemui.plugins.qs.QSTile.State;
*/
public class QuickQSPanel extends QSPanel {
- public static final String NUM_QUICK_TILES = "sysui_qqs_count";
private static final String TAG = "QuickQSPanel";
- // A default value so that we never return 0.
- public static final int DEFAULT_MAX_TILES = 6;
+ // A fallback value for max tiles number when setting via Tuner (parseNumTiles)
+ public static final int TUNER_MAX_TILES_FALLBACK = 6;
private boolean mDisabledByPolicy;
private int mMaxTiles;
public QuickQSPanel(Context context, AttributeSet attrs) {
super(context, attrs);
- mMaxTiles = Math.min(DEFAULT_MAX_TILES,
- getResources().getInteger(R.integer.quick_qs_panel_max_columns));
+ mMaxTiles = getResources().getInteger(R.integer.quick_qs_panel_max_tiles);
}
@Override
@@ -101,7 +99,7 @@ public class QuickQSPanel extends QSPanel {
}
public void setMaxTiles(int maxTiles) {
- mMaxTiles = Math.min(maxTiles, DEFAULT_MAX_TILES);
+ mMaxTiles = maxTiles;
}
@Override
@@ -117,17 +115,18 @@ public class QuickQSPanel extends QSPanel {
}
/**
- * Parses the String setting into the number of tiles. Defaults to {@code mDefaultMaxTiles}
+ * Parses the String setting into the number of tiles. Defaults to
+ * {@link #TUNER_MAX_TILES_FALLBACK}
*
* @param numTilesValue value of the setting to parse
- * @return parsed value of numTilesValue OR {@code mDefaultMaxTiles} on error
+ * @return parsed value of numTilesValue OR {@link #TUNER_MAX_TILES_FALLBACK} on error
*/
public static int parseNumTiles(String numTilesValue) {
try {
return Integer.parseInt(numTilesValue);
} catch (NumberFormatException e) {
// Couldn't read an int from the new setting value. Use default.
- return DEFAULT_MAX_TILES;
+ return TUNER_MAX_TILES_FALLBACK;
}
}
@@ -187,7 +186,7 @@ public class QuickQSPanel extends QSPanel {
public boolean updateResources() {
mCellHeightResId = R.dimen.qs_quick_tile_size;
boolean b = super.updateResources();
- mMaxAllowedRows = 2;
+ mMaxAllowedRows = getResources().getInteger(R.integer.quick_qs_panel_max_rows);
return b;
}
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanelController.java b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanelController.java
index fee56b984eccb..d75b0fd5983e6 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanelController.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QuickQSPanelController.java
@@ -43,7 +43,7 @@ public class QuickQSPanelController extends QSPanelControllerBase
private final QSPanel.OnConfigurationChangedListener mOnConfigurationChangedListener =
newConfig -> {
- int newMaxTiles = getResources().getInteger(R.integer.quick_qs_panel_max_columns);
+ int newMaxTiles = getResources().getInteger(R.integer.quick_qs_panel_max_tiles);
if (newMaxTiles != mView.getNumQuickTiles()) {
setMaxTiles(newMaxTiles);
}