rosemary: Adapt libinit to Android 11

This commit is contained in:
Lucchetto
2021-10-10 16:22:22 +01:00
committed by Matsvei Niaverau
parent 4bd9ec8009
commit 37a1f01aeb
2 changed files with 19 additions and 8 deletions

View File

@@ -23,5 +23,8 @@ cc_library_static {
include_dirs: [ include_dirs: [
"system/core/base/include", "system/core/base/include",
"system/core/init" "system/core/init"
],
shared_libs: [
"libbase",
] ]
} }

View File

@@ -20,10 +20,18 @@
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ #define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h> #include <sys/_system_properties.h>
#include "vendor_init.h"
#include "property_service.h" #include "property_service.h"
using android::init::property_set; void property_override(char const prop[], char const value[])
{
auto pi = (prop_info *) __system_property_find(prop);
if (pi != nullptr) {
__system_property_update(pi, value, strlen(value));
} else {
__system_property_add(prop, strlen(prop), value, strlen(value));
}
}
void load_dalvik_properties() void load_dalvik_properties()
{ {
@@ -63,12 +71,12 @@ void load_dalvik_properties()
heapmaxfree = "8m"; heapmaxfree = "8m";
} }
property_set("dalvik.vm.heapstartsize", heapstartsize); property_override("dalvik.vm.heapstartsize", heapstartsize);
property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit); property_override("dalvik.vm.heapgrowthlimit", heapgrowthlimit);
property_set("dalvik.vm.heapsize", heapsize); property_override("dalvik.vm.heapsize", heapsize);
property_set("dalvik.vm.heaptargetutilization", heaptargetutilization); property_override("dalvik.vm.heaptargetutilization", heaptargetutilization);
property_set("dalvik.vm.heapminfree", heapminfree); property_override("dalvik.vm.heapminfree", heapminfree);
property_set("dalvik.vm.heapmaxfree", heapmaxfree); property_override("dalvik.vm.heapmaxfree", heapmaxfree);
} }
void vendor_load_properties() void vendor_load_properties()