Loading android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerStateMachine.java +4 −2 Original line number Diff line number Diff line Loading @@ -947,8 +947,10 @@ class AvrcpControllerStateMachine extends StateMachine { public void enter() { disconnectCoverArt(); onBrowsingDisconnected(); if (mService.sBrowseTree != null) { mService.sBrowseTree.mRootNode.removeChild(mBrowseTree.mRootNode); BluetoothMediaBrowserService.notifyChanged(mService.sBrowseTree.mRootNode); } broadcastConnectionStateChanged(BluetoothProfile.STATE_DISCONNECTING); transitionTo(mDisconnected); } Loading android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerStateMachineTest.java +18 −1 Original line number Diff line number Diff line Loading @@ -318,12 +318,29 @@ public class AvrcpControllerStateMachineTest { /** * Test to confirm that the state machine is capable of cycling through the 4 * connection states, and that upon completion, it cleans up aftwards. * connection states, and that upon completion, it cleans up afterwards. */ @Test public void testDisconnect() { int numBroadcastsSent = setUpConnectedState(true, true); testDisconnectInternal(numBroadcastsSent); } /** * Test to confirm that the state machine is capable of cycling through the 4 * connection states with no crashes, even if the {@link AvrcpControllerService} is stopped and * the {@code sBrowseTree} is null. This could happen if BT is disabled as the profile is being * disconnected. */ @Test public void testDisconnectWithNullBrowseTree() { int numBroadcastsSent = setUpConnectedState(true, true); mAvrcpControllerService.stop(); testDisconnectInternal(numBroadcastsSent); } private void testDisconnectInternal(int numBroadcastsSent) { mAvrcpStateMachine.disconnect(); numBroadcastsSent += 2; verify(mAvrcpControllerService, Loading Loading
android/app/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerStateMachine.java +4 −2 Original line number Diff line number Diff line Loading @@ -947,8 +947,10 @@ class AvrcpControllerStateMachine extends StateMachine { public void enter() { disconnectCoverArt(); onBrowsingDisconnected(); if (mService.sBrowseTree != null) { mService.sBrowseTree.mRootNode.removeChild(mBrowseTree.mRootNode); BluetoothMediaBrowserService.notifyChanged(mService.sBrowseTree.mRootNode); } broadcastConnectionStateChanged(BluetoothProfile.STATE_DISCONNECTING); transitionTo(mDisconnected); } Loading
android/app/tests/unit/src/com/android/bluetooth/avrcpcontroller/AvrcpControllerStateMachineTest.java +18 −1 Original line number Diff line number Diff line Loading @@ -318,12 +318,29 @@ public class AvrcpControllerStateMachineTest { /** * Test to confirm that the state machine is capable of cycling through the 4 * connection states, and that upon completion, it cleans up aftwards. * connection states, and that upon completion, it cleans up afterwards. */ @Test public void testDisconnect() { int numBroadcastsSent = setUpConnectedState(true, true); testDisconnectInternal(numBroadcastsSent); } /** * Test to confirm that the state machine is capable of cycling through the 4 * connection states with no crashes, even if the {@link AvrcpControllerService} is stopped and * the {@code sBrowseTree} is null. This could happen if BT is disabled as the profile is being * disconnected. */ @Test public void testDisconnectWithNullBrowseTree() { int numBroadcastsSent = setUpConnectedState(true, true); mAvrcpControllerService.stop(); testDisconnectInternal(numBroadcastsSent); } private void testDisconnectInternal(int numBroadcastsSent) { mAvrcpStateMachine.disconnect(); numBroadcastsSent += 2; verify(mAvrcpControllerService, Loading