OSDN Git Service

ATD commands have a trailing ';'. Remove the trailing ';' prior to dialing a call...
authorRavi Nagarajan <nravi@broadcom.com>
Fri, 30 Mar 2012 10:11:43 +0000 (15:41 +0530)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Tue, 17 Jul 2012 04:53:20 +0000 (21:53 -0700)
Change-Id: Icbd53166001d3be102bac6a8d2f782cb22c4dc56

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

index 82c6ad6..804f079 100755 (executable)
@@ -1140,7 +1140,7 @@ final class HeadsetStateMachine extends StateMachine {
 
     private void processDialCall(String number) {
         String dialNumber;
-        if (number == null) {
+        if ((number == null) || (number.length() == 0)) {
             dialNumber = mPhonebook.getLastDialledNumber();
             if (dialNumber == null) {
                 if (DBG) log("processDialCall, last dial number null");
@@ -1162,6 +1162,11 @@ final class HeadsetStateMachine extends StateMachine {
                 return;
             }
         } else {
+            // Remove trailing ';'
+            if (number.charAt(number.length() - 1) == ';') {
+                number = number.substring(0, number.length() - 1);
+            }
+
             dialNumber = PhoneNumberUtils.convertPreDial(number);
         }
         // TODO(BT) do we need to terminate virtual call first