Close the decoration before removing it from the cache
This is a speculative fix for a NullPointerException triggered in DesktopModeTouchEventListener#onTouch where obtaining a decoration returns null unexpectedly. A task closing while the caption window still has a touch target ends up dispatching one final MotionEvent (cancel) to the caption window touch listener, who expects a non-null decoration to be found in the decoration cache. This dispatching is triggered by WindowDecoration#close, which is called by #destroyWindowDecoration. However, right before #close is called, the decoration was cleaned up from the decoration cache, guaranteeing a NPE when the motion event is handled. This change moves the clean up until after WindowDecoration#close is called, to allow the touch handler to still have a valid reference to the closing decoration when it receives the final motion event. Fix: 327664694 Fix: 323347594 Test: m Change-Id: I1a0e8370453f59d81735f024093579a0fbe3324c
Loading
Please register or sign in to comment