summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSharvil Nanavati <sharvil@google.com>2015-09-26 16:22:21 -0700
committerSharvil Nanavati <sharvil@google.com>2015-09-26 16:22:21 -0700
commit7618faa5df18324c581ade91f75454e2e3d8ad49 (patch)
tree44be533a546daffed4368009dca9aa2b2fdc3d59
parent3b46d46c6244f6cefe2e0c3ec8460717c2560dd5 (diff)
downloadandroid_packages_apps_Bluetooth-7618faa5df18324c581ade91f75454e2e3d8ad49.tar.gz
android_packages_apps_Bluetooth-7618faa5df18324c581ade91f75454e2e3d8ad49.tar.bz2
android_packages_apps_Bluetooth-7618faa5df18324c581ade91f75454e2e3d8ad49.zip
Avoid NPE when dumping headset profile state.
Change-Id: I91767bcc09d4e16a9bd5c8dbe2e662a96f9880a5
-rw-r--r--src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
index de731a61d..f9cadabe9 100644
--- a/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
+++ b/src/com/android/bluetooth/hfpclient/HeadsetClientStateMachine.java
@@ -175,13 +175,19 @@ final class HeadsetClientStateMachine extends StateMachine {
ProfileService.println(sb, "mSubscriberInfo: " + mSubscriberInfo);
ProfileService.println(sb, "mVoiceRecognitionActive: " + mVoiceRecognitionActive);
ProfileService.println(sb, "mInBandRingtone: " + mInBandRingtone);
+
ProfileService.println(sb, "mCalls:");
- for (BluetoothHeadsetClientCall call : mCalls.values()) {
- ProfileService.println(sb, " " + call);
+ if (mCalls != null) {
+ for (BluetoothHeadsetClientCall call : mCalls.values()) {
+ ProfileService.println(sb, " " + call);
+ }
}
+
ProfileService.println(sb, "mCallsUpdate:");
- for (BluetoothHeadsetClientCall call : mCallsUpdate.values()) {
- ProfileService.println(sb, " " + call);
+ if (mCallsUpdate != null) {
+ for (BluetoothHeadsetClientCall call : mCallsUpdate.values()) {
+ ProfileService.println(sb, " " + call);
+ }
}
}