Skip to content

Conversation

@robertwu1
Copy link
Collaborator

Fixes #2316

@robertwu1 robertwu1 requested a review from flamme October 3, 2025 17:56
showCommDeviceStatus();
}
}
private AudioManager.OnCommunicationDeviceChangedListener mCommDeviceListener;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't mCommDeviceListener sufficient to get device callbacks ? Why do we explicitly need speakerphone? Is there any scenario where we need speaker change callbacks which are not sent as part of mCommunicationDeviceChangedListener ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you're right. Explicitly setting the speakerphone on is strongly discouraged. I can clean this up as a follow-up PR

};

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
mCommDeviceListener = (deviceInfo) -> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If communication device listener is used, it looks there is no need to get speaker phone state receiver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oboetester: AudioManager isSpeakerPhoneOn is flooding logcat

3 participants