AVRCP: Thread-safe mHandler invocation
* Handler object may become null between null check and actual invocation if using an instance private variable. * The solution to this problem without locking is to assign existing handler variable to a local final variable before the null check. * Make sure that handler is not null before invoking the handler. * In AvrcpMessageHandler.handleMessage(), replace mHandler with this. * In doQuit(), replace Loop.quit() with Loop.quitSafely(). Bug: 64566509 Test: Manual, test AVRCP with carkit. Shortly after disconnecting the AVRCP service, try remote control commands. Change-Id: Ib5ac399a30a5cefb17b3977103dea3d60e855cef
Loading
Please register or sign in to comment