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

This commit is contained in:
Riddle Hsu
2023-08-21 13:47:17 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 14 deletions

View File

@@ -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;
}

View File

@@ -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