Skip to content

Commit

Permalink
Merge "BQR: add new fields for sco choppy event" into q-keystone-qcom…
Browse files Browse the repository at this point in the history
…-dev
  • Loading branch information
Treehugger Robot authored and Gerrit Code Review committed Nov 18, 2019
2 parents 10c03b5 + ac187dd commit 672fe2a
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions core/java/android/bluetooth/BluetoothQualityReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import android.os.Parcelable;
import android.util.Log;

import java.nio.BufferUnderflowException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.Arrays;
Expand Down Expand Up @@ -1117,6 +1118,10 @@ public class BqrVsScoChoppy implements Parcelable {
private int mSprIntrMiss;
private int mPlcFillCount;
private int mPlcDiscardCount;
private int mMissedInstanceCount;
private int mTxRetransmitSlotCount;
private int mRxRetransmitSlotCount;
private int mGoodRxFrameCount;

private BqrVsScoChoppy(byte[] rawData, int offset) {
if (rawData == null || rawData.length <= offset) {
Expand All @@ -1141,6 +1146,14 @@ private BqrVsScoChoppy(byte[] rawData, int offset) {
mSprIntrMiss = bqrBuf.getShort() & 0xFFFF;
mPlcFillCount = bqrBuf.getShort() & 0xFFFF;
mPlcDiscardCount = bqrBuf.getShort() & 0xFFFF;
try {
mMissedInstanceCount = bqrBuf.getShort() & 0xFFFF;
mTxRetransmitSlotCount = bqrBuf.getShort() & 0xFFFF;
mRxRetransmitSlotCount = bqrBuf.getShort() & 0xFFFF;
mGoodRxFrameCount = bqrBuf.getShort() & 0xFFFF;
} catch (BufferUnderflowException e) {
Log.v(TAG, "some fields are not contained");
}
}

private BqrVsScoChoppy(Parcel in) {
Expand All @@ -1158,6 +1171,10 @@ private BqrVsScoChoppy(Parcel in) {
mSprIntrMiss = in.readInt();
mPlcFillCount = in.readInt();
mPlcDiscardCount = in.readInt();
mMissedInstanceCount = in.readInt();
mTxRetransmitSlotCount = in.readInt();
mRxRetransmitSlotCount = in.readInt();
mGoodRxFrameCount = in.readInt();
}

/**
Expand Down Expand Up @@ -1284,6 +1301,38 @@ public int getPlcDiscardCount() {
return mPlcDiscardCount;
}

/**
* Get the count of sco instances missed.
* @return the count of sco instances missed.
*/
public int getMissedInstanceCount() {
return mMissedInstanceCount;
}

/**
* Get the count of slots for Tx retransmission.
* @return the count of slots for Tx retransmission.
*/
public int getTxRetransmitSlotCount() {
return mTxRetransmitSlotCount;
}

/**
* Get the count of slots for Rx retransmission.
* @return the count of slots for Rx retransmission.
*/
public int getRxRetransmitSlotCount() {
return mRxRetransmitSlotCount;
}

/**
* Get the count of Rx good packets
* @return the count of Rx good packets.
*/
public int getGoodRxFrameCount() {
return mGoodRxFrameCount;
}

public int describeContents() {
return 0;
}
Expand All @@ -1304,6 +1353,10 @@ public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(mSprIntrMiss);
dest.writeInt(mPlcFillCount);
dest.writeInt(mPlcDiscardCount);
dest.writeInt(mMissedInstanceCount);
dest.writeInt(mTxRetransmitSlotCount);
dest.writeInt(mRxRetransmitSlotCount);
dest.writeInt(mGoodRxFrameCount);
}

@Override
Expand All @@ -1326,6 +1379,11 @@ public String toString() {
+ ", mSprIntrMiss: " + mSprIntrMiss
+ ", mPlcFillCount: " + mPlcFillCount
+ ", mPlcDiscardCount: " + mPlcDiscardCount
+ ", mMissedInstanceCount: " + mMissedInstanceCount
+ ", mTxRetransmitSlotCount: " + mTxRetransmitSlotCount
+ ",\n"
+ " mRxRetransmitSlotCount: " + mRxRetransmitSlotCount
+ ", mGoodRxFrameCount: " + mGoodRxFrameCount
+ "\n }";

return str;
Expand Down

0 comments on commit 672fe2a

Please sign in to comment.