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

Commit 1d609f67 authored by Dave Mankoff's avatar Dave Mankoff
Browse files

Add null check to HeadsUpPhoneManager.updateRegionForNotch.

I can't reproduce the issue in the bug, but we can log a warning
and move on with code execution when it happens.

Bug: 142532983
Test: manual
Change-Id: I2894eaedc6972b71d0b8a81fc763b8f840567b24
parent 1de686f1
Loading
Loading
Loading
Loading
+7 −1
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@ import android.view.DisplayCutout;
import android.view.Gravity;
import android.view.Gravity;
import android.view.View;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.ViewTreeObserver;
import android.view.WindowInsets;


import androidx.collection.ArraySet;
import androidx.collection.ArraySet;


@@ -390,7 +391,12 @@ public class HeadsUpManagerPhone extends HeadsUpManager implements Dumpable,
    }
    }


    private void updateRegionForNotch(Region region) {
    private void updateRegionForNotch(Region region) {
        DisplayCutout cutout = mStatusBarWindowView.getRootWindowInsets().getDisplayCutout();
        WindowInsets windowInsets = mStatusBarWindowView.getRootWindowInsets();
        if (windowInsets == null) {
            Log.w(TAG, "StatusBarWindowView is not attached.");
            return;
        }
        DisplayCutout cutout = windowInsets.getDisplayCutout();
        if (cutout == null) {
        if (cutout == null) {
            return;
            return;
        }
        }