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

Skip to content
Commit e180de6b authored by Fengjiang Li's avatar Fengjiang Li
Browse files

Fix memory leak of Launcher activityfrom QuickstepTransitionManager and...

Fix memory leak of Launcher activityfrom QuickstepTransitionManager and LauncherBackAnimationController

We should also avoid using non-static inner class that extends IOnBackInvokedCallback.Stub and IRemoteAnimationRunner.Stub inside LauncherBackAnimationController, which references the entire LauncherBackAnimationController object.

1. When launcher is created, a Runnable is posted to ShellExecutor to call BackAnimationController#registerAnimation
2. When launcher is later destroyed, another Runnable is posted to same ShellExecturo to call BackAnimationController#unregisterAnimation
3. If the execturo queued the 1st runnable, then we have leaked LauncherBackAnimationController object, including Launcher activity.

This CL fixes the leak by making the Stub static inner classes, and use weak reference hold reference to launcher activity.

Bug: 297806573
Test: Grab a heap dump and this reference no longer exist
Flag: N/A
Change-Id: I78853e900a98399b02682ba2d9179e544a4030d5
parent b0b8e3a5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment