From a2b00cbf9e9c63c865c711b6c873c63b9a4e89a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Thu, 27 Jul 2023 22:50:19 +0800 Subject: [PATCH] Bios (Android): add support --- CMakeLists.txt | 2 +- src/detection/bios/bios_android.c | 13 +++++++++++++ src/detection/bios/bios_nosupport.c | 6 ------ 3 files changed, 14 insertions(+), 7 deletions(-) create mode 100644 src/detection/bios/bios_android.c delete mode 100644 src/detection/bios/bios_nosupport.c diff --git a/CMakeLists.txt b/CMakeLists.txt index f54c012bc..4335df20a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -394,7 +394,7 @@ elseif(ANDROID) src/common/networking_linux.c src/common/processing_linux.c src/detection/battery/battery_android.c - src/detection/bios/bios_nosupport.c + src/detection/bios/bios_android.c src/detection/bluetooth/bluetooth_nosupport.c src/detection/board/board_android.c src/detection/brightness/brightness_nosupport.c diff --git a/src/detection/bios/bios_android.c b/src/detection/bios/bios_android.c new file mode 100644 index 000000000..737df08de --- /dev/null +++ b/src/detection/bios/bios_android.c @@ -0,0 +1,13 @@ +#include "bios.h" +#include "common/settings.h" + +const char* ffDetectBios(FFBiosResult* bios) +{ + if (!ffSettingsGetAndroidProperty("ro.bootloader", &bios->version)) + ffSettingsGetAndroidProperty("ro.boot.bootloader", &bios->version); + + if (ffStrbufIgnCaseEqualS(&bios->version, "unknown")) + ffStrbufClear(&bios->version); + + return NULL; +} diff --git a/src/detection/bios/bios_nosupport.c b/src/detection/bios/bios_nosupport.c deleted file mode 100644 index ac544fd3e..000000000 --- a/src/detection/bios/bios_nosupport.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "bios.h" - -const char* ffDetectBios(FF_MAYBE_UNUSED FFBiosResult* bios) -{ - return "Not supported on this platform"; -}