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

Skip to content
Commit aa6eda44 authored by Jorge Gil's avatar Jorge Gil
Browse files

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
parent cb5c34af
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment