From ff62ae7a8988e9f7d3da788a862ca089636f2165 Mon Sep 17 00:00:00 2001 From: lolipuru Date: Sat, 17 Jun 2023 06:02:33 +0000 Subject: [PATCH] Spes: initial init script for fixing rice processor spacing issue Signed-off-by: lolipuru Signed-off-by: shripad-jyothinath --- BoardConfig.mk | 3 +++ init/Android.bp | 13 +++++++++++++ init/init_spes.cpp | 41 +++++++++++++++++++++++++++++++++++++++++ lineage_spes.mk | 6 ------ 4 files changed, 57 insertions(+), 6 deletions(-) create mode 100644 init/Android.bp create mode 100644 init/init_spes.cpp diff --git a/BoardConfig.mk b/BoardConfig.mk index 6d74264..ae466fb 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -117,6 +117,9 @@ TARGET_USES_CUSTOM_DISPLAY_INTERFACE := true # OTA assert TARGET_OTA_ASSERT_DEVICE := spes,spesn +# Init +TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):libinit_spes + # HIDL DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \ $(DEVICE_PATH)/configs/hidl/framework_compatibility_matrix.xml diff --git a/init/Android.bp b/init/Android.bp new file mode 100644 index 0000000..80a5e13 --- /dev/null +++ b/init/Android.bp @@ -0,0 +1,13 @@ +// Copyright (C) 2022 The LineageOS Project +// SPDX-License-Identifier: Apache-2.0 + +cc_library_static { + name: "libinit_spes", + recovery_available: true, + shared_libs: ["libbase"], + srcs: ["init_spes.cpp"], + include_dirs: [ + "system/core/init", + "system/libbase/include" + ] +} diff --git a/init/init_spes.cpp b/init/init_spes.cpp new file mode 100644 index 0000000..c6aeccc --- /dev/null +++ b/init/init_spes.cpp @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2023 The LineageOS 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. + */ + +#include +#include +#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ +#include +#include + +#include "property_service.h" +#include "vendor_init.h" + +void property_override(char const prop[], char const value[]) { + 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)); +} + +void vendor_load_properties() { + property_override("ro.rice.chipset", "Qualcomm® Snapdragon® 680 4G"); +} +void vendor_load_properties() { + property_override("ro.rising.maintainer", "Shripad Gamer🎮 "); +} diff --git a/lineage_spes.mk b/lineage_spes.mk index f3a3606..8d0308f 100644 --- a/lineage_spes.mk +++ b/lineage_spes.mk @@ -58,12 +58,6 @@ TARGET_FACE_UNLOCK_SUPPORTED := true #Dolby flags TARGET_EXCLUDES_AUDIOFX := true -#Chipset -RISING_CHIPSET := "Snapdragon-680" - -#Maintainer -RISING_MAINTAINER := "Shripad-J" - #Package type RISING_PACKAGE_TYPE := PIXEL