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

Commit ccf95f24 authored by Tiger's avatar Tiger
Browse files

Prevent NullPointerException and remove unsed variable

Bug: 234093736
Test: presubmit
Change-Id: Id4298f3af970cba0608960bcac21c141bb2d99aa
parent b9f60293
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -69,7 +69,6 @@ public class SurfaceControlViewHostInsetsTest {


    private InsetsState statusBarState(boolean visible) {
    private InsetsState statusBarState(boolean visible) {
        final InsetsState insetsState = new InsetsState();
        final InsetsState insetsState = new InsetsState();
        final int id = InsetsSource.createId(null /* owner */, 0 /* index */, statusBars());
        insetsState.setDisplayFrame(new Rect(0, 0, 1000, 1000));
        insetsState.setDisplayFrame(new Rect(0, 0, 1000, 1000));
        insetsState.getOrCreateSource(
        insetsState.getOrCreateSource(
                InsetsSource.createId(null /* owner */, 0 /* index */, statusBars()), statusBars())
                InsetsSource.createId(null /* owner */, 0 /* index */, statusBars()), statusBars())
+6 −0
Original line number Original line Diff line number Diff line
@@ -635,6 +635,12 @@ class InsetsPolicy {
        final SparseArray<InsetsSourceControl> controlsReady = new SparseArray<>();
        final SparseArray<InsetsSourceControl> controlsReady = new SparseArray<>();
        final InsetsSourceControl[] controls =
        final InsetsSourceControl[] controls =
                mStateController.getControlsForDispatch(mDummyControlTarget);
                mStateController.getControlsForDispatch(mDummyControlTarget);
        if (controls == null) {
            if (callback != null) {
                DisplayThread.getHandler().post(callback);
            }
            return;
        }
        for (InsetsSourceControl control : controls) {
        for (InsetsSourceControl control : controls) {
            if (isTransient(control.getType()) && control.getLeash() != null) {
            if (isTransient(control.getType()) && control.getLeash() != null) {
                typesReady |= control.getType();
                typesReady |= control.getType();