Merge change 2563 into donut
* changes: Add PDP Reject causes.
This commit is contained in:
@@ -55,57 +55,83 @@ public abstract class DataConnection extends Handler {
|
||||
|
||||
public enum FailCause {
|
||||
NONE,
|
||||
BAD_APN,
|
||||
BAD_PAP_SECRET,
|
||||
BARRED,
|
||||
OPERATOR_BARRED,
|
||||
INSUFFICIENT_RESOURCES,
|
||||
MISSING_UKNOWN_APN,
|
||||
UNKNOWN_PDP_ADDRESS,
|
||||
USER_AUTHENTICATION,
|
||||
ACTIVATION_REJECT_GGSN,
|
||||
ACTIVATION_REJECT_UNSPECIFIED,
|
||||
SERVICE_OPTION_NOT_SUPPORTED,
|
||||
SERVICE_OPTION_NOT_SUBSCRIBED,
|
||||
SIM_LOCKED,
|
||||
RADIO_OFF,
|
||||
NO_SIGNAL,
|
||||
NO_DATA_PLAN,
|
||||
SERVICE_OPTION_OUT_OF_ORDER,
|
||||
NSAPI_IN_USE,
|
||||
PROTOCOL_ERRORS,
|
||||
REGISTRATION_FAIL,
|
||||
GPRS_REGISTRATION_FAIL,
|
||||
UNKNOWN,
|
||||
|
||||
RADIO_NOT_AVAILABLE,
|
||||
SUSPENED_TEMPORARY,
|
||||
RADIO_ERROR_RETRY,
|
||||
UNKNOWN;
|
||||
RADIO_ERROR_RETRY;
|
||||
|
||||
public boolean isPermanentFail() {
|
||||
return (this == RADIO_OFF);
|
||||
return (this == OPERATOR_BARRED) || (this == MISSING_UKNOWN_APN) ||
|
||||
(this == UNKNOWN_PDP_ADDRESS) || (this == USER_AUTHENTICATION) ||
|
||||
(this == ACTIVATION_REJECT_GGSN) || (this == ACTIVATION_REJECT_UNSPECIFIED) ||
|
||||
(this == SERVICE_OPTION_NOT_SUPPORTED) ||
|
||||
(this == SERVICE_OPTION_NOT_SUBSCRIBED) || (this == NSAPI_IN_USE) ||
|
||||
(this == PROTOCOL_ERRORS);
|
||||
}
|
||||
|
||||
public boolean isEventLoggable() {
|
||||
return (this == OPERATOR_BARRED) || (this == INSUFFICIENT_RESOURCES) ||
|
||||
(this == UNKNOWN_PDP_ADDRESS) || (this == USER_AUTHENTICATION) ||
|
||||
(this == ACTIVATION_REJECT_GGSN) || (this == ACTIVATION_REJECT_UNSPECIFIED) ||
|
||||
(this == SERVICE_OPTION_NOT_SUBSCRIBED) ||
|
||||
(this == SERVICE_OPTION_NOT_SUPPORTED) ||
|
||||
(this == SERVICE_OPTION_OUT_OF_ORDER) || (this == NSAPI_IN_USE) ||
|
||||
(this == PROTOCOL_ERRORS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
switch (this) {
|
||||
case NONE:
|
||||
return "no error";
|
||||
case BAD_APN:
|
||||
return "bad apn";
|
||||
case BAD_PAP_SECRET:
|
||||
return "bad pap secret";
|
||||
case BARRED:
|
||||
return "barred";
|
||||
return "No Error";
|
||||
case OPERATOR_BARRED:
|
||||
return "Operator Barred";
|
||||
case INSUFFICIENT_RESOURCES:
|
||||
return "Insufficient Resources";
|
||||
case MISSING_UKNOWN_APN:
|
||||
return "Missing / Unknown APN";
|
||||
case UNKNOWN_PDP_ADDRESS:
|
||||
return "Unknown PDP Address";
|
||||
case USER_AUTHENTICATION:
|
||||
return "error user autentication";
|
||||
return "Error User Autentication";
|
||||
case ACTIVATION_REJECT_GGSN:
|
||||
return "Activation Reject GGSN";
|
||||
case ACTIVATION_REJECT_UNSPECIFIED:
|
||||
return "Activation Reject unspecified";
|
||||
case SERVICE_OPTION_NOT_SUPPORTED:
|
||||
return "data not supported";
|
||||
return "Data Not Supported";
|
||||
case SERVICE_OPTION_NOT_SUBSCRIBED:
|
||||
return "datt not subcribed";
|
||||
case SIM_LOCKED:
|
||||
return "sim locked";
|
||||
case RADIO_OFF:
|
||||
return "radio is off";
|
||||
case NO_SIGNAL:
|
||||
return "no signal";
|
||||
case NO_DATA_PLAN:
|
||||
return "no data plan";
|
||||
return "Data Not subscribed";
|
||||
case SERVICE_OPTION_OUT_OF_ORDER:
|
||||
return "Data Services Out of Order";
|
||||
case NSAPI_IN_USE:
|
||||
return "NSAPI in use";
|
||||
case PROTOCOL_ERRORS:
|
||||
return "Protocol Errors";
|
||||
case REGISTRATION_FAIL:
|
||||
return "Network Registration Failure";
|
||||
case GPRS_REGISTRATION_FAIL:
|
||||
return "Data Network Registration Failure";
|
||||
case RADIO_NOT_AVAILABLE:
|
||||
return "radio not available";
|
||||
case SUSPENED_TEMPORARY:
|
||||
return "suspend temporary";
|
||||
return "Radio Not Available";
|
||||
case RADIO_ERROR_RETRY:
|
||||
return "transient radio error";
|
||||
return "Transient Radio Rrror";
|
||||
default:
|
||||
return "unknown data error";
|
||||
return "Unknown Data Error";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ public class CdmaDataConnection extends DataConnection {
|
||||
|
||||
switch (rilCause) {
|
||||
case PS_NET_DOWN_REASON_OPERATOR_DETERMINED_BARRING:
|
||||
cause = FailCause.BARRED;
|
||||
cause = FailCause.OPERATOR_BARRED;
|
||||
break;
|
||||
case PS_NET_DOWN_REASON_AUTH_FAILED:
|
||||
cause = FailCause.USER_AUTHENTICATION;
|
||||
|
||||
@@ -746,16 +746,9 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
||||
// No try for permanent failure
|
||||
if (cause.isPermanentFail()) {
|
||||
notifyNoData(cause);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tryAgain(cause)) {
|
||||
// Wait a bit before trying again, so that
|
||||
// we're not tying up the RIL command channel
|
||||
sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA, reason),
|
||||
RECONNECT_DELAY_INITIAL_MILLIS);
|
||||
} else {
|
||||
startDelayedRetry(cause, reason);
|
||||
}
|
||||
startDelayedRetry(cause, reason);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -812,14 +805,6 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
||||
cleanUpConnection(tearDown, reason);
|
||||
}
|
||||
|
||||
private boolean tryAgain(FailCause cause) {
|
||||
return (cause != FailCause.RADIO_NOT_AVAILABLE)
|
||||
&& (cause != FailCause.RADIO_OFF)
|
||||
&& (cause != FailCause.RADIO_ERROR_RETRY)
|
||||
&& (cause != FailCause.NO_SIGNAL)
|
||||
&& (cause != FailCause.SIM_LOCKED);
|
||||
}
|
||||
|
||||
private void createAllDataConnectionList() {
|
||||
dataConnectionList = new ArrayList<DataConnection>();
|
||||
CdmaDataConnection dataConn;
|
||||
|
||||
@@ -588,7 +588,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
||||
waitingApns = buildWaitingApns();
|
||||
if (waitingApns.isEmpty()) {
|
||||
if (DBG) log("No APN found");
|
||||
notifyNoData(PdpConnection.FailCause.BAD_APN);
|
||||
notifyNoData(PdpConnection.FailCause.MISSING_UKNOWN_APN);
|
||||
return false;
|
||||
} else {
|
||||
log ("Create from allApns : " + apnListToString(allApns));
|
||||
@@ -1315,13 +1315,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
||||
cause = (PdpConnection.FailCause) (ar.result);
|
||||
if(DBG) log("PDP setup failed " + cause);
|
||||
// Log this failure to the Event Logs.
|
||||
if (cause == PdpConnection.FailCause.BAD_APN ||
|
||||
cause == PdpConnection.FailCause.BAD_PAP_SECRET ||
|
||||
cause == PdpConnection.FailCause.BARRED ||
|
||||
cause == PdpConnection.FailCause.RADIO_ERROR_RETRY ||
|
||||
cause == PdpConnection.FailCause.SUSPENED_TEMPORARY ||
|
||||
cause == PdpConnection.FailCause.UNKNOWN ||
|
||||
cause == PdpConnection.FailCause.USER_AUTHENTICATION) {
|
||||
if (cause.isEventLoggable()) {
|
||||
int cid = -1;
|
||||
GsmCellLocation loc = ((GsmCellLocation)phone.getCellLocation());
|
||||
if (loc != null) cid = loc.getCid();
|
||||
@@ -1335,23 +1329,20 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
||||
// No try for permanent failure
|
||||
if (cause.isPermanentFail()) {
|
||||
notifyNoData(cause);
|
||||
return;
|
||||
}
|
||||
|
||||
if (tryNextApn(cause)) {
|
||||
waitingApns.remove(0);
|
||||
if (waitingApns.isEmpty()) {
|
||||
// No more to try, start delayed retry
|
||||
startDelayedRetry(cause, reason);
|
||||
} else {
|
||||
// we still have more apns to try
|
||||
setState(State.SCANNING);
|
||||
// Wait a bit before trying the next APN, so that
|
||||
// we're not tying up the RIL command channel
|
||||
sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA, reason),
|
||||
RECONNECT_DELAY_INITIAL_MILLIS);
|
||||
}
|
||||
} else {
|
||||
waitingApns.remove(0);
|
||||
if (waitingApns.isEmpty()) {
|
||||
// No more to try, start delayed retry
|
||||
startDelayedRetry(cause, reason);
|
||||
} else {
|
||||
// we still have more apns to try
|
||||
setState(State.SCANNING);
|
||||
// Wait a bit before trying the next APN, so that
|
||||
// we're not tying up the RIL command channel
|
||||
sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA, reason),
|
||||
RECONNECT_DELAY_INITIAL_MILLIS);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1406,14 +1397,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
||||
cleanUpConnection(tearDown, reason);
|
||||
}
|
||||
|
||||
private boolean tryNextApn(FailCause cause) {
|
||||
return (cause != FailCause.RADIO_NOT_AVAILABLE)
|
||||
&& (cause != FailCause.RADIO_OFF)
|
||||
&& (cause != FailCause.RADIO_ERROR_RETRY)
|
||||
&& (cause != FailCause.NO_SIGNAL)
|
||||
&& (cause != FailCause.SIM_LOCKED);
|
||||
}
|
||||
|
||||
private int getRestoreDefaultApnDelay() {
|
||||
String restoreApnDelayStr = SystemProperties.get(APN_RESTORE_DELAY_PROP_NAME);
|
||||
|
||||
@@ -1460,7 +1443,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
||||
if (allApns.isEmpty()) {
|
||||
if (DBG) log("No APN found for carrier: " + operator);
|
||||
preferredApn = null;
|
||||
notifyNoData(PdpConnection.FailCause.BAD_APN);
|
||||
notifyNoData(PdpConnection.FailCause.MISSING_UKNOWN_APN);
|
||||
} else {
|
||||
preferredApn = getPreferredApn();
|
||||
Log.d(LOG_TAG, "Get PreferredAPN");
|
||||
|
||||
@@ -35,15 +35,24 @@ public class PdpConnection extends DataConnection {
|
||||
|
||||
private static final String LOG_TAG = "GSM";
|
||||
private static final boolean DBG = true;
|
||||
private static final boolean FAKE_FAIL = false;
|
||||
|
||||
/** Fail cause of last PDP activate, from RIL_LastPDPActivateFailCause */
|
||||
private static final int PDP_FAIL_RIL_BARRED = 8;
|
||||
private static final int PDP_FAIL_RIL_BAD_APN = 27;
|
||||
private static final int PDP_FAIL_RIL_USER_AUTHENTICATION = 29;
|
||||
private static final int PDP_FAIL_RIL_SERVICE_OPTION_NOT_SUPPORTED = 32;
|
||||
private static final int PDP_FAIL_RIL_SERVICE_OPTION_NOT_SUBSCRIBED = 33;
|
||||
private static final int PDP_FAIL_RIL_ERROR_UNSPECIFIED = 0xffff;
|
||||
private static final int PDP_FAIL_OPERATOR_BARRED = 0x08;
|
||||
private static final int PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A;
|
||||
private static final int PDP_FAIL_MISSING_UKNOWN_APN = 0x1B;
|
||||
private static final int PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C;
|
||||
private static final int PDP_FAIL_USER_AUTHENTICATION = 0x1D;
|
||||
private static final int PDP_FAIL_ACTIVATION_REJECT_GGSN = 0x1E;
|
||||
private static final int PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F;
|
||||
private static final int PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20;
|
||||
private static final int PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21;
|
||||
private static final int PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22;
|
||||
private static final int PDP_FAIL_NSAPI_IN_USE = 0x23;
|
||||
private static final int PDP_FAIL_PROTOCOL_ERRORS = 0x6F;
|
||||
private static final int PDP_FAIL_ERROR_UNSPECIFIED = 0xffff;
|
||||
|
||||
private static final int PDP_FAIL_REGISTRATION_FAIL = -1;
|
||||
private static final int PDP_FAIL_GPRS_REGISTRATION_FAIL = -2;
|
||||
|
||||
//***** Instance Variables
|
||||
private String pdp_name;
|
||||
@@ -83,14 +92,6 @@ public class PdpConnection extends DataConnection {
|
||||
lastFailCause = FailCause.NONE;
|
||||
receivedDisconnectReq = false;
|
||||
|
||||
if (FAKE_FAIL) {
|
||||
// for debug before baseband implement error in setup PDP
|
||||
if (apn.apn.equalsIgnoreCase("badapn")){
|
||||
notifyFail(FailCause.BAD_APN, onConnectCompleted);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
phone.mCM.setupDataCall(Integer.toString(RILConstants.GSM_PHONE), null, apn.apn, apn.user,
|
||||
apn.password, obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE));
|
||||
}
|
||||
@@ -190,21 +191,51 @@ public class PdpConnection extends DataConnection {
|
||||
FailCause cause;
|
||||
|
||||
switch (rilCause) {
|
||||
case PDP_FAIL_RIL_BARRED:
|
||||
cause = FailCause.BARRED;
|
||||
case PDP_FAIL_OPERATOR_BARRED:
|
||||
cause = FailCause.OPERATOR_BARRED;
|
||||
break;
|
||||
case PDP_FAIL_RIL_BAD_APN:
|
||||
cause = FailCause.BAD_APN;
|
||||
case PDP_FAIL_INSUFFICIENT_RESOURCES:
|
||||
cause = FailCause.INSUFFICIENT_RESOURCES;
|
||||
break;
|
||||
case PDP_FAIL_RIL_USER_AUTHENTICATION:
|
||||
case PDP_FAIL_MISSING_UKNOWN_APN:
|
||||
cause = FailCause.MISSING_UKNOWN_APN;
|
||||
break;
|
||||
case PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE:
|
||||
cause = FailCause.UNKNOWN_PDP_ADDRESS;
|
||||
break;
|
||||
case PDP_FAIL_USER_AUTHENTICATION:
|
||||
cause = FailCause.USER_AUTHENTICATION;
|
||||
break;
|
||||
case PDP_FAIL_RIL_SERVICE_OPTION_NOT_SUPPORTED:
|
||||
case PDP_FAIL_ACTIVATION_REJECT_GGSN:
|
||||
cause = FailCause.ACTIVATION_REJECT_GGSN;
|
||||
break;
|
||||
case PDP_FAIL_ACTIVATION_REJECT_UNSPECIFIED:
|
||||
cause = FailCause.ACTIVATION_REJECT_UNSPECIFIED;
|
||||
break;
|
||||
case PDP_FAIL_SERVICE_OPTION_OUT_OF_ORDER:
|
||||
cause = FailCause.SERVICE_OPTION_OUT_OF_ORDER;
|
||||
break;
|
||||
case PDP_FAIL_SERVICE_OPTION_NOT_SUPPORTED:
|
||||
cause = FailCause.SERVICE_OPTION_NOT_SUPPORTED;
|
||||
break;
|
||||
case PDP_FAIL_RIL_SERVICE_OPTION_NOT_SUBSCRIBED:
|
||||
case PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED:
|
||||
cause = FailCause.SERVICE_OPTION_NOT_SUBSCRIBED;
|
||||
break;
|
||||
case PDP_FAIL_NSAPI_IN_USE:
|
||||
cause = FailCause.NSAPI_IN_USE;
|
||||
break;
|
||||
case PDP_FAIL_PROTOCOL_ERRORS:
|
||||
cause = FailCause.PROTOCOL_ERRORS;
|
||||
break;
|
||||
case PDP_FAIL_ERROR_UNSPECIFIED:
|
||||
cause = FailCause.UNKNOWN;
|
||||
break;
|
||||
case PDP_FAIL_REGISTRATION_FAIL:
|
||||
cause = FailCause.REGISTRATION_FAIL;
|
||||
break;
|
||||
case PDP_FAIL_GPRS_REGISTRATION_FAIL:
|
||||
cause = FailCause.GPRS_REGISTRATION_FAIL;
|
||||
break;
|
||||
default:
|
||||
cause = FailCause.UNKNOWN;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user