diff options
| author | Vachounet <vachounet@live.fr> | 2017-11-11 12:56:10 +0000 |
|---|---|---|
| committer | Wzedlare <vedatak01@gmail.com> | 2017-11-12 07:17:31 +0000 |
| commit | 8c85ee44821de5ffc01177a039c89882452515eb (patch) | |
| tree | 29af7f108cbbad38969d0ce3308f46757de2567b | |
| parent | f7fe69cfb37c20c2314cb6df65c4c4d802a8179b (diff) | |
cedric: Set proper props for rmt_storage and dalvik/hwui
* This should help for long boot time and unexpected sigkill
* This will also help to load proper modem firmware for current carrier/variant/model
* Dalvik & Hwui props are from NPP25.137-33 build.prop
Change-Id: Icae51778faded298390d7e68f4139ad5a5950e37
| -rw-r--r-- | device.mk | 2 | ||||
| -rw-r--r-- | init/init_cedric.cpp | 70 | ||||
| -rw-r--r-- | system.prop | 21 |
3 files changed, 60 insertions, 33 deletions
@@ -19,8 +19,6 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) # Overlay DEVICE_PACKAGE_OVERLAYS += device/motorola/cedric/overlay -$(call inherit-product-if-exists, frameworks/native/build/phone-xxhdpi-2048-hwui-memory.mk) - # These are the hardware-specific features PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.hardware.bluetooth.xml:system/etc/permissions/android.hardware.bluetooth.xml \ diff --git a/init/init_cedric.cpp b/init/init_cedric.cpp index 1e6b5df..1282be8 100644 --- a/init/init_cedric.cpp +++ b/init/init_cedric.cpp @@ -1,5 +1,6 @@ /* - Copyright (c) 2016, The CyanogenMod Project + Copyright (c) 2014, The Linux Foundation. All rights reserved. + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -12,6 +13,7 @@ * Neither the name of The Linux Foundation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT @@ -25,49 +27,55 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/sysinfo.h> +#include <stdlib.h> +#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#include <sys/_system_properties.h> +#include "vendor_init.h" #include "property_service.h" +#include "log.h" +#include "util.h" -char const *heapstartsize; -char const *heapgrowthlimit; -char const *heapsize; -char const *heapminfree; -char const *text_large_cache_height; -void check_device() +void property_override(char const prop[], char const value[]) { - struct sysinfo sys; + prop_info *pi; + + pi = (prop_info*) __system_property_find(prop); + if (pi) + __system_property_update(pi, value, strlen(value)); + else + __system_property_add(prop, strlen(prop), value, strlen(value)); +} - sysinfo(&sys); +void num_sims() { + std::string dualsim; - if (sys.totalram > 2048ull * 1024 * 1024) { - // from - phone-xxhdpi-3072-dalvik-heap.mk - heapstartsize = "8m"; - heapgrowthlimit = "192m"; - heapsize = "384m"; - heapminfree = "512k"; - text_large_cache_height = "2048"; + dualsim = property_get("ro.boot.dualsim"); + property_set("ro.hw.dualsim", dualsim.c_str()); + + if (dualsim == "true") { + property_set("persist.radio.multisim.config", "dsds"); } else { - // from - phone-xxhdpi-2048-dalvik-heap.mk - heapstartsize = "16m"; - heapgrowthlimit = "192m"; - heapsize = "512m"; - heapminfree = "2m"; - text_large_cache_height = "1024"; + property_set("persist.radio.multisim.config", ""); } } void vendor_load_properties() { - check_device(); + std::string platform = property_get("ro.board.platform"); + + return; + + std::string sku = property_get("ro.boot.hardware.sku"); + property_override("ro.product.model", sku.c_str()); - property_set("dalvik.vm.heapstartsize", heapstartsize); - property_set("dalvik.vm.heapgrowthlimit", heapgrowthlimit); - property_set("dalvik.vm.heapsize", heapsize); - property_set("dalvik.vm.heaptargetutilization", "0.75"); - property_set("dalvik.vm.heapminfree", heapminfree); - property_set("dalvik.vm.heapmaxfree", "8m"); + // rmt_storage + std::string device = property_get("ro.boot.device"); + std::string radio = property_get("ro.boot.radio"); + property_set("ro.hw.device", device.c_str()); + property_set("ro.hw.radio", radio.c_str()); + property_set("ro.hw.fps", "true"); - property_set("ro.hwui.text_large_cache_height", text_large_cache_height); + num_sims(); } diff --git a/system.prop b/system.prop index 039a554..9fc2203 100644 --- a/system.prop +++ b/system.prop @@ -89,6 +89,14 @@ persist.sys.cnd.iwlan=1 ro.core_ctl_max_cpu=4 ro.core_ctl_min_cpu=2 +# Dalvik +dalvik.vm.heapstartsize=8m +dalvik.vm.heapgrowthlimit=192m +dalvik.vm.heapsize=384m +dalvik.vm.heaptargetutilization=0.75 +dalvik.vm.heapminfree=512k +dalvik.vm.heapmaxfree=8m + # Display debug.egl.hw=1 debug.enable.sglscale=1 @@ -106,6 +114,19 @@ ro.sf.lcd_density=440 # FM ro.fm.transmitter=false +# HWUI +ro.hwui.texture_cache_size=72 +ro.hwui.layer_cache_size=48 +ro.hwui.r_buffer_cache_size=8 +ro.hwui.path_cache_size=32 +ro.hwui.gradient_cache_size=1 +ro.hwui.drop_shadow_cache_size=6 +ro.hwui.texture_cache_flushrate=0.4 +ro.hwui.text_small_cache_width=1024 +ro.hwui.text_small_cache_height=1024 +ro.hwui.text_large_cache_width=2048 +ro.hwui.text_large_cache_height=2048 + # IMS persist.radio.jbims=1 persist.radio.RATE_ADAPT_ENABLE=1 |
