From 2c1ea01f8c7a030b962584ff994a88e2c439f525 Mon Sep 17 00:00:00 2001 From: Olivier K Date: Sat, 19 Sep 2015 12:41:08 +0200 Subject: [PATCH] taoshan: Remove vendor init * Was causing several issues with recoveries. * C2104/C2105 don't differ significantly, so let's call them both "taoshan". * Also, re-organize some makefiles This reverts commit e0bd0d82b51aba93bb8cbbcaf6fd7d950b014837. Change-Id: I89614054c9b1108c8203c75bd679a35bd84d1433 --- AndroidProducts.mk | 2 +- BoardConfig.mk | 5 -- cm.dependencies | 4 -- cm.mk | 16 +++---- full_taoshan.mk | 33 ++++++++++++++ init/init_taoshan.c | 108 -------------------------------------------- taoshan.mk | 3 -- 7 files changed, 41 insertions(+), 130 deletions(-) create mode 100644 full_taoshan.mk delete mode 100644 init/init_taoshan.c diff --git a/AndroidProducts.mk b/AndroidProducts.mk index 41c9b51..b895a72 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -15,4 +15,4 @@ # PRODUCT_MAKEFILES := \ - $(LOCAL_DIR)/taoshan.mk + $(LOCAL_DIR)/full_taoshan.mk diff --git a/BoardConfig.mk b/BoardConfig.mk index 62adb66..d9373d7 100755 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -92,11 +92,6 @@ USE_OPENGL_RENDERER := true TARGET_USES_ION := true TARGET_USES_C2D_COMPOSITION := true -# Vendor Init -TARGET_UNIFIED_DEVICE := true -TARGET_INIT_VENDOR_LIB := libinit_msm -TARGET_LIBINIT_DEFINES_FILE := device/sony/taoshan/init/init_taoshan.c - # Wlan BOARD_HAS_QCOM_WLAN := true BOARD_WLAN_DEVICE := qcwcn diff --git a/cm.dependencies b/cm.dependencies index 36677da..340d278 100644 --- a/cm.dependencies +++ b/cm.dependencies @@ -3,10 +3,6 @@ "repository": "android_device_sony_common", "target_path": "device/sony/common" }, - { - "repository": "android_device_qcom_common", - "target_path": "device/qcom/common" - }, { "repository": "android_kernel_sony_msm8930", "target_path": "kernel/sony/msm8930" diff --git a/cm.mk b/cm.mk index de7e315..27952c3 100644 --- a/cm.mk +++ b/cm.mk @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -$(call inherit-product, device/sony/taoshan/taoshan.mk) +$(call inherit-product, device/sony/taoshan/full_taoshan.mk) # Enhanced NFC $(call inherit-product, vendor/cm/config/nfc_enhanced.mk) @@ -20,14 +20,12 @@ $(call inherit-product, vendor/cm/config/nfc_enhanced.mk) # Inherit CM common Phone stuff. $(call inherit-product, vendor/cm/config/common_full_phone.mk) -# Boot Animation -TARGET_SCREEN_HEIGHT := 854 -TARGET_SCREEN_WIDTH := 480 +# Set build fingerprint / ID / Prduct Name ect. +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRODUCT_NAME=C2105 \ + BUILD_FINGERPRINT="Sony/C2105/C2105:4.2.2/15.3.A.1.17/Android.1016:user/release-keys" \ + PRIVATE_BUILD_DESC="C2105-user 4.2.2 JDQ39 Android.1016 test-keys" -# Device identifier +# Override some inherited defines PRODUCT_DEVICE := taoshan PRODUCT_NAME := cm_taoshan -PRODUCT_BRAND := Sony -PRODUCT_MODEL := taoshan -PRODUCT_MANUFACTURER := Sony -PRODUCT_CHARACTERISTICS := phone diff --git a/full_taoshan.mk b/full_taoshan.mk new file mode 100644 index 0000000..948764a --- /dev/null +++ b/full_taoshan.mk @@ -0,0 +1,33 @@ +# Copyright (C) 2014 The CyanogenMod Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Boot animation +TARGET_SCREEN_HEIGHT := 854 +TARGET_SCREEN_WIDTH := 480 + +# Inherit from those products. Most specific first. +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) + +# Inherit common Sony resources +$(call inherit-product, device/sony/common/resources.mk) + +# Inherit device config +$(call inherit-product, device/sony/taoshan/taoshan.mk) + +# Device identifier +PRODUCT_DEVICE := taoshan +PRODUCT_NAME := full_taoshan +PRODUCT_BRAND := Sony +PRODUCT_MODEL := Xperia L +PRODUCT_MANUFACTURER := Sony diff --git a/init/init_taoshan.c b/init/init_taoshan.c deleted file mode 100644 index 1779780..0000000 --- a/init/init_taoshan.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - Copyright (c) 2014, CyanogenMod. 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 -#include -#include - -#include "vendor_init.h" -#include "property_service.h" -#include "log.h" -#include "util.h" - -#include "init_msm.h" - - -#define HW_MODEL_ID "/proc/cci_hw_model_name" -#define BUF_SIZE 64 -static char tmp[BUF_SIZE]; - -static int read_file2(const char *fname, char *data, int max_size) -{ - int fd, rc; - - if (max_size < 1) - return 0; - - fd = open(fname, O_RDONLY); - if (fd < 0) { - ERROR("failed to open '%s'\n", fname); - return 0; - } - - rc = read(fd, data, max_size - 1); - if ((rc > 0) && (rc < max_size)) - data[rc] = '\0'; - else - data[0] = '\0'; - close(fd); - - return 1; -} - -void init_msm_properties(unsigned long msm_id, unsigned long msm_ver, char *board_type) -{ - char platform[PROP_VALUE_MAX]; - int rc; - unsigned long hw_id = -1; - - UNUSED(msm_id); - UNUSED(msm_ver); - UNUSED(board_type); - - rc = property_get("ro.board.platform", platform); - if (!rc || !ISMATCH(platform, ANDROID_TARGET)) - return; - - /* Obtain model ID */ - rc = read_file2(HW_MODEL_ID, tmp, sizeof(tmp)); - if (rc) { - hw_id = strtoul(tmp, NULL, 0); - } - - /* Set common model number */ - property_set("ro.product.model", "Xperia L"); - - /* C2104 */ - if (hw_id==87) { - property_set("ro.build.description", "C2104-user 4.2.2 JDQ39 Android.1016 test-keys"); - property_set("ro.build.fingerprint", "Sony/C2104/C2104:4.2.2/15.3.A.1.17/Android.1016:user/release-keys"); - property_set("ro.build.product", "C2104"); - property_set("ro.product.device", "C2104"); - } - - /* C2105 otherwise */ - else { - property_set("ro.build.description", "C2105-user 4.2.2 JDQ39 Android.1016 test-keys"); - property_set("ro.build.fingerprint", "Sony/C2105/C2105:4.2.2/15.3.A.1.17/Android.1016:user/release-keys"); - property_set("ro.build.product", "C2105"); - property_set("ro.product.device", "C2105"); - } - -} diff --git a/taoshan.mk b/taoshan.mk index 4e2eddf..f159481 100755 --- a/taoshan.mk +++ b/taoshan.mk @@ -13,10 +13,7 @@ # limitations under the License. $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) $(call inherit-product, vendor/sony/taoshan/taoshan-vendor.mk) -$(call inherit-product, device/sony/common/resources.mk) - $(call inherit-product, frameworks/native/build/phone-xhdpi-1024-dalvik-heap.mk) # OpenGL ES 3.0