本文整理汇总了Java中android.telephony.NeighboringCellInfo.UNKNOWN_RSSI属性的典型用法代码示例。如果您正苦于以下问题:Java NeighboringCellInfo.UNKNOWN_RSSI属性的具体用法?Java NeighboringCellInfo.UNKNOWN_RSSI怎么用?Java NeighboringCellInfo.UNKNOWN_RSSI使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类android.telephony.NeighboringCellInfo
的用法示例。
在下文中一共展示了NeighboringCellInfo.UNKNOWN_RSSI属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onSignalStrengthsChanged
/**
* Description: TODO: add more info
*
* Issues:
*
* [ ] Getting and comparing signal strengths between different RATs can be very
* tricky, since they all return different ranges of values. AOS doesn't
* specify very clearly what exactly is returned, even though people have
* a good idea, by trial and error.
*
* See note in : SignalStrengthTracker.java
*
* Notes:
*
*
*
*/
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
// Update Signal Strength
if (signalStrength.isGsm()) {
int dbm;
if (signalStrength.getGsmSignalStrength() <= 2 ||
signalStrength.getGsmSignalStrength() == NeighboringCellInfo.UNKNOWN_RSSI) {
// Unknown signal strength, get it another way
String[] bits = signalStrength.toString().split(" ");
dbm = Integer.parseInt(bits[9]);
} else {
dbm = signalStrength.getGsmSignalStrength();
}
mDevice.setSignalDbm(dbm);
} else {
int evdoDbm = signalStrength.getEvdoDbm();
int cdmaDbm = signalStrength.getCdmaDbm();
// Use lowest signal to be conservative
mDevice.setSignalDbm((cdmaDbm < evdoDbm) ? cdmaDbm : evdoDbm);
}
// Send it to signal tracker
signalStrengthTracker.registerSignalStrength(mDevice.mCell.getCID(), mDevice.getSignalDBm());
//signalStrengthTracker.isMysterious(mDevice.mCell.getCID(), mDevice.getSignalDBm());
}
示例2: onSignalStrengthsChanged
/**
* Description: TODO: add more info
*
* Issues:
*
* [ ] Getting and comparing signal strengths between different RATs can be very
* tricky, since they all return different ranges of values. AOS doesn't
* specify very clearly what exactly is returned, even though people have
* a good idea, by trial and error.
*
* See note in : SignalStrengthTracker.java
*/
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
// Update Signal Strength
if (signalStrength.isGsm()) {
int dbm;
if (signalStrength.getGsmSignalStrength() <= 2 ||
signalStrength.getGsmSignalStrength() == NeighboringCellInfo.UNKNOWN_RSSI) {
// Unknown signal strength, get it another way
String[] bits = signalStrength.toString().split(" ");
dbm = Integer.parseInt(bits[9]);
} else {
dbm = signalStrength.getGsmSignalStrength();
}
device.setSignalDbm(dbm);
} else {
int evdoDbm = signalStrength.getEvdoDbm();
int cdmaDbm = signalStrength.getCdmaDbm();
// Use lowest signal to be conservative
device.setSignalDbm((cdmaDbm < evdoDbm) ? cdmaDbm : evdoDbm);
}
// Send it to signal tracker
signalStrengthTracker.registerSignalStrength(device.cell.getCellId(), device.getSignalDBm());
//signalStrengthTracker.isMysterious(device.cell.getCid(), device.getSignalDBm());
}
示例3: convertGsmDbmToAsu
public static int convertGsmDbmToAsu(int dbm) {
if (dbm == Measurement.UNKNOWN_SIGNAL || dbm == NeighboringCellInfo.UNKNOWN_RSSI)
return Measurement.UNKNOWN_SIGNAL;
if (dbm <= -113)
return 0;
int asu = (dbm + 113) / 2;
if (asu > 31)
return 31;
return asu;
}
示例4: convertLteAsuToDbm
public static int convertLteAsuToDbm(int asu) {
if (asu == Measurement.UNKNOWN_SIGNAL || asu == NeighboringCellInfo.UNKNOWN_RSSI)
return Measurement.UNKNOWN_SIGNAL;
if (asu <= 0)
return -140;
if (asu >= 97)
return -43;
return asu - 140;
}
示例5: convertLteDbmToAsu
public static int convertLteDbmToAsu(int dbm) {
if (dbm == Measurement.UNKNOWN_SIGNAL || dbm == NeighboringCellInfo.UNKNOWN_RSSI)
return Measurement.UNKNOWN_SIGNAL;
if (dbm <= -140)
return 0;
if (dbm >= -43)
return 97;
return dbm + 140;
}
示例6: convertCdmaAsuToDbm
public static int convertCdmaAsuToDbm(int asu) {
if (asu == Measurement.UNKNOWN_SIGNAL || asu == NeighboringCellInfo.UNKNOWN_RSSI)
return Measurement.UNKNOWN_SIGNAL;
if (asu == 16)
return -75;
else if (asu == 8)
return -82;
else if (asu == 4)
return -90;
else if (asu == 2)
return -95;
else if (asu == 1)
return -100;
return Measurement.UNKNOWN_SIGNAL;
}
示例7: updateGsm
private void updateGsm(Measurement m, int asu) {
Log.d("update(): Updating GSM signal strength = %s", asu);
if (asu == NeighboringCellInfo.UNKNOWN_RSSI)
asu = Measurement.UNKNOWN_SIGNAL;
m.setGsmLocationSignal(asu, UnitConverter.convertGsmAsuToDbm(asu));
}
示例8: updateLte
private void updateLte(Measurement m, int dbm) {
Log.d("update(): Updating LTE signal strength = %s", dbm);
if (dbm == NeighboringCellInfo.UNKNOWN_RSSI)
dbm = Measurement.UNKNOWN_SIGNAL;
m.setGsmLocationSignal(UnitConverter.convertLteDbmToAsu(dbm), dbm);
}
示例9: convertGsmAsuToDbm
public static int convertGsmAsuToDbm(int asu) {
if (asu == Measurement.UNKNOWN_SIGNAL || asu == NeighboringCellInfo.UNKNOWN_RSSI)
return Measurement.UNKNOWN_SIGNAL;
return 2 * asu - 113;
}