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

Commit e2ee3ade authored by zzy's avatar zzy Committed by Matthew Xie
Browse files

remove the AT command separator from the CPBR range parameters

Root cause: Integer.parseInt(indices[0]) throw exception if char ';' at the end.

Bug 7274805
parent 2f67b082
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -316,7 +316,8 @@ public class AtPhonebook {
                String atCommand = (atString.split("="))[1];
                String[] indices = atCommand.split(",");
                for(int i = 0; i < indices.length; i++)
                    indices[i] = indices[i].trim();
                    //replace AT command separator ';' from the index if any
                    indices[i] = indices[i].replace(';', ' ').trim();
                try {
                    index1 = Integer.parseInt(indices[0]);
                    if (indices.length == 1)
@@ -325,7 +326,7 @@ public class AtPhonebook {
                        index2 = Integer.parseInt(indices[1]);
                }
                catch (Exception e) {
                    log("handleCpbrCommand - exception - invalid chars");
                    log("handleCpbrCommand - exception - invalid chars: " + e.toString());
                    atCommandErrorCode = BluetoothCmeError.TEXT_HAS_INVALID_CHARS;
                    mStateMachine.atResponseCodeNative(atCommandResult, atCommandErrorCode);
                    break;