Skip bpf object loading on unsupported devices

The bpfloader should not try to load bpf objects on unsupported devices
since devices with 4.4 kernel can have bpf maps but not bpf pogram
support. Creating bpf maps on those devices would mislead the framework
code to use an unsupported code path and crash system server.

Bug: 130687855
Test: cuttlefish boot test for 4.4 kernel.
Change-Id: I43ffc01e1099ee3effaa6ba30aa78080d5bec72f
diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp
index 35b84de..01c02cc 100644
--- a/bpfloader/BpfLoader.cpp
+++ b/bpfloader/BpfLoader.cpp
@@ -92,8 +92,10 @@
         return 0;
     }
 
-    // Load all ELF objects, create programs and maps, and pin them
-    loadAllElfObjects();
+    if (android::bpf::getBpfSupportLevel() != android::bpf::BpfLevel::NONE) {
+        // Load all ELF objects, create programs and maps, and pin them
+        loadAllElfObjects();
+    }
 
     if (android::base::SetProperty("bpf.progs_loaded", "1") == false) {
         ALOGE("Failed to set bpf.progs_loaded property\n");