summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpenghua <quic_penghua@quicinc.com>2022-03-29 13:09:45 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2022-03-28 22:27:53 -0700
commitb60c8d7d051455b744decbcb7d227eed57809bdc (patch)
tree5d0d9f4acee0fa771b46552e54f14f1f5ffa1dea
parentb8edda3eb538b0c21bff3e4a6372aba22dfa4b78 (diff)
Do not call AudioManager API during dumpsys
This prevents the Bluetooth App from going ANR during dumpsys Change-Id: Ia0078cc256895dab22c686a64b3a420179306d95 CRs-Fixed: 3153249
-rw-r--r--src/com/android/bluetooth/hfp/HeadsetService.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/bluetooth/hfp/HeadsetService.java b/src/com/android/bluetooth/hfp/HeadsetService.java
index 621c11562..07cc888a8 100644
--- a/src/com/android/bluetooth/hfp/HeadsetService.java
+++ b/src/com/android/bluetooth/hfp/HeadsetService.java
@@ -2954,6 +2954,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);
@@ -2974,9 +2975,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()) {