Fix for the race in Wallpaperservice
Wallpaperservice has a race among message handler of DO_DETACH and service's onDestroy. In certain cases, the engine kept track in mActiveEngies is removed by message handler of DO_DETACH and service's onDestroy doesn't get an entry in mActiveEngines and isn't able to invoke detach on it. This keeps the broadcast receiver mReceiver active and causes the framework to report a leak and unregister the receiver. Meanwhile, the message handler of DO_DETACH continues and invokes detach on the mEngine, which tries to unregister the receiver, mReceiver and framework throws an exception "Receiver not registered" and causes the framework to reboot. In case of system_server, WindowManagerPolicy and android.server.ServerThread contest for access of shared members. Fix is to protect the critical section with a synchronized block. Change-Id: I506b9453aecb0a121c2029443ae9c175d7c12af6
Loading
Please register or sign in to comment