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

Fix race condition while WallpaperMS rebinding service.

Connection object could not receive onServiceConnected after
new process of the service was active.

How issue happen:
1. The process of wallpaper service died, AM schedule to restart,
WallpaperMS schedule to rebind.
2. WallpaperMS bind service with new connection object.
=> ActiveService bring up new process. Add this ServiceRecord to
   mPendingServices.
3. WallpaperMS unbind previous connection object.
=> ActiveService remove previous connection, also remove this
   ServiceRecord object from mPendingServices list.
4. Process ready, attach application but cannot find the service
   from pendingServices.

Solution: Do not remove the ServiceRecord object from mPendingServices
if there is any connection left.

Also use runnable object instead of method reference.

Bug: 147964645
Bug: 149625847
Test: atest WallpaperManagerTest WallpaperManagerServiceTests
Change-Id: I3adec66de8ac0c7efc9ad3ffbf604b01eacb5720
parent a67e14a6
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