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

Commit 6887fbea authored by Brad Lassey's avatar Brad Lassey
Browse files

Treat gain as an unsigned int

Bug: 328131705
Test: Tested with CTS
Change-Id: I6437544bee3465b4f0c4a7f45277b87089af5192
parent 5cc0ba49
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -157,11 +157,7 @@ public final class PollingFrame implements Parcelable{
        mType = frame.getInt(KEY_POLLING_LOOP_TYPE);
        byte[] data = frame.getByteArray(KEY_POLLING_LOOP_DATA);
        mData = (data == null) ? new byte[0] : data;
        if (frame.containsKey(KEY_POLLING_LOOP_GAIN)) {
            mGain = frame.getByte(KEY_POLLING_LOOP_GAIN);
        } else {
            mGain = -1;
        }
        mGain = frame.getInt(KEY_POLLING_LOOP_GAIN, -1);
        mTimestamp = frame.getInt(KEY_POLLING_LOOP_TIMESTAMP);
    }

@@ -233,7 +229,7 @@ public final class PollingFrame implements Parcelable{
        Bundle frame = new Bundle();
        frame.putInt(KEY_POLLING_LOOP_TYPE, getType());
        if (getVendorSpecificGain() != -1) {
            frame.putByte(KEY_POLLING_LOOP_GAIN, (byte) getVendorSpecificGain());
            frame.putInt(KEY_POLLING_LOOP_GAIN, (byte) getVendorSpecificGain());
        }
        frame.putByteArray(KEY_POLLING_LOOP_DATA, getData());
        frame.putInt(KEY_POLLING_LOOP_TIMESTAMP, getTimestamp());