Force BSIC value to only one byte
Nathan Harold [Tue, 2 May 2017 20:31:00 +0000 (13:31 -0700)]
BSIC is being sign-extended when copied to a java integer.
Truncate the length keeping the magnitude of the lowest byte.

Bug: 37787893
Test: compilation
Change-Id: I7807be3321e9c90f23351549c86ebe03dc239d80
(cherry picked from commit b808a31b9b0b5104b4ff32860c7ff9d52c12a7c8)

src/java/com/android/internal/telephony/RIL.java

index 462887c..b008f05 100644 (file)
@@ -4827,7 +4827,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
                     p.writeInt(cellInfoGsm.cellIdentityGsm.lac);
                     p.writeInt(cellInfoGsm.cellIdentityGsm.cid);
                     p.writeInt(cellInfoGsm.cellIdentityGsm.arfcn);
-                    p.writeInt(cellInfoGsm.cellIdentityGsm.bsic);
+                    p.writeInt(Byte.toUnsignedInt(cellInfoGsm.cellIdentityGsm.bsic));
                     p.writeInt(cellInfoGsm.signalStrengthGsm.signalStrength);
                     p.writeInt(cellInfoGsm.signalStrengthGsm.bitErrorRate);
                     p.writeInt(cellInfoGsm.signalStrengthGsm.timingAdvance);