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

Skip to content
Commit b72ff9c6 authored by wilsonshih's avatar wilsonshih
Browse files

Fix WallpaperEngine object leaked during stress test.

The wallpaper engine object may not have released due to someone continuously
change wallpaper with the same component, such as image wallpaper.
In this case, server side may receive attached engine to a connection, however,
it could already detached.

Example sequence:
bind wallpaper (A) connection (C1)
  detachWallpaperLocked(lastwallpaper)
  lastwallpaper = A + C1
bind wallpaper (A) connection (C2)
  detachWallpaperLocked(lastwallpaper = A + C1)
  last = A + C2
  attachEngine to C1
Then the connection C1 will never be released because it was be detached.

We can fix this by notify that WallpaperService is detached.
When it was detached, it shall destroy its engine if there is, and doesn't attach
back to WallpaperManagerService anymore.

Bug: 128974839
Test: run atest WallpaperManagerTest, then dump
adb shell dumpsys activity service com.android.systemui/com.android.systemui.ImageWallpaper
to make sure there is only one WallpaperEngine object.

Change-Id: Ifea201fe8860af11376717d344fee77182b38e54
parent a50d69cc
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