Merge "QOS: Check for portRange validity before filter matching" into sc-dev am: 98a11ef7b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15115572 Change-Id: Ib032982524cc16ec792f565b903223f912ee4b46
This commit is contained in:
committed by
Automerger Merge Worker
commit
862941ffdd
@@ -57,6 +57,12 @@ public final class QosBearerFilter implements Parcelable {
|
||||
public static final int QOS_PROTOCOL_UDP = android.hardware.radio.V1_6.QosProtocol.UDP;
|
||||
public static final int QOS_PROTOCOL_ESP = android.hardware.radio.V1_6.QosProtocol.ESP;
|
||||
public static final int QOS_PROTOCOL_AH = android.hardware.radio.V1_6.QosProtocol.AH;
|
||||
public static final int QOS_MIN_PORT = android.hardware.radio.V1_6.QosPortRange.MIN;
|
||||
/**
|
||||
* Hardcoded inplace of android.hardware.radio.V1_6.QosPortRange.MAX as it
|
||||
* returns -1 due to uint16_t to int conversion in java. (TODO: Fix the HAL)
|
||||
*/
|
||||
public static final int QOS_MAX_PORT = 65535; // android.hardware.radio.V1_6.QosPortRange.MIN;
|
||||
|
||||
@QosProtocol
|
||||
private int protocol;
|
||||
@@ -229,6 +235,12 @@ public final class QosBearerFilter implements Parcelable {
|
||||
return end;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return start >= QOS_MIN_PORT && start <= QOS_MAX_PORT
|
||||
&& end >= QOS_MIN_PORT && end <= QOS_MAX_PORT
|
||||
&& start <= end;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToParcel(@NonNull Parcel dest, int flags) {
|
||||
dest.writeInt(start);
|
||||
|
||||
Reference in New Issue
Block a user