aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArvin Quilao <arquilao@gmail.com>2017-06-15 06:48:54 +0000
committerRygebin <kaankulahli@gmail.com>2017-06-24 09:36:46 +0000
commit714296b49f9d97581f502b17f8ee68abd0a3d083 (patch)
tree293ff83d98551553b9762e07a00c23c32127ef3a
parente049ee48c045604d633986701b1c1139c7a6a1cd (diff)
seed: Unify Android One variants
The device tree should support all 4 variants of Android One 2nd Gen. * Use init library to set the corresponding properties and build fingerprints. * Import additional properties from oem.prop Change-Id: Ife54224a6fcef177fc29509534ab4a41d4f535e3
-rw-r--r--board/init.mk3
-rw-r--r--init/init_seed.cpp90
-rw-r--r--product/display.mk20
-rw-r--r--product/oem.mk3
-rw-r--r--product/qcom-radio.mk3
-rw-r--r--system.prop4
6 files changed, 101 insertions, 22 deletions
diff --git a/board/init.mk b/board/init.mk
new file mode 100644
index 0000000..b36c0b4
--- /dev/null
+++ b/board/init.mk
@@ -0,0 +1,3 @@
+# seed init
+TARGET_LIBINIT_MSM8916_DEFINES_FILE := device/google/seed/init/init_seed.cpp
+TARGET_UNIFIED_DEVICE := true
diff --git a/init/init_seed.cpp b/init/init_seed.cpp
new file mode 100644
index 0000000..75334ee
--- /dev/null
+++ b/init/init_seed.cpp
@@ -0,0 +1,90 @@
+/*
+ Copyright (c) 2017, The LineageOS Project
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are
+ met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * 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
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <cstdlib>
+#include <fstream>
+#include <string>
+#include <sys/sysinfo.h>
+
+#include "vendor_init.h"
+#include "property_service.h"
+#include "log.h"
+#include "util.h"
+
+#include "init_msm8916.h"
+
+char const *heapstartsize;
+char const *heapgrowthlimit;
+char const *heapsize;
+char const *heapminfree;
+
+void check_device()
+{
+ struct sysinfo sys;
+
+ sysinfo(&sys);
+
+ if (sys.totalram > 1024ull * 1024 * 1024) {
+ // from - phone-xhdpi-2048-dalvik-heap.mk
+ heapstartsize = "8m";
+ heapgrowthlimit = "192m";
+ heapsize = "512m";
+ heapminfree = "512k";
+ } else {
+ // from - phone-xhdpi-1024-dalvik-heap.mk
+ heapstartsize = "8m";
+ heapgrowthlimit = "96m";
+ heapsize = "256m";
+ heapminfree = "2m";
+ }
+}
+
+void init_target_properties()
+{
+ check_device();
+
+ 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");
+
+ std::string device = property_get("ro.product.device");
+
+ if (device == "ctih220_sprout") {
+ property_set("ro.build.fingerprint", "google/ctih220/ctih220_sprout:7.1.1/N4F26W/3815918:user/release-keys");
+ } else if (device == "imobileiq2_sprout") {
+ property_set("ro.build.fingerprint", "google/imobileiq2/imobileiq2_sprout:7.1.1/N4F26W/3815918:user/release-keys");
+ } else if (device == "gm4g_sprout") {
+ property_set("ro.build.fingerprint", "google/gm4g/gm4g_sprout:7.1.1/N4F26W/3815918:user/release-keys");
+ } else if (device == "gm4g_s_sprout") {
+ property_set("ro.build.fingerprint", "google/gm4g_s/gm4g_s_sprout:7.1.1/N4F26W/3815918:user/release-keys");
+ }
+
+ property_set("ro.build.description", "seed_l8150-user 7.1.1 N4F26W 3815918 release-keys");
+}
diff --git a/product/display.mk b/product/display.mk
index 765d722..ec68b1a 100644
--- a/product/display.mk
+++ b/product/display.mk
@@ -14,22 +14,4 @@ PRODUCT_PROPERTY_OVERRIDES += \
PRODUCT_AAPT_CONFIG := normal
PRODUCT_AAPT_PREF_CONFIG := xhdpi
-PRODUCT_PROPERTY_OVERRIDES += \
- dalvik.vm.heapstartsize=8m \
- dalvik.vm.heapsize=256m \
- dalvik.vm.heaptargetutilization=0.75 \
- dalvik.vm.heapminfree=512k \
- dalvik.vm.heapmaxfree=8m
-
-PRODUCT_PROPERTY_OVERRIDES += \
- 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=1024
+$(call inherit-product, frameworks/native/build/phone-xxhdpi-2048-hwui-memory.mk)
diff --git a/product/oem.mk b/product/oem.mk
index 6900a7e..9d0fc0e 100644
--- a/product/oem.mk
+++ b/product/oem.mk
@@ -1,5 +1,8 @@
# Delegation for OEM customization
PRODUCT_SYSTEM_PROPERTY_BLACKLIST := \
+ ro.build.description \
+ ro.build.fingerprint \
+ ro.product.device \
ro.product.name \
ro.product.manufacturer \
ro.product.model
diff --git a/product/qcom-radio.mk b/product/qcom-radio.mk
index b785f7c..7878ec4 100644
--- a/product/qcom-radio.mk
+++ b/product/qcom-radio.mk
@@ -1,12 +1,11 @@
# Properties
PRODUCT_PROPERTY_OVERRIDES += \
- persist.radio.multisim.config=dsds \
persist.radio.custom_ecc=1 \
persist.radio.ecc_hard_1=998 \
persist.radio.ecc_hard_count=1 \
persist.sys.ssr.restart_level=modem \
rild.libpath=/system/vendor/lib/libril-qc-qmi-1.so \
- ro.telephony.default_network=9,9
+ ro.telephony.default_network=9
# RIL
ifeq ($(QCPATH),)
diff --git a/system.prop b/system.prop
index ca69732..e3fe052 100644
--- a/system.prop
+++ b/system.prop
@@ -2,6 +2,8 @@
ro.product.model.platform=1
# OEM props
-import /oem/oem.prop ro.product.name
+import /oem/oem.prop persist.radio.multisim.config
+import /oem/oem.prop ro.product.device
import /oem/oem.prop ro.product.manufacturer
import /oem/oem.prop ro.product.model
+import /oem/oem.prop ro.product.name