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

Commit e13b3f8b authored by Jack He's avatar Jack He
Browse files

[HFP] Do not call AudioManager API during dumpsys

* This prevents the Bluetooth App from going ANR during dumpsys

Bug: 195365723
Test: make, atest BluetoothInstrumentationTests
Tag: #stability
Change-Id: I1c502ff58df0288c71b654cbdf52b051215cb9b1
(cherry picked from commit 48d50f5b2d0e9757c773eeda09c4e4818f0d3ed5)
parent 010e15d3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -1911,6 +1911,7 @@ public class HeadsetService extends ProfileService {

    @Override
    public void dump(StringBuilder sb) {
        boolean isScoOn = mSystemInterface.getAudioManager().isBluetoothScoOn();
        synchronized (mStateMachines) {
            super.dump(sb);
            ProfileService.println(sb, "mMaxHeadsetConnections: " + mMaxHeadsetConnections);
@@ -1931,9 +1932,7 @@ public class HeadsetService extends ProfileService {
            ProfileService.println(sb, "mForceScoAudio: " + mForceScoAudio);
            ProfileService.println(sb, "mCreated: " + mCreated);
            ProfileService.println(sb, "mStarted: " + mStarted);
            ProfileService.println(sb,
                    "AudioManager.isBluetoothScoOn(): " + mSystemInterface.getAudioManager()
                            .isBluetoothScoOn());
            ProfileService.println(sb, "AudioManager.isBluetoothScoOn(): " + isScoOn);
            ProfileService.println(sb, "Telecom.isInCall(): " + mSystemInterface.isInCall());
            ProfileService.println(sb, "Telecom.isRinging(): " + mSystemInterface.isRinging());
            for (HeadsetStateMachine stateMachine : mStateMachines.values()) {