Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a83ab6d4 authored by Luca Stefani's avatar Luca Stefani
Browse files

Prevent NFE in SystemUI when parsing invalid int

* Also for custom lineage keys

Change-Id: Ie0d63e2c3af2c613bb8c9bdf6ff97637e754b7ae
parent 1a9c57c3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ public class VisualizerView extends View
    @Override
    public void onTuningChanged(String key, String newValue) {
        if (LOCKSCREEN_VISUALIZER_ENABLED.equals(key)) {
            mVisualizerEnabled = newValue == null || Integer.parseInt(newValue) != 0;
            mVisualizerEnabled = TunerService.parseIntegerSwitch(newValue, true);
            checkStateChanged();
            updateViewVisibility();
        }
+4 −1
Original line number Diff line number Diff line
@@ -81,7 +81,10 @@ public class ClockController implements TunerService.Tunable {
        Log.d(TAG, "onTuningChanged key=" + key + " value=" + newValue);

        if (CLOCK_POSITION.equals(key)) {
            mClockPosition = newValue == null ? CLOCK_POSITION_LEFT : Integer.valueOf(newValue);
            mClockPosition = CLOCK_POSITION_LEFT;
            try {
                mClockPosition = Integer.valueOf(newValue);
            } catch (NumberFormatException ex) {}
        } else {
            mBlackListed = StatusBarIconController.getIconBlacklist(newValue).contains("clock");
        }
+1 −1
Original line number Diff line number Diff line
@@ -293,7 +293,7 @@ public class NavigationBarGestureHelper implements TunerService.Tunable, Gesture
    public void onTuningChanged(String key, String newValue) {
        switch (key) {
            case KEY_DOCK_WINDOW_GESTURE:
                mDockWindowEnabled = newValue != null && (Integer.parseInt(newValue) != 0);
                mDockWindowEnabled = TunerService.parseIntegerSwitch(newValue, false);
                break;
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ public class NavigationBarInflaterView extends FrameLayout
            clearViews();
            inflateLayout(mCurrentLayout);
        } else if (NAV_BAR_INVERSE.equals(key)) {
            mInverseLayout = newValue != null && Integer.parseInt(newValue) != 0;
            mInverseLayout = TunerService.parseIntegerSwitch(newValue, false);
            clearViews();
            inflateLayout(mCurrentLayout);
        }
+1 −1
Original line number Diff line number Diff line
@@ -1170,7 +1170,7 @@ public class NavigationBarView extends FrameLayout implements PluginListener<Nav
    @Override
    public void onTuningChanged(String key, String newValue) {
        if (NAVIGATION_BAR_MENU_ARROW_KEYS.equals(key)) {
            mShowDpadArrowKeys = newValue != null && Integer.parseInt(newValue) != 0;
            mShowDpadArrowKeys = TunerService.parseIntegerSwitch(newValue, false);
            setNavigationIconHints(mNavigationIconHints);
        }
    }
Loading