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

Commit f039efa0 authored by Robin Lee's avatar Robin Lee
Browse files

Don't assume device has a status bar (TVs don't)

If this block of code doesn't find a StatusBar, it crashes the
ActivityThread, which restarts every couple of seconds right up
until the OS has had enough and decides to reboot.

Test: flashall && adb logcat | grep '.SystemUIService: java.lang.NullPointerException'
Bug: 62940302
Change-Id: Ib0adbadbc467df4941e03c7506762a7ec302d673
parent 1a9fa0e1
Loading
Loading
Loading
Loading
+11 −10
Original line number Original line Diff line number Diff line
@@ -93,8 +93,8 @@ public class RoundedCorners extends SystemUI implements Tunable {
    private void setupPadding(int padding) {
    private void setupPadding(int padding) {
        // Add some padding to all the content near the edge of the screen.
        // Add some padding to all the content near the edge of the screen.
        StatusBar sb = getComponent(StatusBar.class);
        StatusBar sb = getComponent(StatusBar.class);
        View statusBar = sb.getStatusBarWindow();
        View statusBar = (sb != null ? sb.getStatusBarWindow() : null);

        if (statusBar != null) {
            TunablePadding.addTunablePadding(statusBar.findViewById(R.id.keyguard_header), PADDING,
            TunablePadding.addTunablePadding(statusBar.findViewById(R.id.keyguard_header), PADDING,
                    padding, FLAG_END);
                    padding, FLAG_END);


@@ -104,6 +104,7 @@ public class RoundedCorners extends SystemUI implements Tunable {
            fragmentHostManager.addTagListener(QS.TAG,
            fragmentHostManager.addTagListener(QS.TAG,
                    new TunablePaddingTagListener(padding, R.id.header));
                    new TunablePaddingTagListener(padding, R.id.header));
        }
        }
    }


    private WindowManager.LayoutParams getWindowLayoutParams() {
    private WindowManager.LayoutParams getWindowLayoutParams() {
        final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(
        final WindowManager.LayoutParams lp = new WindowManager.LayoutParams(