Add SocketUtils for NetworkStack

These utilities can only be used for privileged apps. The underlying
implementation cannot be @SystemApi.

Test: m
Bug: 112869080
Change-Id: Idfa90561102e5b03ab2b79486d3ad46457128bf8
This commit is contained in:
Remi NGUYEN VAN
2019-01-23 23:11:12 +09:00
parent d57b49cb4b
commit 6f08bb23a1

View File

@@ -18,6 +18,9 @@ package android.net.apf;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.content.Context;
import com.android.internal.R;
/**
* APF program support capabilities.
@@ -74,4 +77,18 @@ public class ApfCapabilities {
public boolean hasDataAccess() {
return apfVersionSupported >= 4;
}
/**
* @return Whether the APF Filter in the device should filter out IEEE 802.3 Frames.
*/
public boolean getApfDrop8023Frames(Context context) {
return context.getResources().getBoolean(R.bool.config_apfDrop802_3Frames);
}
/**
* @return An array of blacklisted EtherType, packets with EtherTypes within it will be dropped.
*/
public int[] getApfEthTypeBlackList(Context context) {
return context.getResources().getIntArray(R.array.config_apfEthTypeBlackList);
}
}