FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

oboetester: AudioManager isSpeakerPhoneOn is flooding logcat · Issue #2316 · google/oboe · GitHub

Repository navigation

oboetester: AudioManager isSpeakerPhoneOn is flooding logcat #2316

Closed

Description

steps :
Open Oboe
Test Output
Check logs.
AudioManager's isSpeakerPhoneOn is flooding the logs.

It is coming via

protected class CommDeviceSniffer extends NativeSniffer {
    @Override
    public void updateStatusText() {
       showCommDeviceStatus();
    }
}

triggered from here
public void run() {
if (!isComplete()) {
updateStatusText();
}

    // When this is no longer enabled, stop calling run.
    if (mEnabled) {
        mHandler.postDelayed(this, SNIFFER_UPDATE_PERIOD_MSEC);
    }
}

->probably isComplete is not overriden in CommunicationDeviceView to mark sniffing complete.

Can you please check ?

Activity

  1. flamme commented on Oct 1, 2025

    Collaborator

    Robert, could you please take a look? Thanks,

  2. robertwu1 commented on Oct 1, 2025

    Collaborator

    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);
        }
    
  3. quicjaidshar commented on Oct 3, 2025

    Author
    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

  4. flamme commented on Oct 3, 2025

    Collaborator

    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.

  5. quicjaidshar commented on Oct 3, 2025

    Author

    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.

  6. flamme commented on Oct 3, 2025

    Collaborator

    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.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL