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

Commit 4b1e2d8d authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

Fix an exception in PackageInstaller

It is apparently possible for an activity to get
a configuration change callback when its view is
no longer attached to the window manager. Check
if a view is attached before removing it from the
window manager.

bug:30389560

Change-Id: I384401742eca61d140c7590eb5c67150a15da83b
parent 8c4f0ff9
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -196,12 +196,14 @@ public class GrantPermissionsActivity extends OverlayTouchActivity
        // window height needed to show all content. We have to
        // re-add the window to force it to be resized if needed.
        View decor = getWindow().getDecorView();
        if (decor.getParent() != null) {
            getWindowManager().removeViewImmediate(decor);
            getWindowManager().addView(decor, decor.getLayoutParams());
            if (mViewHandler instanceof GrantPermissionsViewHandlerImpl) {
                ((GrantPermissionsViewHandlerImpl) mViewHandler).onConfigurationChanged();
            }
        }
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {