OSDN Git Service

Fixing A2dpSinkStreamingStateMachine thread leak.
authorRam Periathiruvadi <ramperry@google.com>
Fri, 14 Oct 2016 19:50:45 +0000 (12:50 -0700)
committerSanket Agarwal <sanketa@google.com>
Wed, 2 Nov 2016 04:41:27 +0000 (21:41 -0700)
commitf00c68aeda2ec97a4382677754a1eab4429a235d
treefd41f27a7eab70e267b91251384c7d98e14c0131
parent609f94bb870727471a8c571ede2aa8cbbaf70f76
Fixing A2dpSinkStreamingStateMachine thread leak.

A2dpSinkStreamingStateMachine was being created on every Connection
leading to a leak. Fix is to Quit the A2dpSinkStreamingStateMachine
on A2dpSinkStateMachine's Quit() and create a new Streaming
StateMachine only if it is null.
Note that both the Sink and SinkStreaming State machines quit only
on Adapter off, not on BT disconnect.

Bug: b/32097580
Tested: On Mojave and Angler with bat_mas-userdebug

Change-Id: I7f2e3ac01ce5ff965afe407e3605cac00497af36
(cherry picked from commit af41a720081dd4e9d12e1b3f082e9202ae84252d)
src/com/android/bluetooth/a2dpsink/A2dpSinkStateMachine.java
src/com/android/bluetooth/a2dpsink/A2dpSinkStreamingStateMachine.java