Fix a NullPointerException caused by NEW_INSETS_MODE_FULL
InsetsSourceProvider.updateControlForTarget must be called while mWin has the SurfaceControl. Otherwise, mAdapter will be cleared by ControlAdapter.onAnimationCancelled. See SurfaceAnimator.startAnimation. This CL separates DisplayPolicy.prepareAddWindowLw into two parts: 1. Check if we can add a window to the system. 2. Apply policies on certain types of window. We move the second part below mToken.addWindow. So the window has the SurfaceControl while we set insets provider. Bug: 118118435 Test: atest DisplayPolicyInsetsTests DisplayPolicyLayoutTests Test: See if the system can be rebooted after entering the commands: adb root adb setprop persist.wm.new_insets 2 adb reboot Change-Id: I15c9a3ab49dee1c0f7009334adbd6fd1af8e0ba7
Loading
Please register or sign in to comment