Convert unsigned uint8 fields in RIL interface to unsigned int.
Amit Mahajan [Tue, 16 May 2017 01:11:56 +0000 (18:11 -0700)]
Conversion is via byte which loses the unsigned-ness by default.

Test: basic telephony sanity
Bug: 37911659
Change-Id: I39312e8c280450d68aff016d9c582e24ecc43a0c

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

index 648d7c2..7cb0d25 100644 (file)
@@ -4815,7 +4815,7 @@ public final class RIL extends BaseCommands implements CommandsInterface {
     static ArrayList<Integer> convertHalLceData(LceDataInfo lce, RIL ril) {
         final ArrayList<Integer> capacityResponse = new ArrayList<Integer>();
         final int capacityDownKbps = lce.lastHopCapacityKbps;
-        final int confidenceLevel = lce.confidenceLevel;
+        final int confidenceLevel = Byte.toUnsignedInt(lce.confidenceLevel);
         final int lceSuspended = lce.lceSuspended ? 1 : 0;
 
         ril.riljLog("LCE capacity information received:" +
index 5b9a9bd..d298309 100644 (file)
@@ -1699,7 +1699,7 @@ public class RadioResponse extends IRadioResponse.Stub {
         if (rr != null) {
             ArrayList<Integer> ret = new ArrayList<Integer>();
             ret.add(statusInfo.lceStatus);
-            ret.add((int) statusInfo.actualIntervalMs);
+            ret.add(Byte.toUnsignedInt(statusInfo.actualIntervalMs));
             if (responseInfo.error == RadioError.NONE) {
                 sendMessageResponse(rr.mResult, ret);
             }