psi support for low memory detection inside ActivityManagerService

Add LowMemDetector class and use it in ActivityManagerService to detect
memory conditions based on in-kernel psi monitors.

Test: boots, detects low memory
Bug: 129476847
Change-Id: I7a05ba36196d24ce5147b97c076e38b92dc71e2e
Signed-off-by: Tim Murray <timmurray@google.com>
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index e1318af..6218498 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -51,6 +51,7 @@
         "com_android_server_PersistentDataBlockService.cpp",
         "com_android_server_GraphicsStatsService.cpp",
         "com_android_server_am_AppCompactor.cpp",
+        "com_android_server_am_LowMemDetector.cpp",
         "onload.cpp",
         ":lib_networkStatsFactory_native",
     ],
@@ -104,6 +105,7 @@
         "libbpf_android",
         "libnetdbpf",
         "libnetdutils",
+        "libpsi",
         "android.hardware.audio.common@2.0",
         "android.hardware.broadcastradio@1.0",
         "android.hardware.broadcastradio@1.1",