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

Commit 5d425594 authored by Riddle Hsu's avatar Riddle Hsu Committed by Android (Google) Code Review
Browse files

Merge "Remove host activity association when removing EmbeddedWindow" into udc-qpr-dev

parents 95404508 352aa3d1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -4375,7 +4375,6 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
        // Reset the last saved PiP snap fraction on removal.
        mDisplayContent.mPinnedTaskController.onActivityHidden(mActivityComponent);
        mDisplayContent.onRunningActivityChanged();
        mWmService.mEmbeddedWindowController.onActivityRemoved(this);
        mRemovingFromDisplay = false;
    }

+7 −13
Original line number Diff line number Diff line
@@ -135,19 +135,6 @@ class EmbeddedWindowController {
        return mWindowsByWindowToken.get(windowToken);
    }

    void onActivityRemoved(ActivityRecord activityRecord) {
        for (int i = mWindows.size() - 1; i >= 0; i--) {
            final EmbeddedWindow window = mWindows.valueAt(i);
            if (window.mHostActivityRecord == activityRecord) {
                final WindowProcessController processController =
                        mAtmService.getProcessController(window.mOwnerPid, window.mOwnerUid);
                if (processController != null) {
                    processController.removeHostActivity(activityRecord);
                }
            }
        }
    }

    static class EmbeddedWindow implements InputTarget {
        final IWindow mClient;
        @Nullable final WindowState mHostWindowState;
@@ -230,6 +217,13 @@ class EmbeddedWindowController {
                mInputChannel.dispose();
                mInputChannel = null;
            }
            if (mHostActivityRecord != null) {
                final WindowProcessController wpc =
                        mWmService.mAtmService.getProcessController(mOwnerPid, mOwnerUid);
                if (wpc != null) {
                    wpc.removeHostActivity(mHostActivityRecord);
                }
            }
        }

        @Override