aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluca020400 <luca.stefani.ge1@gmail.com>2016-05-01 16:11:58 +0200
committerluca020400 <luca.stefani.ge1@gmail.com>2016-05-01 16:38:06 +0200
commit84c2a272bd6830b52bed04c00169ff6877eea43f (patch)
tree532fae0eee8c700cd8e6e0089b7d9511ba9961da
parentc23d4d9233064c82e7866b26c77a47e4d54a81aa (diff)
Z00L: Add vendor init
Change-Id: Ib307a4697e866df75e7e2cae154662f5fc572caf
-rw-r--r--BoardConfig.mk5
-rw-r--r--cm.mk6
-rw-r--r--init/init_Z00L.cpp97
3 files changed, 102 insertions, 6 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 48cb73a..082a59c 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -30,5 +30,10 @@ TARGET_KERNEL_CONFIG := cyanogenmod_Z00L_defconfig
# Properties
TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop
+# Vendor Unification Init
+TARGET_UNIFIED_DEVICE := true
+TARGET_INIT_VENDOR_LIB := libinit_msm
+TARGET_LIBINIT_DEFINES_FILE := $(DEVICE_PATH)/init/init_Z00L.cpp
+
# inherit from the proprietary version
-include vendor/asus/Z00L/BoardConfigVendor.mk
diff --git a/cm.mk b/cm.mk
index de5c324..fac4348 100644
--- a/cm.mk
+++ b/cm.mk
@@ -5,13 +5,7 @@ $(call inherit-product, vendor/cm/config/common_full_phone.mk)
PRODUCT_NAME := cm_Z00L
PRODUCT_BRAND := asus
-PRODUCT_MODEL := ASUS_Z00LD
PRODUCT_MANUFACTURER := asus
PRODUCT_DEVICE := Z00L
-PRODUCT_BUILD_PROP_OVERRIDES += \
- PRODUCT_NAME=WW_Z00L \
- BUILD_FINGERPRINT="asus/WW_Z00L/ASUS_Z00L:5.0.2/LRX22G/WW_user_1.17.40.1234_20160304:user/release-keys" \
- PRIVATE_BUILD_DESC="Z00L-user 5.0.2 LRX22G WW_user_1.17.40.1234_20160304 release-keys"
-
PRODUCT_GMS_CLIENTID_BASE := android-asus
diff --git a/init/init_Z00L.cpp b/init/init_Z00L.cpp
new file mode 100644
index 0000000..1c5103c
--- /dev/null
+++ b/init/init_Z00L.cpp
@@ -0,0 +1,97 @@
+/*
+ Copyright (c) 2013, 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:
+ * 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 <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "vendor_init.h"
+#include "property_service.h"
+#include "log.h"
+#include "util.h"
+
+#include "init_msm.h"
+
+void init_msm_properties(unsigned long msm_id , unsigned long msm_ver, char *board_type)
+{
+ char platform[PROP_VALUE_MAX];
+ char device[PROP_VALUE_MAX];
+ char PRJ_ID[PROP_VALUE_MAX];
+ char RF_SKU[PROP_VALUE_MAX];
+ int rc;
+ FILE *fp;
+
+ UNUSED(msm_id);
+ UNUSED(msm_ver);
+ UNUSED(board_type);
+
+ rc = property_get("ro.board.platform", platform);
+ if (!rc || !ISMATCH(platform, ANDROID_TARGET))
+ return;
+
+ fp = fopen("/proc/apid" , "r");
+ fgets(PRJ_ID, sizeof(PRJ_ID), fp);
+ pclose(fp);
+
+ fp = fopen("/proc/aprf" , "r");
+ fgets(RF_SKU, sizeof(RF_SKU), fp);
+ pclose(fp);
+
+ /* Common properties */
+ property_set("ro.build.product", "Z00L");
+ property_set("ro.build.description", "Z00L-user 5.0.2 LRX22G WW_user_1.17.40.1234_20160304 release-keys");
+
+ if (ISMATCH(PRJ_ID, "0\n")) {
+ if (ISMATCH(RF_SKU, "3\n")) {
+ /* ZE550KG */
+ property_set("ro.product.name", "WW_Z00W");
+ property_set("ro.product.model", "ASUS_Z00WD");
+ property_set("ro.product.device", "ASUS_Z00W_63");
+ property_set("ro.product.carrier", "US-ASUS_Z00W-WW_Z00W");
+ property_set("ro.build.fingerprint", "asus/WW_Z00W/ASUS_Z00W_63:5.0.2/LRX22G/WW_user_1.17.40.1234_20160304:user/release-keys");
+ } else {
+ /* ZE550KL */
+ property_set("ro.product.name", "WW_Z00L");
+ property_set("ro.product.model", "ASUS_Z00LD");
+ property_set("ro.product.device", "ASUS_Z00L");
+ property_set("ro.product.carrier", "US-ASUS_Z00L-WW_Z00L");
+ property_set("ro.build.fingerprint", "asus/WW_Z00L/ASUS_Z00L:5.0.2/LRX22G/WW_user_1.17.40.1234_20160304:user/release-keys");
+ }
+ } else if (ISMATCH(PRJ_ID, "1\n")) {
+ /* ZE601KL */
+ property_set("ro.product.name", "WW_Z00M");
+ property_set("ro.product.model", "ASUS_Z00MD");
+ property_set("ro.product.device", "ASUS_Z00M");
+ property_set("ro.product.carrier", "US-ASUS_Z00M-WW_Z00M");
+ property_set("ro.build.fingerprint", "asus/WW_Z00M/ASUS_Z00M:5.0.2/LRX22G/WW_user_1.17.40.1234_20160304:user/release-keys");
+ }
+
+ property_get("ro.product.device", device);
+ INFO("Found project id: %s sku id: %s setting build properties for %s device\n", PRJ_ID, RF_SKU, device);
+}