Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8513570b authored by Matthew Xie's avatar Matthew Xie Committed by Android Git Automerger
Browse files

am 026ebcfb: am c3df3803: Merge "AtPhonebook handleCpbsCommand was incorrectly...


am 026ebcfb: am c3df3803: Merge "AtPhonebook handleCpbsCommand was incorrectly sending two responses to some requests (one inside the swtich statement, then repeating it after breaking out of the switch statement). This broke phonebook sync with Audi 2G MMI car kit. S

* commit '026ebcfb':
  AtPhonebook handleCpbsCommand was incorrectly sending two responses to some requests (one inside the swtich statement, then repeating it after breaking out of the switch statement). This broke phonebook sync with Audi 2G MMI car kit. Signed-off-by: default avatarNigel Hannam <nigel@hannam.eu>
parents 31a84844 026ebcfb
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -205,15 +205,11 @@ public class AtPhonebook {
                if ("SM".equals(mCurrentPhonebook)) {
                    atCommandResponse = "+CPBS: \"SM\",0," + getMaxPhoneBookSize(0);
                    atCommandResult = HeadsetHalConstants.AT_RESPONSE_OK;
                    if (atCommandResponse != null)
                        mStateMachine.atResponseStringNative(atCommandResponse);
                    mStateMachine.atResponseCodeNative(atCommandResult, atCommandErrorCode);
                    break;
                }
                PhonebookResult pbr = getPhonebookResult(mCurrentPhonebook, true);
                if (pbr == null) {
                    atCommandErrorCode = BluetoothCmeError.OPERATION_NOT_SUPPORTED;
                    mStateMachine.atResponseCodeNative(atCommandResult, atCommandErrorCode);
                    break;
                }
                int size = pbr.cursor.getCount();
@@ -232,7 +228,7 @@ public class AtPhonebook {
                String[] args = atString.split("=");
                // Select phonebook memory
                if (args.length < 2 || !(args[1] instanceof String)) {
                    mStateMachine.atResponseCodeNative(atCommandResult, atCommandErrorCode);
                    atCommandErrorCode = BluetoothCmeError.OPERATION_NOT_SUPPORTED;
                    break;
                }
                String pb = ((String)args[1]).trim();
@@ -241,7 +237,6 @@ public class AtPhonebook {
                if (getPhonebookResult(pb, false) == null && !"SM".equals(pb)) {
                   if (DBG) log("Dont know phonebook: '" + pb + "'");
                   atCommandErrorCode = BluetoothCmeError.OPERATION_NOT_ALLOWED;
                   mStateMachine.atResponseCodeNative(atCommandResult, atCommandErrorCode);
                   break;
                }
                mCurrentPhonebook = pb;