use of android.telephony.CellInfoCdma in project platform_packages_apps_Settings by BlissRoms.
the class RadioInfo method buildCellInfoString.
private final String buildCellInfoString(List<CellInfo> arrayCi) {
String value = new String();
StringBuilder cdmaCells = new StringBuilder(), gsmCells = new StringBuilder(), lteCells = new StringBuilder(), wcdmaCells = new StringBuilder();
if (arrayCi != null) {
for (CellInfo ci : arrayCi) {
if (ci instanceof CellInfoLte) {
lteCells.append(buildLteInfoString((CellInfoLte) ci));
} else if (ci instanceof CellInfoWcdma) {
wcdmaCells.append(buildWcdmaInfoString((CellInfoWcdma) ci));
} else if (ci instanceof CellInfoGsm) {
gsmCells.append(buildGsmInfoString((CellInfoGsm) ci));
} else if (ci instanceof CellInfoCdma) {
cdmaCells.append(buildCdmaInfoString((CellInfoCdma) ci));
}
}
if (lteCells.length() != 0) {
value += String.format("LTE\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s %-6.6s %-4.4s %-4.4s %-2.2s\n", "SRV", "MCC", "MNC", "TAC", "CID", "PCI", "EARFCN", "RSRP", "RSRQ", "TA");
value += lteCells.toString();
}
if (wcdmaCells.length() != 0) {
value += String.format("WCDMA\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-3.3s %-4.4s\n", "SRV", "MCC", "MNC", "LAC", "CID", "UARFCN", "PSC", "RSCP");
value += wcdmaCells.toString();
}
if (gsmCells.length() != 0) {
value += String.format("GSM\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-4.4s %-4.4s\n", "SRV", "MCC", "MNC", "LAC", "CID", "ARFCN", "BSIC", "RSSI");
value += gsmCells.toString();
}
if (cdmaCells.length() != 0) {
value += String.format("CDMA/EVDO\n%-3.3s %-5.5s %-5.5s %-5.5s %-6.6s %-6.6s %-6.6s %-6.6s %-5.5s\n", "SRV", "SID", "NID", "BSID", "C-RSSI", "C-ECIO", "E-RSSI", "E-ECIO", "E-SNR");
value += cdmaCells.toString();
}
} else {
value = "unknown";
}
return value.toString();
}
use of android.telephony.CellInfoCdma in project android_frameworks_opt_telephony by LineageOS.
the class Phone method privatizeCellInfoList.
/**
* Clear CDMA base station lat/long values if location setting is disabled.
* @param cellInfoList the original cell info list from the RIL
* @return the original list with CDMA lat/long cleared if necessary
*/
private List<CellInfo> privatizeCellInfoList(List<CellInfo> cellInfoList) {
if (cellInfoList == null)
return null;
int mode = Settings.Secure.getInt(getContext().getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_OFF);
if (mode == Settings.Secure.LOCATION_MODE_OFF) {
ArrayList<CellInfo> privateCellInfoList = new ArrayList<CellInfo>(cellInfoList.size());
// clear lat/lon values for location privacy
for (CellInfo c : cellInfoList) {
if (c instanceof CellInfoCdma) {
CellInfoCdma cellInfoCdma = (CellInfoCdma) c;
CellIdentityCdma cellIdentity = cellInfoCdma.getCellIdentity();
CellIdentityCdma maskedCellIdentity = new CellIdentityCdma(cellIdentity.getNetworkId(), cellIdentity.getSystemId(), cellIdentity.getBasestationId(), Integer.MAX_VALUE, Integer.MAX_VALUE);
CellInfoCdma privateCellInfoCdma = new CellInfoCdma(cellInfoCdma);
privateCellInfoCdma.setCellIdentity(maskedCellIdentity);
privateCellInfoList.add(privateCellInfoCdma);
} else {
privateCellInfoList.add(c);
}
}
cellInfoList = privateCellInfoList;
}
return cellInfoList;
}
use of android.telephony.CellInfoCdma in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class CellInfoUtil method wrapCellInfoWithCellIdentity.
/**
* Wrap a CellIdentity into a CellInfo.
*/
public static CellInfo wrapCellInfoWithCellIdentity(CellIdentity cellIdentity) {
if (cellIdentity instanceof CellIdentityLte) {
CellInfoLte cellInfo = new CellInfoLte();
cellInfo.setCellIdentity((CellIdentityLte) cellIdentity);
return cellInfo;
} else if (cellIdentity instanceof CellIdentityCdma) {
CellInfoCdma cellInfo = new CellInfoCdma();
cellInfo.setCellIdentity((CellIdentityCdma) cellIdentity);
return cellInfo;
} else if (cellIdentity instanceof CellIdentityWcdma) {
CellInfoWcdma cellInfo = new CellInfoWcdma();
cellInfo.setCellIdentity((CellIdentityWcdma) cellIdentity);
return cellInfo;
} else if (cellIdentity instanceof CellIdentityGsm) {
CellInfoGsm cellInfo = new CellInfoGsm();
cellInfo.setCellIdentity((CellIdentityGsm) cellIdentity);
return cellInfo;
} else {
Log.e(TAG, "Invalid CellInfo type");
return null;
}
}
use of android.telephony.CellInfoCdma in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class CellInfoUtil method getOperatorInfoFromCellInfo.
/**
* Wrap a cell info into an operator info.
*/
public static OperatorInfo getOperatorInfoFromCellInfo(CellInfo cellInfo) {
OperatorInfo oi;
if (cellInfo instanceof CellInfoLte) {
CellInfoLte lte = (CellInfoLte) cellInfo;
oi = new OperatorInfo((String) lte.getCellIdentity().getOperatorAlphaLong(), (String) lte.getCellIdentity().getOperatorAlphaShort(), lte.getCellIdentity().getMobileNetworkOperator());
} else if (cellInfo instanceof CellInfoWcdma) {
CellInfoWcdma wcdma = (CellInfoWcdma) cellInfo;
oi = new OperatorInfo((String) wcdma.getCellIdentity().getOperatorAlphaLong(), (String) wcdma.getCellIdentity().getOperatorAlphaShort(), wcdma.getCellIdentity().getMobileNetworkOperator());
} else if (cellInfo instanceof CellInfoGsm) {
CellInfoGsm gsm = (CellInfoGsm) cellInfo;
oi = new OperatorInfo((String) gsm.getCellIdentity().getOperatorAlphaLong(), (String) gsm.getCellIdentity().getOperatorAlphaShort(), gsm.getCellIdentity().getMobileNetworkOperator());
} else if (cellInfo instanceof CellInfoCdma) {
CellInfoCdma cdma = (CellInfoCdma) cellInfo;
oi = new OperatorInfo((String) cdma.getCellIdentity().getOperatorAlphaLong(), (String) cdma.getCellIdentity().getOperatorAlphaShort(), "");
} else {
Log.e(TAG, "Invalid CellInfo type");
oi = new OperatorInfo("", "", "");
}
return oi;
}
use of android.telephony.CellInfoCdma in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class RadioInfo method buildCellInfoString.
private final String buildCellInfoString(List<CellInfo> arrayCi) {
String value = new String();
StringBuilder cdmaCells = new StringBuilder(), gsmCells = new StringBuilder(), lteCells = new StringBuilder(), wcdmaCells = new StringBuilder();
if (arrayCi != null) {
for (CellInfo ci : arrayCi) {
if (ci instanceof CellInfoLte) {
lteCells.append(buildLteInfoString((CellInfoLte) ci));
} else if (ci instanceof CellInfoWcdma) {
wcdmaCells.append(buildWcdmaInfoString((CellInfoWcdma) ci));
} else if (ci instanceof CellInfoGsm) {
gsmCells.append(buildGsmInfoString((CellInfoGsm) ci));
} else if (ci instanceof CellInfoCdma) {
cdmaCells.append(buildCdmaInfoString((CellInfoCdma) ci));
}
}
if (lteCells.length() != 0) {
value += String.format("LTE\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-3.3s" + " %-6.6s %-2.2s %-4.4s %-4.4s %-2.2s\n", "SRV", "MCC", "MNC", "TAC", "CID", "PCI", "EARFCN", "BW", "RSRP", "RSRQ", "TA");
value += lteCells.toString();
}
if (wcdmaCells.length() != 0) {
value += String.format("WCDMA\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-3.3s %-4.4s\n", "SRV", "MCC", "MNC", "LAC", "CID", "UARFCN", "PSC", "RSCP");
value += wcdmaCells.toString();
}
if (gsmCells.length() != 0) {
value += String.format("GSM\n%-3.3s %-3.3s %-3.3s %-5.5s %-5.5s %-6.6s %-4.4s %-4.4s\n", "SRV", "MCC", "MNC", "LAC", "CID", "ARFCN", "BSIC", "RSSI");
value += gsmCells.toString();
}
if (cdmaCells.length() != 0) {
value += String.format("CDMA/EVDO\n%-3.3s %-5.5s %-5.5s %-5.5s %-6.6s %-6.6s %-6.6s %-6.6s %-5.5s\n", "SRV", "SID", "NID", "BSID", "C-RSSI", "C-ECIO", "E-RSSI", "E-ECIO", "E-SNR");
value += cdmaCells.toString();
}
} else {
value = "unknown";
}
return value.toString();
}
Aggregations