Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b635fb8e authored by Nathan Harold's avatar Nathan Harold
Browse files

Fix BSIC Check in CellIdentityGsm

Because Java uses signed bytes, a comparison between
a byte and 0xFF will always fail after integer
promotion. Fix this by forcing 0xFF to be treated as
a byte for comparison.

Bug: 119224773
Test: fixes build breakage

Change-Id: I9615667a6b442060f1d43084d56bc9c3fdb3ba35
parent bd9da6de
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -77,13 +77,14 @@ public final class CellIdentityGsm extends CellIdentity {
    /** @hide */
    public CellIdentityGsm(android.hardware.radio.V1_0.CellIdentityGsm cid) {
        this(cid.lac, cid.cid, cid.arfcn,
                cid.bsic == 0xFF ? CellInfo.UNAVAILABLE : cid.bsic, cid.mcc, cid.mnc, "", "");
                cid.bsic == (byte) 0xFF ? CellInfo.UNAVAILABLE : cid.bsic,
                cid.mcc, cid.mnc, "", "");
    }

    /** @hide */
    public CellIdentityGsm(android.hardware.radio.V1_2.CellIdentityGsm cid) {
        this(cid.base.lac, cid.base.cid, cid.base.arfcn,
                cid.base.bsic == 0xFF ? CellInfo.UNAVAILABLE : cid.base.bsic, cid.base.mcc,
                cid.base.bsic == (byte) 0xFF ? CellInfo.UNAVAILABLE : cid.base.bsic, cid.base.mcc,
                cid.base.mnc, cid.operatorNames.alphaLong, cid.operatorNames.alphaShort);
    }