Avoid leaking Activity from OnBackInvokedCallback.
- Remove mTopCallback field - Cleanup compat and default callbacks - Remove the callback held by WindowState when the window is removed. Bug: 218328707 Test: atest packages/apps/Launcher3/tests/src/com/android/launcher3/ui/TaplTestsLauncher3.java Test: atest frameworks/base/core/tests/coretests/src/android/window/WindowOnBackInvokedDispatcherTest.java Change-Id: I38fd760a617500c874aef10bc8de165880837008
This commit is contained in:
@@ -10838,6 +10838,7 @@ public final class ViewRootImpl implements ViewParent,
|
||||
private void unregisterCompatOnBackInvokedCallback() {
|
||||
if (mCompatOnBackInvokedCallback != null) {
|
||||
mOnBackInvokedDispatcher.unregisterOnBackInvokedCallback(mCompatOnBackInvokedCallback);
|
||||
mCompatOnBackInvokedCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user