OSDN Git Service

Resolved HSP PTS issues. When call is active, and CKPD is received: 1. If audio is...
authorRavi Nagarajan <nravi@broadcom.com>
Wed, 28 Mar 2012 13:41:30 +0000 (19:11 +0530)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 17 Jul 2012 04:52:23 +0000 (21:52 -0700)
Change-Id: Ib60f7109f9fe982523c3db68ea6014c25bad8262

src/com/android/bluetooth/hfp/HeadsetStateMachine.java

index 2176bef..82c6ad6 100755 (executable)
@@ -1311,14 +1311,21 @@ final class HeadsetStateMachine extends StateMachine {
                 Log.e(TAG, "Handsfree phone proxy null for answering call");
             }
         } else if (mPhoneState.getNumActiveCall() > 0) {
-            if (mPhoneProxy != null) {
-                try {
-                    mPhoneProxy.answerCall();
-                } catch (RemoteException e) {
-                    Log.e(TAG, Log.getStackTraceString(new Throwable()));
+            if (!isAudioOn())
+            {
+                connectAudioNative(getByteAddress(mCurrentDevice));
+            }
+            else
+            {
+                if (mPhoneProxy != null) {
+                    try {
+                        mPhoneProxy.hangupCall();
+                    } catch (RemoteException e) {
+                        Log.e(TAG, Log.getStackTraceString(new Throwable()));
+                    }
+                } else {
+                    Log.e(TAG, "Handsfree phone proxy null for hangup call");
                 }
-            } else {
-                Log.e(TAG, "Handsfree phone proxy null for hangup call");
             }
         } else {
             String dialNumber = mPhonebook.getLastDialledNumber();