Ignore "disconnected" broadcast when voice dial is done

We currently show error message about "disconnected" status
even after voice recognition was successful. This change
ignores the event when appropriate.

Bug: 5386457
Change-Id: Ie11e43c3dfd0cec718a8a2db0d51560b909d864e
diff --git a/src/com/android/voicedialer/VoiceDialerActivity.java b/src/com/android/voicedialer/VoiceDialerActivity.java
index 824934e..78d9c11 100644
--- a/src/com/android/voicedialer/VoiceDialerActivity.java
+++ b/src/com/android/voicedialer/VoiceDialerActivity.java
@@ -474,7 +474,7 @@
                         mHandler.postDelayed(new GreetingRunnable(), FIRST_UTTERANCE_DELAY);
                     }
                 } else if (prevState == BluetoothHeadset.STATE_AUDIO_CONNECTED) {
-                    if (!mWaitingForScoConnection) {
+                    if (!mWaitingForScoConnection && mState != EXITING) {
                         // apparently our connection to the headset has dropped.
                         // we won't be able to continue voicedialing.
                         if (false) Log.d(TAG, "lost sco connection");