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

Commit 4f999047 authored by Robert Horvath's avatar Robert Horvath
Browse files

Fix re-registering PositionUpdateListener

Nulls out `info.mPositionUpdateListener` after unregistering the
Listener, allowing a new PositionUpdateListener to be registered later.

`addPositionUpdateListener` was only called if
`info.mPositionUpdateListener` is non-null.
The Listener is first created and registered if the system needs to keep
track of the View's bounds (eg. if it is marked as a keep clear area).
If the system no longer needs to keep track of the View's bounds, the
Listener is unregistered, but wasn't set to `null`.
When the system later needs to receive updates about the View's bounds
again, the listener failed to be re-registered because it was non-null.

Bug: 226583836
Test: Manual, check position updates of View
Change-Id: Ia494e84843a9954e368d76a000f5f725e3a58df1
parent 9cbaca73
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11752,6 +11752,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
                && (info.mHandwritingArea == null || !isAutoHandwritingEnabled())) {
            if (info.mPositionUpdateListener != null) {
                mRenderNode.removePositionUpdateListener(info.mPositionUpdateListener);
                info.mPositionUpdateListener = null;
                info.mPositionChangedUpdate = null;
            }
        } else {