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

Commit 0da7935b authored by Tiger Huang's avatar Tiger Huang Committed by Android (Google) Code Review
Browse files

Merge "Fix IMC NPE for try to access view without attach window" into main

parents 748514ea e3c35f37
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -485,9 +485,8 @@ public class ImmersiveModeConfirmation implements CoreStartable, CommandQueue.Ca
            final boolean intersectsTopCutout = topDisplayCutout.intersects(
                    width - (windowWidth / 2), 0,
                    width + (windowWidth / 2), topDisplayCutout.bottom);
            if (mClingWindow != null &&
                    (windowWidth < 0 || (width > 0 && intersectsTopCutout))) {
                final View iconView = mClingWindow.findViewById(R.id.immersive_cling_icon);
            if (windowWidth < 0 || (width > 0 && intersectsTopCutout)) {
                final View iconView = findViewById(R.id.immersive_cling_icon);
                RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams)
                        iconView.getLayoutParams();
                lp.topMargin = topDisplayCutout.bottom;
+2 −3
Original line number Diff line number Diff line
@@ -408,9 +408,8 @@ public class ImmersiveModeConfirmation {
            final boolean intersectsTopCutout = topDisplayCutout.intersects(
                    width - (windowWidth / 2), 0,
                    width + (windowWidth / 2), topDisplayCutout.bottom);
            if (mClingWindow != null &&
                    (windowWidth < 0 || (width > 0 && intersectsTopCutout))) {
                final View iconView = mClingWindow.findViewById(R.id.immersive_cling_icon);
            if (windowWidth < 0 || (width > 0 && intersectsTopCutout)) {
                final View iconView = findViewById(R.id.immersive_cling_icon);
                RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams)
                        iconView.getLayoutParams();
                lp.topMargin = topDisplayCutout.bottom;