Skip to content
Snippets Groups Projects
Commit 6f776f5a authored by Maciej Żenczykowski's avatar Maciej Żenczykowski
Browse files

BpfMap.java - add requires S+ annotation


Since the first mainline eBPF code (for Tethering offload)
landed in Android S.

Test: TreeHugger
Signed-off-by: default avatarMaciej Żenczykowski <maze@google.com>
Change-Id: Ifb44a43a98e7f0ff4cd59017b47f64eff30ee715
parent 9397e4eb
No related branches found
No related tags found
No related merge requests found
......@@ -16,9 +16,11 @@
package com.android.net.module.util;
import android.os.Build;
import android.system.ErrnoException;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
/**
*
......@@ -26,6 +28,7 @@ import androidx.annotation.NonNull;
* array type with key->int and value->uint64_t defined in the bpf program.
*
*/
@RequiresApi(Build.VERSION_CODES.S)
public class BpfBitmap {
private BpfMap<Struct.S32, Struct.S64> mBpfMap;
......
......@@ -18,12 +18,14 @@ package com.android.net.module.util;
import static android.system.OsConstants.EEXIST;
import static android.system.OsConstants.ENOENT;
import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.system.ErrnoException;
import android.util.Pair;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import java.io.IOException;
import java.nio.ByteBuffer;
......@@ -40,6 +42,7 @@ import java.util.concurrent.ConcurrentHashMap;
* @param <K> the key of the map.
* @param <V> the value of the map.
*/
@RequiresApi(Build.VERSION_CODES.S)
public class BpfMap<K extends Struct, V extends Struct> implements IBpfMap<K, V> {
static {
System.loadLibrary(JniUtil.getJniLibraryName(BpfMap.class.getPackage()));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment