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

Commit d043bb1c authored by Joseph Pirozzo's avatar Joseph Pirozzo Committed by android-build-merger
Browse files

Merge changes I547a33fc,I834fce6a

am: b560d9ae

Change-Id: Ibc480780660700661fb1f84561a552972012596c
parents 0c87552d b560d9ae
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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) {
@@ -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:
@@ -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()) {
@@ -156,6 +156,7 @@ public class A2dpSinkStreamHandler extends Handler {
                break;

            case SRC_PAUSE:
                mStreamAvailable = false;
                // Remote pause command, stop avrcp updates.
                break;

@@ -202,6 +203,7 @@ public class A2dpSinkStreamHandler extends Handler {
                        if (mStreamAvailable) {
                            sendAvrcpPause();
                            mSentPause = true;
                            mStreamAvailable = false;
                        }
                        stopFluorideStreaming();
                        break;
+1 −1
Original line number Diff line number Diff line
@@ -929,7 +929,7 @@ public class HeadsetClientService extends ProfileService {
        mSmFactory = factory;
    }

    AudioManager getAudioManager() {
    protected AudioManager getAudioManager() {
        return mAudioManager;
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -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);