Loading src/com/android/bluetooth/a2dpsink/A2dpSinkStreamHandler.java +4 −2 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ public class A2dpSinkStreamHandler extends Handler { } switch (message.what) { case SRC_STR_START: mStreamAvailable = true; // Always request audio focus if on TV. if (isTvDevice()) { if (mAudioFocus == AudioManager.AUDIOFOCUS_NONE) { Loading @@ -126,7 +125,6 @@ public class A2dpSinkStreamHandler extends Handler { case SRC_STR_STOP: // Audio stream has stopped, maintain focus but stop avrcp updates. mStreamAvailable = false; break; case SNK_PLAY: Loading @@ -137,10 +135,12 @@ public class A2dpSinkStreamHandler extends Handler { break; case SNK_PAUSE: mStreamAvailable = false; // Local pause command, maintain focus but stop avrcp updates. break; case SRC_PLAY: mStreamAvailable = true; // Remote play command. // If is an iot device gain focus and start avrcp updates. if (isIotDevice() || isTvDevice()) { Loading @@ -156,6 +156,7 @@ public class A2dpSinkStreamHandler extends Handler { break; case SRC_PAUSE: mStreamAvailable = false; // Remote pause command, stop avrcp updates. break; Loading Loading @@ -202,6 +203,7 @@ public class A2dpSinkStreamHandler extends Handler { if (mStreamAvailable) { sendAvrcpPause(); mSentPause = true; mStreamAvailable = false; } stopFluorideStreaming(); break; Loading src/com/android/bluetooth/hfpclient/HeadsetClientService.java +1 −1 Original line number Diff line number Diff line Loading @@ -929,7 +929,7 @@ public class HeadsetClientService extends ProfileService { mSmFactory = factory; } AudioManager getAudioManager() { protected AudioManager getAudioManager() { return mAudioManager; } } tests/unit/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachineTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class HeadsetClientStateMachineTest { when(mAudioManager.getStreamVolume(anyInt())).thenReturn(2); when(mAudioManager.getStreamMaxVolume(anyInt())).thenReturn(10); when(mAudioManager.getStreamMinVolume(anyInt())).thenReturn(1); when(mHeadsetClientService.getSystemService(Context.AUDIO_SERVICE)).thenReturn( when(mHeadsetClientService.getAudioManager()).thenReturn( mAudioManager); when(mHeadsetClientService.getResources()).thenReturn(mMockHfpResources); when(mMockHfpResources.getBoolean(R.bool.hfp_clcc_poll_during_call)).thenReturn(true); Loading Loading
src/com/android/bluetooth/a2dpsink/A2dpSinkStreamHandler.java +4 −2 Original line number Diff line number Diff line Loading @@ -111,7 +111,6 @@ public class A2dpSinkStreamHandler extends Handler { } switch (message.what) { case SRC_STR_START: mStreamAvailable = true; // Always request audio focus if on TV. if (isTvDevice()) { if (mAudioFocus == AudioManager.AUDIOFOCUS_NONE) { Loading @@ -126,7 +125,6 @@ public class A2dpSinkStreamHandler extends Handler { case SRC_STR_STOP: // Audio stream has stopped, maintain focus but stop avrcp updates. mStreamAvailable = false; break; case SNK_PLAY: Loading @@ -137,10 +135,12 @@ public class A2dpSinkStreamHandler extends Handler { break; case SNK_PAUSE: mStreamAvailable = false; // Local pause command, maintain focus but stop avrcp updates. break; case SRC_PLAY: mStreamAvailable = true; // Remote play command. // If is an iot device gain focus and start avrcp updates. if (isIotDevice() || isTvDevice()) { Loading @@ -156,6 +156,7 @@ public class A2dpSinkStreamHandler extends Handler { break; case SRC_PAUSE: mStreamAvailable = false; // Remote pause command, stop avrcp updates. break; Loading Loading @@ -202,6 +203,7 @@ public class A2dpSinkStreamHandler extends Handler { if (mStreamAvailable) { sendAvrcpPause(); mSentPause = true; mStreamAvailable = false; } stopFluorideStreaming(); break; Loading
src/com/android/bluetooth/hfpclient/HeadsetClientService.java +1 −1 Original line number Diff line number Diff line Loading @@ -929,7 +929,7 @@ public class HeadsetClientService extends ProfileService { mSmFactory = factory; } AudioManager getAudioManager() { protected AudioManager getAudioManager() { return mAudioManager; } }
tests/unit/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachineTest.java +1 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,7 @@ public class HeadsetClientStateMachineTest { when(mAudioManager.getStreamVolume(anyInt())).thenReturn(2); when(mAudioManager.getStreamMaxVolume(anyInt())).thenReturn(10); when(mAudioManager.getStreamMinVolume(anyInt())).thenReturn(1); when(mHeadsetClientService.getSystemService(Context.AUDIO_SERVICE)).thenReturn( when(mHeadsetClientService.getAudioManager()).thenReturn( mAudioManager); when(mHeadsetClientService.getResources()).thenReturn(mMockHfpResources); when(mMockHfpResources.getBoolean(R.bool.hfp_clcc_poll_during_call)).thenReturn(true); Loading