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

Commit 2f5eb05b authored by Hui Wang's avatar Hui Wang
Browse files

Do not add SPEAKER_ON message if the route has been on the speaker

If the audio route has been already on the speaker, the SPEAKER_ON
message should not be added. This typically occurs when the active
state changes. The fix allows the route to exit faster, and avoids
an unexpected message when a speaker off event occurs during the
pending state.

Flag: EXEMPT bugfix
Bug:392012245
Test: manual
Change-Id: I3f84e0f2588eda0f5825c4382749763c967d3009
parent 48e91612
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -284,7 +284,8 @@ public class AudioRoute {
                    }
                    }
                    return;
                    return;
                }
                }
            } else if (mAudioRouteType == TYPE_SPEAKER) {
            } else if (mAudioRouteType == TYPE_SPEAKER && !this.equals(
                    pendingAudioRoute.getOrigRoute())) {
                pendingAudioRoute.addMessage(SPEAKER_ON, null);
                pendingAudioRoute.addMessage(SPEAKER_ON, null);
            }
            }