Merge change 25810 into eclair
* changes: Fix pause-wait dial string conversion error
This commit is contained in:
@@ -492,6 +492,8 @@ public class CdmaConnection extends Connection {
|
|||||||
|
|
||||||
newParent = parentFromDCState(dc.state);
|
newParent = parentFromDCState(dc.state);
|
||||||
|
|
||||||
|
if (Phone.DEBUG_PHONE) log("parent= " +parent +", newParent= " + newParent);
|
||||||
|
|
||||||
if (!equalsHandlesNulls(address, dc.number)) {
|
if (!equalsHandlesNulls(address, dc.number)) {
|
||||||
if (Phone.DEBUG_PHONE) log("update: phone # changed!");
|
if (Phone.DEBUG_PHONE) log("update: phone # changed!");
|
||||||
address = dc.number;
|
address = dc.number;
|
||||||
@@ -509,7 +511,7 @@ public class CdmaConnection extends Connection {
|
|||||||
cnapName = dc.name;
|
cnapName = dc.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
log("--dssds----"+cnapName);
|
if (Phone.DEBUG_PHONE) log("--dssds----"+cnapName);
|
||||||
cnapNamePresentation = dc.namePresentation;
|
cnapNamePresentation = dc.namePresentation;
|
||||||
numberPresentation = dc.numberPresentation;
|
numberPresentation = dc.numberPresentation;
|
||||||
|
|
||||||
@@ -529,9 +531,7 @@ public class CdmaConnection extends Connection {
|
|||||||
/** Some state-transition events */
|
/** Some state-transition events */
|
||||||
|
|
||||||
if (Phone.DEBUG_PHONE) log(
|
if (Phone.DEBUG_PHONE) log(
|
||||||
"update: parent=" + parent +
|
"Update, wasConnectingInOrOut=" + wasConnectingInOrOut +
|
||||||
", hasNewParent=" + (newParent != parent) +
|
|
||||||
", wasConnectingInOrOut=" + wasConnectingInOrOut +
|
|
||||||
", wasHolding=" + wasHolding +
|
", wasHolding=" + wasHolding +
|
||||||
", isConnectingInOrOut=" + isConnectingInOrOut() +
|
", isConnectingInOrOut=" + isConnectingInOrOut() +
|
||||||
", changed=" + changed);
|
", changed=" + changed);
|
||||||
@@ -860,10 +860,13 @@ public class CdmaConnection extends Connection {
|
|||||||
// Append the PW char
|
// Append the PW char
|
||||||
ret = (isPause(c)) ? PhoneNumberUtils.PAUSE : PhoneNumberUtils.WAIT;
|
ret = (isPause(c)) ? PhoneNumberUtils.PAUSE : PhoneNumberUtils.WAIT;
|
||||||
|
|
||||||
// if there is a PAUSE in at the beginning of PW character sequences, and this
|
// If the nextNonPwCharIndex is greater than currPwIndex + 1,
|
||||||
// PW character sequences has more than 2 PAUSE and WAIT Characters,skip PAUSE,
|
// it means the PW sequence contains not only P characters.
|
||||||
// append WAIT.
|
// Since for the sequence that only contains P character,
|
||||||
if (isPause(c) && (nextNonPwCharIndex > (currPwIndex + 2))) {
|
// the P character is handled one by one, the nextNonPwCharIndex
|
||||||
|
// equals to currPwIndex + 1.
|
||||||
|
// In this case, skip P, append W.
|
||||||
|
if (nextNonPwCharIndex > (currPwIndex + 1)) {
|
||||||
ret = PhoneNumberUtils.WAIT;
|
ret = PhoneNumberUtils.WAIT;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
@@ -882,6 +885,11 @@ public class CdmaConnection extends Connection {
|
|||||||
* and if there is any WAIT in PAUSE/WAIT sequence, treat them like WAIT.
|
* and if there is any WAIT in PAUSE/WAIT sequence, treat them like WAIT.
|
||||||
*/
|
*/
|
||||||
public static String formatDialString(String phoneNumber) {
|
public static String formatDialString(String phoneNumber) {
|
||||||
|
/**
|
||||||
|
* TODO(cleanup): This function should move to PhoneNumberUtils, and
|
||||||
|
* tests should be added.
|
||||||
|
*/
|
||||||
|
|
||||||
if (phoneNumber == null) {
|
if (phoneNumber == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -901,9 +909,9 @@ public class CdmaConnection extends Connection {
|
|||||||
char pC = findPOrWCharToAppend(phoneNumber, currIndex, nextIndex);
|
char pC = findPOrWCharToAppend(phoneNumber, currIndex, nextIndex);
|
||||||
ret.append(pC);
|
ret.append(pC);
|
||||||
// If PW char sequence has more than 2 PW characters,
|
// If PW char sequence has more than 2 PW characters,
|
||||||
// skip to the last character since the sequence already be
|
// skip to the last PW character since the sequence already be
|
||||||
// converted to WAIT character
|
// converted to WAIT character
|
||||||
if (nextIndex > (currIndex + 2)) {
|
if (nextIndex > (currIndex + 1)) {
|
||||||
currIndex = nextIndex - 1;
|
currIndex = nextIndex - 1;
|
||||||
}
|
}
|
||||||
} else if (nextIndex == length) {
|
} else if (nextIndex == length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user