Remove redundant network types.
ServiceStateTracker can use the ServiceState values. bug:4083436 Change-Id: I5b5b72392d9d48adc55731c44417d622930c4bec
This commit is contained in:
@@ -29,25 +29,6 @@ import android.telephony.SignalStrength;
|
|||||||
*/
|
*/
|
||||||
public abstract class ServiceStateTracker extends Handler {
|
public abstract class ServiceStateTracker extends Handler {
|
||||||
|
|
||||||
/**
|
|
||||||
* Access technology currently in use.
|
|
||||||
*/
|
|
||||||
protected static final int DATA_ACCESS_UNKNOWN = 0;
|
|
||||||
protected static final int DATA_ACCESS_GPRS = 1;
|
|
||||||
protected static final int DATA_ACCESS_EDGE = 2;
|
|
||||||
protected static final int DATA_ACCESS_UMTS = 3;
|
|
||||||
protected static final int DATA_ACCESS_CDMA_IS95A = 4;
|
|
||||||
protected static final int DATA_ACCESS_CDMA_IS95B = 5;
|
|
||||||
protected static final int DATA_ACCESS_CDMA_1xRTT = 6;
|
|
||||||
protected static final int DATA_ACCESS_CDMA_EvDo_0 = 7;
|
|
||||||
protected static final int DATA_ACCESS_CDMA_EvDo_A = 8;
|
|
||||||
protected static final int DATA_ACCESS_HSDPA = 9;
|
|
||||||
protected static final int DATA_ACCESS_HSUPA = 10;
|
|
||||||
protected static final int DATA_ACCESS_HSPA = 11;
|
|
||||||
protected static final int DATA_ACCESS_CDMA_EvDo_B = 12;
|
|
||||||
protected static final int DATA_ACCESS_LTE = 13;
|
|
||||||
protected static final int DATA_ACCESS_EHRPD = 14;
|
|
||||||
|
|
||||||
protected CommandsInterface cm;
|
protected CommandsInterface cm;
|
||||||
|
|
||||||
public ServiceState ss;
|
public ServiceState ss;
|
||||||
|
|||||||
@@ -198,26 +198,26 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
String ret = "unknown";
|
String ret = "unknown";
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DATA_ACCESS_CDMA_IS95A:
|
case ServiceState.RADIO_TECHNOLOGY_IS95A:
|
||||||
case DATA_ACCESS_CDMA_IS95B:
|
case ServiceState.RADIO_TECHNOLOGY_IS95B:
|
||||||
ret = "CDMA";
|
ret = "CDMA";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_CDMA_1xRTT:
|
case ServiceState.RADIO_TECHNOLOGY_1xRTT:
|
||||||
ret = "CDMA - 1xRTT";
|
ret = "CDMA - 1xRTT";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_CDMA_EvDo_0:
|
case ServiceState.RADIO_TECHNOLOGY_EVDO_0:
|
||||||
ret = "CDMA - EvDo rev. 0";
|
ret = "CDMA - EvDo rev. 0";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_CDMA_EvDo_A:
|
case ServiceState.RADIO_TECHNOLOGY_EVDO_A:
|
||||||
ret = "CDMA - EvDo rev. A";
|
ret = "CDMA - EvDo rev. A";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_CDMA_EvDo_B:
|
case ServiceState.RADIO_TECHNOLOGY_EVDO_B:
|
||||||
ret = "CDMA - EvDo rev. B";
|
ret = "CDMA - EvDo rev. B";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_LTE:
|
case ServiceState.RADIO_TECHNOLOGY_LTE:
|
||||||
ret = "LTE";
|
ret = "LTE";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_EHRPD:
|
case ServiceState.RADIO_TECHNOLOGY_EHRPD:
|
||||||
ret = "CDMA - eHRPD";
|
ret = "CDMA - eHRPD";
|
||||||
default:
|
default:
|
||||||
if (DBG) {
|
if (DBG) {
|
||||||
@@ -261,16 +261,20 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
boolean hasLocationChanged = !newCellLoc.equals(cellLoc);
|
boolean hasLocationChanged = !newCellLoc.equals(cellLoc);
|
||||||
|
|
||||||
boolean has4gHandoff =
|
boolean has4gHandoff =
|
||||||
((networkType == DATA_ACCESS_LTE) && (newNetworkType == DATA_ACCESS_EHRPD))
|
((networkType == ServiceState.RADIO_TECHNOLOGY_LTE) &&
|
||||||
|| ((networkType == DATA_ACCESS_EHRPD) && (newNetworkType == DATA_ACCESS_LTE));
|
(newNetworkType == ServiceState.RADIO_TECHNOLOGY_EHRPD)) ||
|
||||||
|
((networkType == ServiceState.RADIO_TECHNOLOGY_EHRPD) &&
|
||||||
|
(newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE));
|
||||||
|
|
||||||
boolean hasMultiApnSupport =
|
boolean hasMultiApnSupport =
|
||||||
(((newNetworkType == DATA_ACCESS_LTE) || (newNetworkType == DATA_ACCESS_EHRPD))
|
(((newNetworkType == ServiceState.RADIO_TECHNOLOGY_LTE) ||
|
||||||
&& ((networkType != DATA_ACCESS_LTE) && (networkType != DATA_ACCESS_EHRPD)));
|
(newNetworkType == ServiceState.RADIO_TECHNOLOGY_EHRPD)) &&
|
||||||
|
((networkType != ServiceState.RADIO_TECHNOLOGY_LTE) &&
|
||||||
|
(networkType != ServiceState.RADIO_TECHNOLOGY_EHRPD)));
|
||||||
|
|
||||||
boolean hasLostMultiApnSupport =
|
boolean hasLostMultiApnSupport =
|
||||||
((newNetworkType >= DATA_ACCESS_CDMA_IS95A)
|
((newNetworkType >= ServiceState.RADIO_TECHNOLOGY_IS95A) &&
|
||||||
&& (newNetworkType <= DATA_ACCESS_CDMA_EvDo_A));
|
(newNetworkType <= ServiceState.RADIO_TECHNOLOGY_EVDO_A));
|
||||||
|
|
||||||
log("hasRegistered = " + hasRegistered + " hasCdmaDataConnectionAttached = "
|
log("hasRegistered = " + hasRegistered + " hasCdmaDataConnectionAttached = "
|
||||||
+ hasCdmaDataConnectionAttached + " hasCdmaDataConnectionChanged = "
|
+ hasCdmaDataConnectionAttached + " hasCdmaDataConnectionChanged = "
|
||||||
@@ -457,7 +461,7 @@ public class CdmaLteServiceStateTracker extends CdmaServiceStateTracker {
|
|||||||
// Note: it needs to be confirmed which CDMA network types
|
// Note: it needs to be confirmed which CDMA network types
|
||||||
// can support voice and data calls concurrently.
|
// can support voice and data calls concurrently.
|
||||||
// For the time-being, the return value will be false.
|
// For the time-being, the return value will be false.
|
||||||
// return (networkType >= DATA_ACCESS_LTE);
|
// return (networkType >= ServiceState.RADIO_TECHNOLOGY_LTE);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
NITZ_UPDATE_DIFF_DEFAULT);
|
NITZ_UPDATE_DIFF_DEFAULT);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Values correspond to ServiceStateTracker.DATA_ACCESS_ definitions.
|
* Values correspond to ServiceState.RADIO_TECHNOLOGY_ definitions.
|
||||||
*/
|
*/
|
||||||
protected int networkType = 0;
|
protected int networkType = 0;
|
||||||
protected int newNetworkType = 0;
|
protected int newNetworkType = 0;
|
||||||
@@ -912,20 +912,20 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
|
|||||||
String ret = "unknown";
|
String ret = "unknown";
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DATA_ACCESS_CDMA_IS95A:
|
case ServiceState.RADIO_TECHNOLOGY_IS95A:
|
||||||
case DATA_ACCESS_CDMA_IS95B:
|
case ServiceState.RADIO_TECHNOLOGY_IS95B:
|
||||||
ret = "CDMA";
|
ret = "CDMA";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_CDMA_1xRTT:
|
case ServiceState.RADIO_TECHNOLOGY_1xRTT:
|
||||||
ret = "CDMA - 1xRTT";
|
ret = "CDMA - 1xRTT";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_CDMA_EvDo_0:
|
case ServiceState.RADIO_TECHNOLOGY_EVDO_0:
|
||||||
ret = "CDMA - EvDo rev. 0";
|
ret = "CDMA - EvDo rev. 0";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_CDMA_EvDo_A:
|
case ServiceState.RADIO_TECHNOLOGY_EVDO_A:
|
||||||
ret = "CDMA - EvDo rev. A";
|
ret = "CDMA - EvDo rev. A";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_CDMA_EvDo_B:
|
case ServiceState.RADIO_TECHNOLOGY_EVDO_B:
|
||||||
ret = "CDMA - EvDo rev. B";
|
ret = "CDMA - EvDo rev. B";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
private int mNewReasonDataDenied = -1;
|
private int mNewReasonDataDenied = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Values correspond to ServiceStateTracker.DATA_ACCESS_ definitions.
|
* Values correspond to ServiceState.RADIO_TECHNOLOGY_ definitions.
|
||||||
*/
|
*/
|
||||||
private int networkType = 0;
|
private int networkType = 0;
|
||||||
private int newNetworkType = 0;
|
private int newNetworkType = 0;
|
||||||
@@ -768,22 +768,22 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
String ret = "unknown";
|
String ret = "unknown";
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DATA_ACCESS_GPRS:
|
case ServiceState.RADIO_TECHNOLOGY_GPRS:
|
||||||
ret = "GPRS";
|
ret = "GPRS";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_EDGE:
|
case ServiceState.RADIO_TECHNOLOGY_EDGE:
|
||||||
ret = "EDGE";
|
ret = "EDGE";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_UMTS:
|
case ServiceState.RADIO_TECHNOLOGY_UMTS:
|
||||||
ret = "UMTS";
|
ret = "UMTS";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_HSDPA:
|
case ServiceState.RADIO_TECHNOLOGY_HSDPA:
|
||||||
ret = "HSDPA";
|
ret = "HSDPA";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_HSUPA:
|
case ServiceState.RADIO_TECHNOLOGY_HSUPA:
|
||||||
ret = "HSUPA";
|
ret = "HSUPA";
|
||||||
break;
|
break;
|
||||||
case DATA_ACCESS_HSPA:
|
case ServiceState.RADIO_TECHNOLOGY_HSPA:
|
||||||
ret = "HSPA";
|
ret = "HSPA";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -1303,7 +1303,7 @@ final class GsmServiceStateTracker extends ServiceStateTracker {
|
|||||||
* that could support voice and data simultaneously.
|
* that could support voice and data simultaneously.
|
||||||
*/
|
*/
|
||||||
public boolean isConcurrentVoiceAndDataAllowed() {
|
public boolean isConcurrentVoiceAndDataAllowed() {
|
||||||
return (networkType >= DATA_ACCESS_UMTS);
|
return (networkType >= ServiceState.RADIO_TECHNOLOGY_UMTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user