Flipping NR signal strengths coming from HAL
The documentation of NrSignalStrength states that some of the cell signal strength values should be flipped when taken in from the HAL (this matches what LTE does.) The current implementation did not match this behavior, this chagne fixes that. Bug: 144667130 Test: FrameworkTests Change-Id: Ica2595c5b6480a52209fe5ec93de63c9f323316a Merged-In: Ica2595c5b6480a52209fe5ec93de63c9f323316a
This commit is contained in:
@@ -155,7 +155,17 @@ public final class CellSignalStrengthNr extends CellSignalStrength implements Pa
|
||||
* @param ss signal strength from modem.
|
||||
*/
|
||||
public CellSignalStrengthNr(android.hardware.radio.V1_4.NrSignalStrength ss) {
|
||||
this(ss.csiRsrp, ss.csiRsrq, ss.csiSinr, ss.ssRsrp, ss.ssRsrq, ss.ssSinr);
|
||||
this(flip(ss.csiRsrp), flip(ss.csiRsrq), ss.csiSinr, flip(ss.ssRsrp), flip(ss.ssRsrq),
|
||||
ss.ssSinr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Flip sign cell strength value when taking in the value from hal
|
||||
* @param val cell strength value
|
||||
* @return flipped value
|
||||
*/
|
||||
private static int flip(int val) {
|
||||
return val != CellInfo.UNAVAILABLE ? -val : val;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user