revent NFE in SystemUI when parsing invalid int (2)
A user can change various tunable settings setting via adb.
If the value set is not an integer, SystemUI will end up in an exception
loop.
Test: No crash when running:
adb exec-out settings put secure sysui_qs_move_whole_rows a
adb exec-out settings put secure qs_show_brightness a
adb exec-out settings put secure clock_seconds a
adb exec-out settings put secure sysui_volume_down_silent a
adb exec-out settings put secure sysui_volume_up_silent a
adb exec-out settings put secure sysui_do_not_disturb a
Change-Id: If9c565cbdd44db25ba7fce381c98aa0ab735bfc4
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 3fc258b..bdc73d9 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -191,7 +191,7 @@
}
private void updateViewVisibilityForTuningValue(View view, @Nullable String newValue) {
- view.setVisibility(newValue == null || Integer.parseInt(newValue) != 0 ? VISIBLE : GONE);
+ view.setVisibility(TunerService.parseIntegerSwitch(newValue, true) ? VISIBLE : GONE);
}
public void openDetails(String subPanel) {