Skip to content

Commit

Permalink
breeze: Adapt libinit to Android 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucchetto authored and Hadenix committed Nov 8, 2023
1 parent fbae5a3 commit 0648edd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
3 changes: 3 additions & 0 deletions init/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ cc_library_static {
include_dirs: [
"system/core/base/include",
"system/core/init"
],
shared_libs: [
"libbase",
]
}
24 changes: 16 additions & 8 deletions init/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <sys/_system_properties.h>

#include "vendor_init.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()
{
Expand Down Expand Up @@ -63,12 +71,12 @@ void load_dalvik_properties()
heapmaxfree = "8m";
}

property_set("dalvik.vm.heapstartsize", heapstartsize);
property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit);
property_set("dalvik.vm.heapsize", heapsize);
property_set("dalvik.vm.heaptargetutilization", heaptargetutilization);
property_set("dalvik.vm.heapminfree", heapminfree);
property_set("dalvik.vm.heapmaxfree", heapmaxfree);
property_override("dalvik.vm.heapstartsize", heapstartsize);
property_override("dalvik.vm.heapgrowthlimit", heapgrowthlimit);
property_override("dalvik.vm.heapsize", heapsize);
property_override("dalvik.vm.heaptargetutilization", heaptargetutilization);
property_override("dalvik.vm.heapminfree", heapminfree);
property_override("dalvik.vm.heapmaxfree", heapmaxfree);
}

void vendor_load_properties()
Expand Down

0 comments on commit 0648edd

Please sign in to comment.