Every time the sniffer runs, we update the UI. However, we don't add anything to the logs. mSpeakerStatusView.setText() doesn't log anything to logcat. I don't see logs on my phone. Can you double check and add the logs that you see? Thanks!
private void showCommDeviceStatus() {
boolean enabled = mAudioManager.isSpeakerphoneOn();
String text = ":" + (enabled ? "ON" : "OFF");
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) {
AudioDeviceInfo commDeviceInfo = mAudioManager.getCommunicationDevice();
if (commDeviceInfo != null) {
text += ", #" + commDeviceInfo.getId();
}
}
mSpeakerStatusView.setText(text + ",");
if (mScoState == AudioManager.SCO_AUDIO_STATE_CONNECTING) {
text = ":WAIT";
} else if (mScoState == AudioManager.SCO_AUDIO_STATE_CONNECTED) {
text = ":CON";
} else if (mScoState == AudioManager.SCO_AUDIO_STATE_DISCONNECTED) {
text = ":DISCON";
}
mScoStatusView.setText(text);
}
private void showCommDeviceStatus() {
boolean enabled = mAudioManager.isSpeakerphoneOn(); --->>>>> This line is frequently logging which comes from AudioManager.
Line 2641: 09-14 06:49:53.837 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2698: 09-14 06:49:53.895 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2747: 09-14 06:49:53.911 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2777: 09-14 06:49:54.050 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2793: 09-14 06:49:54.152 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2809: 09-14 06:49:54.254 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2825: 09-14 06:49:54.357 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2864: 09-14 06:49:54.460 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2882: 09-14 06:49:54.561 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2900: 09-14 06:49:54.663 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2918: 09-14 06:49:54.765 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2936: 09-14 06:49:54.868 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2954: 09-14 06:49:54.971 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2975: 09-14 06:49:55.072 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2991: 09-14 06:49:55.177 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3007: 09-14 06:49:55.280 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3023: 09-14 06:49:55.382 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3039: 09-14 06:49:55.492 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3055: 09-14 06:49:55.599 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3071: 09-14 06:49:55.707 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3087: 09-14 06:49:55.815 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
From the AOSP source code, it looks like there is not such a log. Is this from customized log? But I think given the API is deprecated, it is better for oboe to call new API according to the guidance.
Yes, seems it is our custom log, but it catches the problem to frequently call AudioManager API.
Even if we plan to use new API, that should not too frequently call AudioManager.
That is good point. To show the communication device correctly, it is better to call it once and register a callback for the update instead of frequently calling the AudioManager API.
Activity
flamme commented on Oct 1, 2025
Robert, could you please take a look? Thanks,
robertwu1 commented on Oct 1, 2025
Every time the sniffer runs, we update the UI. However, we don't add anything to the logs. mSpeakerStatusView.setText() doesn't log anything to logcat. I don't see logs on my phone. Can you double check and add the logs that you see? Thanks!
private void showCommDeviceStatus() { boolean enabled = mAudioManager.isSpeakerphoneOn(); String text = ":" + (enabled ? "ON" : "OFF"); if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.S) { AudioDeviceInfo commDeviceInfo = mAudioManager.getCommunicationDevice(); if (commDeviceInfo != null) { text += ", #" + commDeviceInfo.getId(); } } mSpeakerStatusView.setText(text + ","); if (mScoState == AudioManager.SCO_AUDIO_STATE_CONNECTING) { text = ":WAIT"; } else if (mScoState == AudioManager.SCO_AUDIO_STATE_CONNECTED) { text = ":CON"; } else if (mScoState == AudioManager.SCO_AUDIO_STATE_DISCONNECTED) { text = ":DISCON"; } mScoStatusView.setText(text); }quicjaidshar commented on Oct 3, 2025
private void showCommDeviceStatus() { boolean enabled = mAudioManager.isSpeakerphoneOn(); --->>>>> This line is frequently logging which comes from AudioManager.logs_20251003_085101.log
Line 2641: 09-14 06:49:53.837 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2698: 09-14 06:49:53.895 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2747: 09-14 06:49:53.911 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2777: 09-14 06:49:54.050 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2793: 09-14 06:49:54.152 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2809: 09-14 06:49:54.254 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2825: 09-14 06:49:54.357 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2864: 09-14 06:49:54.460 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2882: 09-14 06:49:54.561 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2900: 09-14 06:49:54.663 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2918: 09-14 06:49:54.765 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2936: 09-14 06:49:54.868 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2954: 09-14 06:49:54.971 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2975: 09-14 06:49:55.072 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 2991: 09-14 06:49:55.177 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3007: 09-14 06:49:55.280 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3023: 09-14 06:49:55.382 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3039: 09-14 06:49:55.492 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3055: 09-14 06:49:55.599 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3071: 09-14 06:49:55.707 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
Line 3087: 09-14 06:49:55.815 7516 7516 I AudioManager: In isSpeakerphoneOn(), calling application: com.mobileer.oboetester
flamme commented on Oct 3, 2025
From the AOSP source code, it looks like there is not such a log. Is this from customized log? But I think given the API is deprecated, it is better for oboe to call new API according to the guidance.
quicjaidshar commented on Oct 3, 2025
Yes, seems it is our custom log, but it catches the problem to frequently call AudioManager API.
Even if we plan to use new API, that should not too frequently call AudioManager.
flamme commented on Oct 3, 2025
That is good point. To show the communication device correctly, it is better to call it once and register a callback for the update instead of frequently calling the AudioManager API.