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

Commit 3856b4f2 authored by Mark Renouf's avatar Mark Renouf
Browse files

ActivityView: avoid crash in release() when detached from window

Adds an isAttachedToWindow() check to updateLocation() and
cleanTapExcludeRegion() which both require a reference to a Window.

Bug: 112574121
Change-Id: I71f184d74eb88d79effaeb3340ce5362155ed0fb
parent c20de154
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -291,6 +291,9 @@ public class ActivityView extends ViewGroup {

    /** Send current location and size to the WM to set tap exclude region for this view. */
    private void updateLocation() {
        if (!isAttachedToWindow()) {
            return;
        }
        try {
            getLocationInWindow(mLocationInWindow);
            WindowManagerGlobal.getWindowSession().updateTapExcludeRegion(getWindow(), hashCode(),
@@ -429,6 +432,9 @@ public class ActivityView extends ViewGroup {

    /** Report to server that tap exclude region on hosting display should be cleared. */
    private void cleanTapExcludeRegion() {
        if (!isAttachedToWindow()) {
            return;
        }
        // Update tap exclude region with an empty rect to clean the state on server.
        try {
            WindowManagerGlobal.getWindowSession().updateTapExcludeRegion(getWindow(), hashCode(),