本文整理匯總了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;
}