summaryrefslogtreecommitdiffstats
path: root/telephony/java
diff options
context:
space:
mode:
Diffstat (limited to 'telephony/java')
-rw-r--r--telephony/java/com/android/internal/telephony/CallManager.java6
-rw-r--r--telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java30
-rwxr-xr-xtelephony/java/com/android/internal/telephony/sip/SipPhone.java3
3 files changed, 24 insertions, 15 deletions
diff --git a/telephony/java/com/android/internal/telephony/CallManager.java b/telephony/java/com/android/internal/telephony/CallManager.java
index 5f9a3e7..d74a547 100644
--- a/telephony/java/com/android/internal/telephony/CallManager.java
+++ b/telephony/java/com/android/internal/telephony/CallManager.java
@@ -380,7 +380,11 @@ public final class CallManager {
break;
case OFFHOOK:
Phone fgPhone = getFgPhone();
- if (hasActiveFgCall() && !(fgPhone instanceof SipPhone)) {
+ // Enable IN_CALL mode while foreground call is in DIALING,
+ // ALERTING, ACTIVE and DISCONNECTING state and not from sipPhone
+ if (getActiveFgCallState() != Call.State.IDLE
+ && getActiveFgCallState() != Call.State.DISCONNECTED
+ && !(fgPhone instanceof SipPhone)) {
mode = AudioManager.MODE_IN_CALL;
}
break;
diff --git a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
index e7d57bc..ab9cf2a 100644
--- a/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
+++ b/telephony/java/com/android/internal/telephony/gsm/GsmDataConnectionTracker.java
@@ -115,7 +115,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
* It is a subset of allApns and has the same format
*/
private ArrayList<ApnSetting> waitingApns = null;
-
+ private int waitingApnsPermanentFailureCountDown = 0;
private ApnSetting preferredApn = null;
/* Currently active APN */
@@ -449,6 +449,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
if (state == State.IDLE) {
waitingApns = buildWaitingApns();
+ waitingApnsPermanentFailureCountDown = waitingApns.size();
if (waitingApns.isEmpty()) {
if (DBG) log("No APN found");
notifyNoData(GsmDataConnection.FailCause.MISSING_UNKNOWN_APN);
@@ -1154,20 +1155,25 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
TelephonyManager.getDefault().getNetworkType());
}
- // No try for permanent failure
- if (cause.isPermanentFail()) {
- notifyNoData(cause);
- phone.notifyDataConnection(Phone.REASON_APN_FAILED);
- onEnableApn(apnTypeToId(mRequestedApnType), DISABLED);
- return;
- }
-
+ // Count permanent failures and remove the APN we just tried
+ waitingApnsPermanentFailureCountDown -= cause.isPermanentFail() ? 1 : 0;
waitingApns.remove(0);
+ if (DBG) log(String.format("onDataSetupComplete: waitingApns.size=%d" +
+ " waitingApnsPermanenatFailureCountDown=%d",
+ waitingApns.size(), waitingApnsPermanentFailureCountDown));
+
+ // See if there are more APN's to try
if (waitingApns.isEmpty()) {
- // No more to try, start delayed retry
- startDelayedRetry(cause, reason);
+ if (waitingApnsPermanentFailureCountDown == 0) {
+ if (DBG) log("onDataSetupComplete: Permanent failures stop retrying");
+ notifyNoData(cause);
+ phone.notifyDataConnection(Phone.REASON_APN_FAILED);
+ } else {
+ if (DBG) log("onDataSetupComplete: Not all permanent failures, retry");
+ startDelayedRetry(cause, reason);
+ }
} else {
- // we still have more apns to try
+ if (DBG) log("onDataSetupComplete: Try next APN");
setState(State.SCANNING);
// Wait a bit before trying the next APN, so that
// we're not tying up the RIL command channel
diff --git a/telephony/java/com/android/internal/telephony/sip/SipPhone.java b/telephony/java/com/android/internal/telephony/sip/SipPhone.java
index b154c91..818605a 100755
--- a/telephony/java/com/android/internal/telephony/sip/SipPhone.java
+++ b/telephony/java/com/android/internal/telephony/sip/SipPhone.java
@@ -390,12 +390,11 @@ public class SipPhone extends SipPhoneBase {
new SipProfile.Builder(calleeSipUri).build();
SipConnection c = new SipConnection(this, callee,
originalNumber);
- connections.add(c);
c.dial();
+ connections.add(c);
setState(Call.State.DIALING);
return c;
} catch (ParseException e) {
- // TODO: notify someone
throw new SipException("dial", e);
}
}