/**
* @return Signal strength (in dbM) from {@link cellInfo}. Returns {@link
* CellularSignalStrengthError#ERROR_NOT_SUPPORTED} if the signal strength is unavailable.
*/
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
private static int getSignalStrengthDbm(CellInfo cellInfo) {
if (cellInfo instanceof CellInfoCdma) {
return ((CellInfoCdma) cellInfo).getCellSignalStrength().getDbm();
}
if (cellInfo instanceof CellInfoGsm) {
return ((CellInfoGsm) cellInfo).getCellSignalStrength().getDbm();
}
if (cellInfo instanceof CellInfoLte) {
return ((CellInfoLte) cellInfo).getCellSignalStrength().getDbm();
}
if (cellInfo instanceof CellInfoWcdma) {
return ((CellInfoWcdma) cellInfo).getCellSignalStrength().getDbm();
}
return CellularSignalStrengthError.ERROR_NOT_SUPPORTED;
}
AndroidCellularSignalStrength.java 文件源码
java
阅读 24
收藏 0
点赞 0
评论 0
项目:365browser
作者:
评论列表
文章目录