diff --git a/universal7885-common/libinit/init_universal7885.cpp b/universal7885-common/libinit/init_universal7885.cpp index ee67c4c..2c54346 100644 --- a/universal7885-common/libinit/init_universal7885.cpp +++ b/universal7885-common/libinit/init_universal7885.cpp @@ -27,6 +27,8 @@ #include +#include + #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #include @@ -71,6 +73,15 @@ static inline bool hasEnding(const std::string& str, char suffix) return !str.empty() && str.back() == suffix; } +static void setLowRamProp(void) { + static constexpr auto GB_3 = 3ull * 1024 * 1024 * 1024; + struct sysinfo sys {}; + + sysinfo(&sys); + if (sys.totalram <= GB_3) + property_override("ro.config.low_ram", "true"); +} + void vendor_load_properties() { std::string model; bool isNFC = false; @@ -95,6 +106,9 @@ void vendor_load_properties() { property_override("ro.boot.product.hardware.sku", "NFC"); } + // Set Low ram prop based on HW ram size + setLowRamProp(); + // Set model based on bootloader supplied model set_ro_build_prop("model", model); set_ro_build_prop("product", model, false);