summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSharvil Nanavati <sharvil@google.com>2015-09-27 00:23:26 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-27 00:23:26 +0000
commit4310d1390353ed872cc7be1923fd55222864a4d4 (patch)
tree6e362f119d70d8c6b71ae3661265be17a0b54dac
parent9172aff89362b06e6d5ad7c28647b135212abbe2 (diff)
parent7618faa5df18324c581ade91f75454e2e3d8ad49 (diff)
downloadandroid_packages_apps_Bluetooth-4310d1390353ed872cc7be1923fd55222864a4d4.tar.gz
android_packages_apps_Bluetooth-4310d1390353ed872cc7be1923fd55222864a4d4.tar.bz2
android_packages_apps_Bluetooth-4310d1390353ed872cc7be1923fd55222864a4d4.zip
am 7618faa5: Avoid NPE when dumping headset profile state.
* commit '7618faa5df18324c581ade91f75454e2e3d8ad49': Avoid NPE when dumping headset profile state.
-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);
+ }
}
}