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 {
|
public enum FailCause {
|
||||||
NONE,
|
NONE,
|
||||||
BAD_APN,
|
OPERATOR_BARRED,
|
||||||
BAD_PAP_SECRET,
|
INSUFFICIENT_RESOURCES,
|
||||||
BARRED,
|
MISSING_UKNOWN_APN,
|
||||||
|
UNKNOWN_PDP_ADDRESS,
|
||||||
USER_AUTHENTICATION,
|
USER_AUTHENTICATION,
|
||||||
|
ACTIVATION_REJECT_GGSN,
|
||||||
|
ACTIVATION_REJECT_UNSPECIFIED,
|
||||||
SERVICE_OPTION_NOT_SUPPORTED,
|
SERVICE_OPTION_NOT_SUPPORTED,
|
||||||
SERVICE_OPTION_NOT_SUBSCRIBED,
|
SERVICE_OPTION_NOT_SUBSCRIBED,
|
||||||
SIM_LOCKED,
|
SERVICE_OPTION_OUT_OF_ORDER,
|
||||||
RADIO_OFF,
|
NSAPI_IN_USE,
|
||||||
NO_SIGNAL,
|
PROTOCOL_ERRORS,
|
||||||
NO_DATA_PLAN,
|
REGISTRATION_FAIL,
|
||||||
|
GPRS_REGISTRATION_FAIL,
|
||||||
|
UNKNOWN,
|
||||||
|
|
||||||
RADIO_NOT_AVAILABLE,
|
RADIO_NOT_AVAILABLE,
|
||||||
SUSPENED_TEMPORARY,
|
RADIO_ERROR_RETRY;
|
||||||
RADIO_ERROR_RETRY,
|
|
||||||
UNKNOWN;
|
|
||||||
|
|
||||||
public boolean isPermanentFail() {
|
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() {
|
public String toString() {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case NONE:
|
case NONE:
|
||||||
return "no error";
|
return "No Error";
|
||||||
case BAD_APN:
|
case OPERATOR_BARRED:
|
||||||
return "bad apn";
|
return "Operator Barred";
|
||||||
case BAD_PAP_SECRET:
|
case INSUFFICIENT_RESOURCES:
|
||||||
return "bad pap secret";
|
return "Insufficient Resources";
|
||||||
case BARRED:
|
case MISSING_UKNOWN_APN:
|
||||||
return "barred";
|
return "Missing / Unknown APN";
|
||||||
|
case UNKNOWN_PDP_ADDRESS:
|
||||||
|
return "Unknown PDP Address";
|
||||||
case USER_AUTHENTICATION:
|
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:
|
case SERVICE_OPTION_NOT_SUPPORTED:
|
||||||
return "data not supported";
|
return "Data Not Supported";
|
||||||
case SERVICE_OPTION_NOT_SUBSCRIBED:
|
case SERVICE_OPTION_NOT_SUBSCRIBED:
|
||||||
return "datt not subcribed";
|
return "Data Not subscribed";
|
||||||
case SIM_LOCKED:
|
case SERVICE_OPTION_OUT_OF_ORDER:
|
||||||
return "sim locked";
|
return "Data Services Out of Order";
|
||||||
case RADIO_OFF:
|
case NSAPI_IN_USE:
|
||||||
return "radio is off";
|
return "NSAPI in use";
|
||||||
case NO_SIGNAL:
|
case PROTOCOL_ERRORS:
|
||||||
return "no signal";
|
return "Protocol Errors";
|
||||||
case NO_DATA_PLAN:
|
case REGISTRATION_FAIL:
|
||||||
return "no data plan";
|
return "Network Registration Failure";
|
||||||
|
case GPRS_REGISTRATION_FAIL:
|
||||||
|
return "Data Network Registration Failure";
|
||||||
case RADIO_NOT_AVAILABLE:
|
case RADIO_NOT_AVAILABLE:
|
||||||
return "radio not available";
|
return "Radio Not Available";
|
||||||
case SUSPENED_TEMPORARY:
|
|
||||||
return "suspend temporary";
|
|
||||||
case RADIO_ERROR_RETRY:
|
case RADIO_ERROR_RETRY:
|
||||||
return "transient radio error";
|
return "Transient Radio Rrror";
|
||||||
default:
|
default:
|
||||||
return "unknown data error";
|
return "Unknown Data Error";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -233,7 +233,7 @@ public class CdmaDataConnection extends DataConnection {
|
|||||||
|
|
||||||
switch (rilCause) {
|
switch (rilCause) {
|
||||||
case PS_NET_DOWN_REASON_OPERATOR_DETERMINED_BARRING:
|
case PS_NET_DOWN_REASON_OPERATOR_DETERMINED_BARRING:
|
||||||
cause = FailCause.BARRED;
|
cause = FailCause.OPERATOR_BARRED;
|
||||||
break;
|
break;
|
||||||
case PS_NET_DOWN_REASON_AUTH_FAILED:
|
case PS_NET_DOWN_REASON_AUTH_FAILED:
|
||||||
cause = FailCause.USER_AUTHENTICATION;
|
cause = FailCause.USER_AUTHENTICATION;
|
||||||
|
|||||||
@@ -746,18 +746,11 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
// No try for permanent failure
|
// No try for permanent failure
|
||||||
if (cause.isPermanentFail()) {
|
if (cause.isPermanentFail()) {
|
||||||
notifyNoData(cause);
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @override com.android.internal.telephony.DataConnectionTracker
|
* @override com.android.internal.telephony.DataConnectionTracker
|
||||||
@@ -812,14 +805,6 @@ public final class CdmaDataConnectionTracker extends DataConnectionTracker {
|
|||||||
cleanUpConnection(tearDown, reason);
|
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() {
|
private void createAllDataConnectionList() {
|
||||||
dataConnectionList = new ArrayList<DataConnection>();
|
dataConnectionList = new ArrayList<DataConnection>();
|
||||||
CdmaDataConnection dataConn;
|
CdmaDataConnection dataConn;
|
||||||
|
|||||||
@@ -588,7 +588,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
waitingApns = buildWaitingApns();
|
waitingApns = buildWaitingApns();
|
||||||
if (waitingApns.isEmpty()) {
|
if (waitingApns.isEmpty()) {
|
||||||
if (DBG) log("No APN found");
|
if (DBG) log("No APN found");
|
||||||
notifyNoData(PdpConnection.FailCause.BAD_APN);
|
notifyNoData(PdpConnection.FailCause.MISSING_UKNOWN_APN);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
log ("Create from allApns : " + apnListToString(allApns));
|
log ("Create from allApns : " + apnListToString(allApns));
|
||||||
@@ -1315,13 +1315,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
cause = (PdpConnection.FailCause) (ar.result);
|
cause = (PdpConnection.FailCause) (ar.result);
|
||||||
if(DBG) log("PDP setup failed " + cause);
|
if(DBG) log("PDP setup failed " + cause);
|
||||||
// Log this failure to the Event Logs.
|
// Log this failure to the Event Logs.
|
||||||
if (cause == PdpConnection.FailCause.BAD_APN ||
|
if (cause.isEventLoggable()) {
|
||||||
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) {
|
|
||||||
int cid = -1;
|
int cid = -1;
|
||||||
GsmCellLocation loc = ((GsmCellLocation)phone.getCellLocation());
|
GsmCellLocation loc = ((GsmCellLocation)phone.getCellLocation());
|
||||||
if (loc != null) cid = loc.getCid();
|
if (loc != null) cid = loc.getCid();
|
||||||
@@ -1335,9 +1329,9 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
// No try for permanent failure
|
// No try for permanent failure
|
||||||
if (cause.isPermanentFail()) {
|
if (cause.isPermanentFail()) {
|
||||||
notifyNoData(cause);
|
notifyNoData(cause);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tryNextApn(cause)) {
|
|
||||||
waitingApns.remove(0);
|
waitingApns.remove(0);
|
||||||
if (waitingApns.isEmpty()) {
|
if (waitingApns.isEmpty()) {
|
||||||
// No more to try, start delayed retry
|
// No more to try, start delayed retry
|
||||||
@@ -1350,9 +1344,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA, reason),
|
sendMessageDelayed(obtainMessage(EVENT_TRY_SETUP_DATA, reason),
|
||||||
RECONNECT_DELAY_INITIAL_MILLIS);
|
RECONNECT_DELAY_INITIAL_MILLIS);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
startDelayedRetry(cause, reason);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1406,14 +1397,6 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
cleanUpConnection(tearDown, reason);
|
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() {
|
private int getRestoreDefaultApnDelay() {
|
||||||
String restoreApnDelayStr = SystemProperties.get(APN_RESTORE_DELAY_PROP_NAME);
|
String restoreApnDelayStr = SystemProperties.get(APN_RESTORE_DELAY_PROP_NAME);
|
||||||
|
|
||||||
@@ -1460,7 +1443,7 @@ public final class GsmDataConnectionTracker extends DataConnectionTracker {
|
|||||||
if (allApns.isEmpty()) {
|
if (allApns.isEmpty()) {
|
||||||
if (DBG) log("No APN found for carrier: " + operator);
|
if (DBG) log("No APN found for carrier: " + operator);
|
||||||
preferredApn = null;
|
preferredApn = null;
|
||||||
notifyNoData(PdpConnection.FailCause.BAD_APN);
|
notifyNoData(PdpConnection.FailCause.MISSING_UKNOWN_APN);
|
||||||
} else {
|
} else {
|
||||||
preferredApn = getPreferredApn();
|
preferredApn = getPreferredApn();
|
||||||
Log.d(LOG_TAG, "Get PreferredAPN");
|
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 String LOG_TAG = "GSM";
|
||||||
private static final boolean DBG = true;
|
private static final boolean DBG = true;
|
||||||
private static final boolean FAKE_FAIL = false;
|
|
||||||
|
|
||||||
/** Fail cause of last PDP activate, from RIL_LastPDPActivateFailCause */
|
/** Fail cause of last PDP activate, from RIL_LastPDPActivateFailCause */
|
||||||
private static final int PDP_FAIL_RIL_BARRED = 8;
|
private static final int PDP_FAIL_OPERATOR_BARRED = 0x08;
|
||||||
private static final int PDP_FAIL_RIL_BAD_APN = 27;
|
private static final int PDP_FAIL_INSUFFICIENT_RESOURCES = 0x1A;
|
||||||
private static final int PDP_FAIL_RIL_USER_AUTHENTICATION = 29;
|
private static final int PDP_FAIL_MISSING_UKNOWN_APN = 0x1B;
|
||||||
private static final int PDP_FAIL_RIL_SERVICE_OPTION_NOT_SUPPORTED = 32;
|
private static final int PDP_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C;
|
||||||
private static final int PDP_FAIL_RIL_SERVICE_OPTION_NOT_SUBSCRIBED = 33;
|
private static final int PDP_FAIL_USER_AUTHENTICATION = 0x1D;
|
||||||
private static final int PDP_FAIL_RIL_ERROR_UNSPECIFIED = 0xffff;
|
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
|
//***** Instance Variables
|
||||||
private String pdp_name;
|
private String pdp_name;
|
||||||
@@ -83,14 +92,6 @@ public class PdpConnection extends DataConnection {
|
|||||||
lastFailCause = FailCause.NONE;
|
lastFailCause = FailCause.NONE;
|
||||||
receivedDisconnectReq = false;
|
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,
|
phone.mCM.setupDataCall(Integer.toString(RILConstants.GSM_PHONE), null, apn.apn, apn.user,
|
||||||
apn.password, obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE));
|
apn.password, obtainMessage(EVENT_SETUP_DATA_CONNECTION_DONE));
|
||||||
}
|
}
|
||||||
@@ -190,21 +191,51 @@ public class PdpConnection extends DataConnection {
|
|||||||
FailCause cause;
|
FailCause cause;
|
||||||
|
|
||||||
switch (rilCause) {
|
switch (rilCause) {
|
||||||
case PDP_FAIL_RIL_BARRED:
|
case PDP_FAIL_OPERATOR_BARRED:
|
||||||
cause = FailCause.BARRED;
|
cause = FailCause.OPERATOR_BARRED;
|
||||||
break;
|
break;
|
||||||
case PDP_FAIL_RIL_BAD_APN:
|
case PDP_FAIL_INSUFFICIENT_RESOURCES:
|
||||||
cause = FailCause.BAD_APN;
|
cause = FailCause.INSUFFICIENT_RESOURCES;
|
||||||
break;
|
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;
|
cause = FailCause.USER_AUTHENTICATION;
|
||||||
break;
|
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;
|
cause = FailCause.SERVICE_OPTION_NOT_SUPPORTED;
|
||||||
break;
|
break;
|
||||||
case PDP_FAIL_RIL_SERVICE_OPTION_NOT_SUBSCRIBED:
|
case PDP_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED:
|
||||||
cause = FailCause.SERVICE_OPTION_NOT_SUBSCRIBED;
|
cause = FailCause.SERVICE_OPTION_NOT_SUBSCRIBED;
|
||||||
break;
|
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:
|
default:
|
||||||
cause = FailCause.UNKNOWN;
|
cause = FailCause.UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user