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

Commit ded97362 authored by Hansong Zhang's avatar Hansong Zhang
Browse files

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
parent 8abfbc3c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment