diff --git a/Android.mk b/Android.mk index e2c719de..7860b336 100644 --- a/Android.mk +++ b/Android.mk @@ -255,7 +255,7 @@ $(BDWLAN_SYMLINKS): $(LOCAL_INSTALLED_MODULE) @echo "BDWLAN firmware link: $@" @mkdir -p $(dir $@) @rm -rf $@ - $(hide) ln -sf /mnt/vendor/persist-lg/wifi/qcom/$(notdir $(basename $@)_cache.bin) $@ + $(hide) ln -sf /vendor/etc/wifi/$(notdir $@) $@ WCNSS_INI_SYMLINK := $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/WCNSS_qcom_cfg.ini $(WCNSS_INI_SYMLINK): $(LOCAL_INSTALLED_MODULE) diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index e66396b8..d5855ba4 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -16,8 +16,10 @@ COMMON_PATH := device/lge/sdm845-common -# inherit from common lge --include device/lge/common/BoardConfigCommon.mk +BOARD_VENDOR := lge + +# Inherit from the proprietary version +include vendor/lge/sdm845-common/BoardConfigVendor.mk # Architecture TARGET_ARCH := arm64 @@ -95,6 +97,9 @@ USE_DEVICE_SPECIFIC_GPS := true BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM) BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET := true +# Health +TARGET_HEALTH_CHARGING_CONTROL_CHARGING_PATH := /sys/class/power_supply/battery/battery_charging_enabled + # HIDL DEVICE_MANIFEST_FILE += $(COMMON_PATH)/manifest.xml DEVICE_MATRIX_FILE += $(COMMON_PATH)/compatibility_matrix.xml @@ -171,12 +176,12 @@ ENABLE_VENDOR_RIL_SERVICE := true #TARGET_PROVIDES_QTI_TELEPHONY_JAR := true TARGET_RIL_VARIANT := caf -# Sepolicy +# SELinux include device/qcom/sepolicy_vndr-legacy-um/SEPolicy.mk +include hardware/lge/sepolicy/SEPolicy.mk BOARD_VENDOR_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor -PRODUCT_PRIVATE_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/private -PRODUCT_PUBLIC_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/public -SELINUX_IGNORE_NEVERALLOWS := true +SYSTEM_EXT_PRIVATE_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/private +SYSTEM_EXT_PUBLIC_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/public # Soong namespaces PRODUCT_SOONG_NAMESPACES += $(VENDOR_PATH) @@ -212,6 +217,3 @@ WIFI_HIDL_UNIFIED_SUPPLICANT_SERVICE_RC_ENTRY := true # Broken R BUILD_BROKEN_PREBUILT_ELF_FILES := true BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES := true - -# Inherit from the proprietary version --include vendor/lge/sdm845-common/BoardConfigVendor.mk diff --git a/gps/gps.conf b/gps/gps.conf index b80dab61..4f24a30d 100644 --- a/gps/gps.conf +++ b/gps/gps.conf @@ -4,7 +4,7 @@ ERR_ESTIMATE=0 #NTP server -NTP_SERVER=time.xtracloud.net +NTP_SERVER=2.android.pool.ntp.org #XTRA CA path XTRA_CA_PATH=/usr/lib/ssl-1.1/certs @@ -12,13 +12,13 @@ XTRA_CA_PATH=/usr/lib/ssl-1.1/certs # DEBUG LEVELS: 0 - none, 1 - Error, 2 - Warning, 3 - Info # 4 - Debug, 5 - Verbose # If DEBUG_LEVEL is commented, Android's logging levels will be used -DEBUG_LEVEL = 3 +DEBUG_LEVEL = 2 # Intermediate position report, 1=enable, 0=disable -INTERMEDIATE_POS=0 +INTERMEDIATE_POS=1 -# supl version 1.0 -SUPL_VER=0x10000 +# supl version 3.0 +SUPL_VER=0x30000 # Emergency SUPL, 1=enable, 0=disable SUPL_ES=1 @@ -45,7 +45,7 @@ CAPABILITIES=0x17 # Accuracy threshold for intermediate positions # less accurate positions are ignored, 0 for passing all positions -# ACCURACY_THRES=5000 +ACCURACY_THRES=1 ################################ ##### AGPS server settings ##### @@ -146,7 +146,7 @@ SGLTE_TARGET=0 # 0x1: RRC CPlane # 0x2: RRLP UPlane # 0x4: LLP Uplane -A_GLONASS_POS_PROTOCOL_SELECT = 0 +A_GLONASS_POS_PROTOCOL_SELECT = 0x4 ################################################## # Select technology for LPPe Control Plane @@ -155,7 +155,7 @@ A_GLONASS_POS_PROTOCOL_SELECT = 0 # 0x2: WLAN AP Measurements for LPPe CP # 0x4: SRN AP measurement for CP # 0x8: Sensor Barometer Measurement LPPe CP -#LPPE_CP_TECHNOLOGY = 0 +LPPE_CP_TECHNOLOGY = 0x10 ################################################## # Select technology for LPPe User Plane @@ -164,7 +164,7 @@ A_GLONASS_POS_PROTOCOL_SELECT = 0 # 0x2: WLAN AP Measurements for LPPe UP # 0x4: SRN AP measurement for UP # 0x8: Sensor Barometer Measurement LPPe UP -#LPPE_UP_TECHNOLOGY = 0 +LPPE_UP_TECHNOLOGY = 0x10 ################################################## # AGPS_CONFIG_INJECT diff --git a/gps/izat.conf b/gps/izat.conf index 18df1261..fea5a80a 100644 --- a/gps/izat.conf +++ b/gps/izat.conf @@ -188,7 +188,7 @@ VENDOR_ENHANCED_PROCESS=0 PROCESS_NAME=xtwifi-inet-agent PROCESS_ARGUMENT= -PROCESS_STATE=ENABLED +PROCESS_STATE=DISABLED PROCESS_GROUPS=inet gps PREMIUM_FEATURE=1 IZAT_FEATURE_MASK=0xc03 @@ -201,7 +201,7 @@ VENDOR_ENHANCED_PROCESS=1 PROCESS_NAME=xtwifi-client PROCESS_ARGUMENT= -PROCESS_STATE=ENABLED +PROCESS_STATE=DISABLED PROCESS_GROUPS=wifi inet gps system oem_2904 PREMIUM_FEATURE=1 IZAT_FEATURE_MASK=0xd03 diff --git a/light/Android.bp b/light/Android.bp deleted file mode 100644 index df4fd412..00000000 --- a/light/Android.bp +++ /dev/null @@ -1,31 +0,0 @@ -// -// Copyright (C) 2017 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. - -cc_binary { - relative_install_path: "hw", - defaults: ["hidl_defaults"], - name: "android.hardware.light@2.0-service.lge_sdm845", - proprietary: true, - init_rc: ["android.hardware.light@2.0-service.lge_sdm845.rc"], - srcs: ["service.cpp", "Light.cpp"], - shared_libs: [ - "libbase", - "libhardware", - "libhidlbase", - "liblog", - "libutils", - "android.hardware.light@2.0", - ], -} diff --git a/light/Light.cpp b/light/Light.cpp deleted file mode 100644 index 725f0642..00000000 --- a/light/Light.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (C) 2017 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. - */ - -#define LOG_TAG "LightService" - -#include "Light.h" -#include -#include - -namespace android { -namespace hardware { -namespace light { -namespace V2_0 { -namespace implementation { - -/* - * Write value to path and close file. - */ -template -static void set(const std::string& path, const T& value) { - std::ofstream file(path); - file << value; -} - -template -static T get(const std::string& path, const T& def) { - std::ifstream file(path); - T result; - - file >> result; - return file.fail() ? def : result; -} - -static int rgbToBrightness(const LightState& state) { - int color = state.color & 0x00ffffff; - return ((77 * ((color >> 16) & 0x00ff)) - + (150 * ((color >> 8) & 0x00ff)) - + (29 * (color & 0x00ff))) >> 8; -} - -static bool isLit(const LightState& state) { - return (state.color & 0x00ffffff); -} - -void Light::setLightLocked(const LightState& state) { - int onMS, offMS; - uint32_t color; - char pattern[PAGE_SIZE]; - - switch (state.flashMode) { - case Flash::TIMED: - onMS = state.flashOnMs; - offMS = state.flashOffMs; - break; - case Flash::NONE: - onMS = 0; - offMS = 0; - break; - default: - onMS = -1; - offMS = -1; - break; - } - - color = state.color & 0x00ffffff; - - if (offMS <= 0) { - sprintf(pattern,"0x%06x", color); - ALOGD("%s: Using onoff pattern: inColor=0x%06x\n", __func__, color); - set(LED ONOFF_PATTERN, pattern); - } else { - sprintf(pattern,"0x%06x,%d,%d", color, onMS, offMS); - ALOGD("%s: Using blink pattern: inColor=0x%06x delay_on=%d, delay_off=%d\n", - __func__, color, onMS, offMS); - set(LED BLINK_PATTERN, pattern); - } -} - -void Light::checkLightStateLocked() { - if (isLit(mNotificationState)) { - setLightLocked(mNotificationState); - } else if (isLit(mAttentionState)) { - setLightLocked(mAttentionState); - } else if (isLit(mBatteryState)) { - setLightLocked(mBatteryState); - } else { - /* Lights off */ - set(LED BLINK_PATTERN, "0x0,-1,-1"); - set(LED ONOFF_PATTERN, "0x0"); - } -} - -void Light::handleAttention(const LightState& state) { - mAttentionState = state; - checkLightStateLocked(); -} - -void Light::handleBacklight(const LightState& state) { - int brightness, brightnessEx; - int sentBrightness = rgbToBrightness(state); - if(sentBrightness < 35) { - brightness = sentBrightness * 2; - brightnessEx = sentBrightness * 2; - } else { - brightness = sentBrightness * mMaxBrightness / 255; - brightnessEx = sentBrightness * mMaxBrightnessEx / 255; - } - set(BL BRIGHTNESS, brightness); - set(BL_EX BRIGHTNESS, brightnessEx); -} - -void Light::handleBattery(const LightState& state) { - mBatteryState = state; - checkLightStateLocked(); -} - -void Light::handleNotifications(const LightState& state) { - mNotificationState = state; - checkLightStateLocked(); -} - -Light::Light(bool hasBacklight, bool hasBlinkPattern, bool hasOnOffPattern) { - auto attnFn(std::bind(&Light::handleAttention, this, std::placeholders::_1)); - auto backlightFn(std::bind(&Light::handleBacklight, this, std::placeholders::_1)); - auto batteryFn(std::bind(&Light::handleBattery, this, std::placeholders::_1)); - auto notifFn(std::bind(&Light::handleNotifications, this, std::placeholders::_1)); - - if(hasBacklight) - mLights.emplace(Type::BACKLIGHT, backlightFn); - - if(hasBlinkPattern && hasOnOffPattern) { - mLights.emplace(Type::ATTENTION, attnFn); - mLights.emplace(Type::BATTERY, batteryFn); - mLights.emplace(Type::NOTIFICATIONS, notifFn); - } - - mMaxBrightness = get(BL MAX_BRIGHTNESS, -1); - mMaxBrightnessEx = get(BL_EX MAX_BRIGHTNESS, -1); - if (mMaxBrightness < 0) { - mMaxBrightness = 255; - } - if (mMaxBrightnessEx < 0) { - mMaxBrightnessEx = 255; - } -} - -Return Light::setLight(Type type, const LightState& state) { - auto it = mLights.find(type); - - if (it == mLights.end()) { - return Status::LIGHT_NOT_SUPPORTED; - } - - /* - * Lock global mutex until light state is updated. - */ - std::lock_guard lock(globalLock); - - it->second(state); - - return Status::SUCCESS; -} - -Return Light::getSupportedTypes(getSupportedTypes_cb _hidl_cb) { - std::vector types; - - for (auto const& light : mLights) types.push_back(light.first); - - _hidl_cb(types); - - return Void(); -} - -} // namespace implementation -} // namespace V2_0 -} // namespace light -} // namespace hardware -} // namespace android diff --git a/light/Light.h b/light/Light.h deleted file mode 100644 index 607fdab7..00000000 --- a/light/Light.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2017 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. - */ -#ifndef ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H -#define ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H - -#include -#include -#include -#include -#include -#include - -#define BL "/sys/class/backlight/panel0-backlight/" - -#define BL_EX "/sys/class/backlight/panel0-backlight-ex/" - -#define LP_MODE "/sys/devices/virtual/panel/factory/low_power_mode" - -#define BRIGHTNESS "brightness" -#define MAX_BRIGHTNESS "max_brightness" - -#define LED "/sys/class/lg_rgb_led/use_patterns/" - -#define BLINK_PATTERN "blink_patterns" -#define ONOFF_PATTERN "onoff_patterns" - -namespace android { -namespace hardware { -namespace light { -namespace V2_0 { -namespace implementation { - -using ::android::hardware::Return; -using ::android::hardware::Void; -using ::android::hardware::hidl_vec; -using ::android::hardware::light::V2_0::ILight; -using ::android::hardware::light::V2_0::LightState; -using ::android::hardware::light::V2_0::Status; -using ::android::hardware::light::V2_0::Type; - -class Light : public ILight { - public: - Light(bool hasBacklight, bool hasBlinkPattern, bool hasOnOffPattern); - - Return setLight(Type type, const LightState& state) override; - Return getSupportedTypes(getSupportedTypes_cb _hidl_cb) override; - - private: - void setLightLocked(const LightState& state); - void checkLightStateLocked(); - void handleAttention(const LightState& state); - void handleBacklight(const LightState& state); - void handleBattery(const LightState& state); - void handleNotifications(const LightState& state); - - std::mutex globalLock; - - LightState mAttentionState; - LightState mBatteryState; - LightState mNotificationState; - - std::map> mLights; - - int mMaxBrightness = 255; - int mMaxBrightnessEx = 255; -}; - -} // namespace implementation -} // namespace V2_0 -} // namespace light -} // namespace hardware -} // namespace android - -#endif // ANDROID_HARDWARE_LIGHT_V2_0_LIGHT_H diff --git a/light/android.hardware.light@2.0-service.lge_sdm845.rc b/light/android.hardware.light@2.0-service.lge_sdm845.rc deleted file mode 100644 index 646011a6..00000000 --- a/light/android.hardware.light@2.0-service.lge_sdm845.rc +++ /dev/null @@ -1,5 +0,0 @@ -service vendor.light-hal-2-0 /vendor/bin/hw/android.hardware.light@2.0-service.lge_sdm845 - class hal - user system - group system - interface android.hardware.light@2.0::ILight default diff --git a/light/service.cpp b/light/service.cpp deleted file mode 100644 index 1c5c6d23..00000000 --- a/light/service.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright 2017 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. - */ - -#define LOG_TAG "android.hardware.light@2.0-service.lge_sdm845" - -#include -#include - -#include "Light.h" - -using android::hardware::configureRpcThreadpool; -using android::hardware::joinRpcThreadpool; - -using android::hardware::light::V2_0::ILight; -using android::hardware::light::V2_0::implementation::Light; - -using android::OK; -using android::sp; -using android::status_t; - -int main() { - bool hasBacklight = true; - bool hasBlinkPattern = true; - bool hasOnOffPattern = true; - - std::ofstream backlight(BL BRIGHTNESS); - if (!backlight) { - int error = errno; - ALOGE("Failed to open %s (%d): %s", BL BRIGHTNESS, error, strerror(error)); - return -error; - } - - std::ofstream emotionalBlinkPattern(LED BLINK_PATTERN); - if (!emotionalBlinkPattern) { - int error = errno; - ALOGE("Failed to open %s (%d): %s", LED BLINK_PATTERN, error, strerror(error)); - ALOGE("Disable blink pattern"); - hasBlinkPattern = false; - } - - std::ofstream emotionalOnOffPattern(LED ONOFF_PATTERN); - if (!emotionalOnOffPattern) { - int error = errno; - ALOGE("Failed to open %s (%d): %s", LED ONOFF_PATTERN, error, strerror(error)); - ALOGE("Disable onoff pattern"); - hasOnOffPattern = false; - } - - android::sp service = new Light(hasBacklight, hasBlinkPattern, hasOnOffPattern); - - configureRpcThreadpool(1, true); - - status_t status = service->registerAsService(); - if (status != OK) { - ALOGE("Cannot register Light HAL service."); - return 1; - } - - ALOGI("Light HAL service ready."); - - joinRpcThreadpool(); - - ALOGI("Light HAL service failed to join thread pool."); - return 1; -} diff --git a/lineage.dependencies b/lineage.dependencies index a45ac67f..95423a72 100644 --- a/lineage.dependencies +++ b/lineage.dependencies @@ -1,17 +1,16 @@ [ { - "repository": "LineageOS/kernel_lge_msm8998", - "target_path": "kernel/lge/msm8998", - "branch": "lineage-16.0" + "repository": "EmanuelCN/android_kernel_lge_sdm845", + "target_path": "kernel/lge/sdm845" }, { "remote": "github", "repository": "SGCMarkus/proprietary_vendor_lge", "target_path": "vendor/lge", - "branch": "lineage-16.0" + "branch": "lineage-18.1" }, { "repository": "android_packages_resources_devicesettings", - "target_path": "packages/resources/devicesettings", + "target_path": "packages/resources/devicesettings" } -] +] \ No newline at end of file diff --git a/livedisplay/Android.bp b/livedisplay/Android.bp deleted file mode 100644 index 577d690c..00000000 --- a/livedisplay/Android.bp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2019 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. - -cc_binary { - name: "vendor.lineage.livedisplay@2.1-service.lge_sdm845", - defaults: ["hidl_defaults"], - vintf_fragments: ["vendor.lineage.livedisplay@2.1-service.lge_sdm845.xml"], - init_rc: ["vendor.lineage.livedisplay@2.1-service.lge_sdm845.rc"], - relative_install_path: "hw", - srcs: [ - ":vendor.lineage.livedisplay@2.0-sdm-pa", - ":vendor.lineage.livedisplay@2.0-sdm-utils", - "DisplayModes.cpp", - "SunlightEnhancement.cpp", - "service.cpp", - ], - vendor: true, - shared_libs: [ - "libbase", - "libbinder", - "libhidlbase", - "libutils", - "vendor.lineage.livedisplay@2.0", - "vendor.lineage.livedisplay@2.1", - ], - header_libs: [ - "vendor.lineage.livedisplay@2.0-sdm-headers", - ], -} diff --git a/livedisplay/DisplayModes.cpp b/livedisplay/DisplayModes.cpp deleted file mode 100644 index 46835fd7..00000000 --- a/livedisplay/DisplayModes.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (C) 2019 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 "DisplayModes.h" -#include -#include - -namespace vendor { -namespace lineage { -namespace livedisplay { -namespace V2_1 { -namespace implementation { - -static constexpr const char* kModePath = "/sys/devices/virtual/panel/img_tune/screen_mode"; -static constexpr const char* kDefaultPath = "/data/vendor/display/default_display_mode"; - -const std::map DisplayModes::kModeMap = { - {0, {"Cinema", "1"}}, - {1, {"Sports", "4"}}, - {2, {"Game", "5"}}, - {3, {"Photos", "2"}}, - {4, {"Web", "3"}}, -// {5, {"Expert", "10"}}, -}; - -DisplayModes::DisplayModes() { - std::ifstream defaultFile(kDefaultPath); - std::string value; - - defaultFile >> value; - LOG(DEBUG) << "Default file read result " << value << " fail " << defaultFile.fail(); - if (defaultFile.fail()) { - return; - } - - for (const auto& entry : kModeMap) { - if (value == entry.second.value) { - mDefaultModeId = entry.first; - break; - } - } - - setDisplayMode(mDefaultModeId, false); -} - -// Methods from ::vendor::lineage::livedisplay::V2_1::IDisplayModes follow. -Return DisplayModes::getDisplayModes(getDisplayModes_cb resultCb) { - std::vector modes; - for (const auto& entry : kModeMap) { - modes.push_back({entry.first, entry.second.name}); - } - resultCb(modes); - return Void(); -} - -Return DisplayModes::getCurrentDisplayMode(getCurrentDisplayMode_cb resultCb) { - int32_t currentModeId = mDefaultModeId; - std::ifstream modeFile(kModePath); - std::string value; - - modeFile >> value; - if (!modeFile.fail()) { - for (const auto& entry : kModeMap) { - if (value == entry.second.value) { - currentModeId = entry.first; - break; - } - } - } - resultCb({currentModeId, kModeMap.at(currentModeId).name}); - return Void(); -} - -Return DisplayModes::getDefaultDisplayMode(getDefaultDisplayMode_cb resultCb) { - resultCb({mDefaultModeId, kModeMap.at(mDefaultModeId).name}); - return Void(); -} - -Return DisplayModes::setDisplayMode(int32_t modeID, bool makeDefault) { - const auto iter = kModeMap.find(modeID); - if (iter == kModeMap.end()) { - return false; - } - std::ofstream modeFile(kModePath); - modeFile << iter->second.value; - if (modeFile.fail()) { - return false; - } - - if (makeDefault) { - std::ofstream defaultFile(kDefaultPath); - defaultFile << iter->second.value; - if (defaultFile.fail()) { - return false; - } - mDefaultModeId = iter->first; - } - return true; -} - -} // namespace sdm -} // namespace V2_1 -} // namespace livedisplay -} // namespace lineage -} // namespace vendor diff --git a/livedisplay/DisplayModes.h b/livedisplay/DisplayModes.h deleted file mode 100644 index ee2b4406..00000000 --- a/livedisplay/DisplayModes.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (C) 2019 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. - */ - -#ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYMODES_H -#define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYMODES_H - -#include -#include -#include -#include - -namespace vendor { -namespace lineage { -namespace livedisplay { -namespace V2_1 { -namespace implementation { - -using ::android::hardware::Return; -using ::android::hardware::Void; -using ::android::sp; - -class DisplayModes : public IDisplayModes { - public: - DisplayModes(); - - // Methods from ::vendor::lineage::livedisplay::V2_1::IDisplayModes follow. - Return getDisplayModes(getDisplayModes_cb resultCb) override; - Return getCurrentDisplayMode(getCurrentDisplayMode_cb resultCb) override; - Return getDefaultDisplayMode(getDefaultDisplayMode_cb ResultCb) override; - Return setDisplayMode(int32_t modeID, bool makeDefault) override; - - private: - struct ModeInfo { - const char* name; - const char* value; - }; - static const std::map kModeMap; - int32_t mDefaultModeId; -}; - -} // namespace sdm -} // namespace V2_1 -} // namespace livedisplay -} // namespace lineage -} // namespace vendor - -#endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_DISPLAYMODES_H diff --git a/livedisplay/SunlightEnhancement.cpp b/livedisplay/SunlightEnhancement.cpp deleted file mode 100644 index 97fdd78b..00000000 --- a/livedisplay/SunlightEnhancement.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2019-2020 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. - */ - -#define LOG_TAG "SunlightEnhancementService" - -#include -#include -#include - -#include "SunlightEnhancement.h" - -namespace vendor { -namespace lineage { -namespace livedisplay { -namespace V2_1 { -namespace implementation { - -static constexpr const char* kHbmStatusPath = "/sys/devices/virtual/panel/brightness/hl_mode"; - -Return SunlightEnhancement::isEnabled() { - std::string buf; - if (!android::base::ReadFileToString(kHbmStatusPath, &buf)) { - LOG(ERROR) << "Failed to read " << kHbmStatusPath; - return false; - } - return std::stoi(android::base::Trim(buf)) == 1; -} - -Return SunlightEnhancement::setEnabled(bool enabled) { - if (!android::base::WriteStringToFile((enabled ? "1" : "0"), kHbmStatusPath)) { - LOG(ERROR) << "Failed to write " << kHbmStatusPath; - return false; - } - return true; -} - -} // namespace implementation -} // namespace V2_1 -} // namespace livedisplay -} // namespace lineage -} // namespace vendor diff --git a/livedisplay/SunlightEnhancement.h b/livedisplay/SunlightEnhancement.h deleted file mode 100644 index 386b593d..00000000 --- a/livedisplay/SunlightEnhancement.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2019-2020 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. - */ - -#ifndef VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H -#define VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H - -#include -#include -#include - -namespace vendor { -namespace lineage { -namespace livedisplay { -namespace V2_1 { -namespace implementation { - -using ::android::sp; -using ::android::hardware::Return; -using ::android::hardware::Void; - -class SunlightEnhancement : public ISunlightEnhancement { - public: - // Methods from ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement follow. - Return isEnabled() override; - Return setEnabled(bool enabled) override; -}; - -} // namespace implementation -} // namespace V2_1 -} // namespace livedisplay -} // namespace lineage -} // namespace vendor - -#endif // VENDOR_LINEAGE_LIVEDISPLAY_V2_1_SUNLIGHTENHANCEMENT_H diff --git a/livedisplay/service.cpp b/livedisplay/service.cpp deleted file mode 100644 index e3105a49..00000000 --- a/livedisplay/service.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2019 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. - */ - -#define LOG_TAG "vendor.lineage.livedisplay@2.1-service-lge_sdm845" - -#include -#include -#include -#include - -#include "DisplayModes.h" -#include "SunlightEnhancement.h" - -using android::sp; -using android::hardware::configureRpcThreadpool; -using android::hardware::joinRpcThreadpool; - -using ::vendor::lineage::livedisplay::V2_0::sdm::PictureAdjustment; -using ::vendor::lineage::livedisplay::V2_0::sdm::SDMController; -using ::vendor::lineage::livedisplay::V2_1::IDisplayModes; -using ::vendor::lineage::livedisplay::V2_1::ISunlightEnhancement; -using ::vendor::lineage::livedisplay::V2_1::implementation::DisplayModes; -using ::vendor::lineage::livedisplay::V2_1::implementation::SunlightEnhancement; - -int main() { - // HIDL frontend - sp dm; - sp pa; - sp se; - - std::shared_ptr controller = std::make_shared(); - - android::ProcessState::initWithDriver("/dev/vndbinder"); - - LOG(INFO) << "LiveDisplay HAL service is starting."; - - dm = new DisplayModes(); - if (dm == nullptr) { - LOG(ERROR) << "Can not create an instance of LiveDisplay HAL DisplayModes Iface," - << " exiting."; - goto shutdown; - } - - pa = new PictureAdjustment(controller); - if (pa == nullptr) { - LOG(ERROR) << "Can not create an instance of LiveDisplay HAL PictureAdjustment Iface," - << " exiting."; - goto shutdown; - } - - se = new SunlightEnhancement(); - if (se == nullptr) { - LOG(ERROR) << "Can not create an instance of LiveDisplay HAL SunlightEnhancement Iface," - << " exiting."; - goto shutdown; - } - - configureRpcThreadpool(1, true /*callerWillJoin*/); - - if (dm->registerAsService() != android::OK) { - LOG(ERROR) << "Cannot register DisplayModes HAL service."; - goto shutdown; - } - - if (pa->registerAsService() != android::OK) { - LOG(ERROR) << "Cannot register PictureAdjustment HAL service."; - goto shutdown; - } - - if (se->registerAsService() != android::OK) { - LOG(ERROR) << "Cannot register SunlightEnhancement HAL service."; - goto shutdown; - } - - LOG(INFO) << "LiveDisplay HAL service is ready."; - joinRpcThreadpool(); - // Should not pass this line - -shutdown: - // In normal operation, we don't expect the thread pool to shutdown - LOG(ERROR) << "LiveDisplay HAL service is shutting down."; - return 1; -} diff --git a/livedisplay/vendor.lineage.livedisplay@2.1-service.lge_sdm845.rc b/livedisplay/vendor.lineage.livedisplay@2.1-service.lge_sdm845.rc deleted file mode 100644 index 704dd089..00000000 --- a/livedisplay/vendor.lineage.livedisplay@2.1-service.lge_sdm845.rc +++ /dev/null @@ -1,15 +0,0 @@ -on init - # LiveDisplay sysfs - chown system system /sys/devices/virtual/panel/img_tune/screen_mode - chmod 0660 /sys/devices/virtual/panel/img_tune/screen_mode - chown system system /sys/devices/virtual/panel/img_tune/screen_tune - chmod 0660 /sys/devices/virtual/panel/img_tune/screen_tune - chown system system /sys/devices/virtual/panel/img_tune/rgb_tune - chmod 0660 /sys/devices/virtual/panel/img_tune/rgb_tune - chown system system /sys/devices/virtual/panel/img_tune/hdr_mode - chmod 0660 /sys/devices/virtual/panel/img_tune/hdr_mode - -service vendor.livedisplay-hal-2-1-lge_sdm845 /vendor/bin/hw/vendor.lineage.livedisplay@2.1-service.lge_sdm845 - class late_start - user system - group system diff --git a/livedisplay/vendor.lineage.livedisplay@2.1-service.lge_sdm845.xml b/livedisplay/vendor.lineage.livedisplay@2.1-service.lge_sdm845.xml deleted file mode 100644 index 7cdf8065..00000000 --- a/livedisplay/vendor.lineage.livedisplay@2.1-service.lge_sdm845.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - vendor.lineage.livedisplay - hwbinder - @2.1::IDisplayModes/default - @2.1::IPictureAdjustment/default - @2.1::ISunlightEnhancement/default - - diff --git a/manifest.xml b/manifest.xml index ec3e2c49..5e2bd6af 100755 --- a/manifest.xml +++ b/manifest.xml @@ -75,7 +75,7 @@ android.hardware.graphics.composer hwbinder - 2.2 + 2.3 IComposer default @@ -90,15 +90,6 @@ default - - android.hardware.light - hwbinder - 2.0 - - ILight - default - - android.hardware.media.omx hwbinder @@ -188,6 +179,15 @@ default + + android.hardware.health + hwbinder + 2.0 + + IHealth + default + + com.dsi.ant hwbinder diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index 397058a0..5ac9439c 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -228,7 +228,6 @@ "/vendor/lib/libadreno_utils.so" "/vendor/lib/libgpudataproducer.so" "/vendor/lib/libgsl.so" - "/vendor/lib/libkcl.so" "/vendor/lib/libkernelmanager.so" "/vendor/lib/libllvm-glnext.so" "/vendor/lib/libllvm-qcom.so" @@ -243,7 +242,6 @@ "/vendor/lib64/libadreno_utils.so" "/vendor/lib64/libgpudataproducer.so" "/vendor/lib64/libgsl.so" - "/vendor/lib64/libkcl.so" "/vendor/lib64/libkernelmanager.so" "/vendor/lib64/libllvm-glnext.so" "/vendor/lib64/libllvm-qcom.so" diff --git a/overlay/packages/apps/Settings/res/values/config.xml b/overlay/packages/apps/Settings/res/values/config.xml index 3140a4f2..35f00a7f 100644 --- a/overlay/packages/apps/Settings/res/values/config.xml +++ b/overlay/packages/apps/Settings/res/values/config.xml @@ -12,11 +12,22 @@ limitations under the License. --> - - true + + + 3 org.lineageos.settings.doze/org.lineageos.settings.doze.DozeSettingsActivity diff --git a/proprietary-files.txt b/proprietary-files.txt index 6e49d0dc..1b4c369a 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -138,10 +138,6 @@ vendor/lib64/hw/vendor.qti.hardware.bluetooth_sar@1.1-impl.so vendor/lib64/vendor.qti.hardware.bluetooth_sar@1.0.so vendor/lib64/vendor.qti.hardware.bluetooth_sar@1.1.so -# Bluetooth (aptX) -system_ext/lib64/libaptX_encoder.so -system_ext/lib64/libaptXHD_encoder.so - # CDSP vendor/bin/cdsprpcd vendor/etc/init/vendor.qti.cdsprpc-service.rc diff --git a/rootdir/bin/init.class_main.sh b/rootdir/bin/init.class_main.sh index 05c3251f..98652bf0 100644 --- a/rootdir/bin/init.class_main.sh +++ b/rootdir/bin/init.class_main.sh @@ -1,4 +1,4 @@ -#! /vendor/bin/sh +#!/vendor/bin/sh # Copyright (c) 2013-2014, 2019 The Linux Foundation. All rights reserved. # @@ -31,18 +31,10 @@ # start ril-daemon only for targets on which radio is present # baseband=`getprop ro.baseband` -sgltecsfb=`getprop persist.vendor.radio.sglte_csfb` datamode=`getprop persist.vendor.data.mode` low_ram=`getprop ro.config.low_ram` qcrild_status=true -case "$baseband" in - "apq" | "sda" | "qcs" ) - setprop ro.vendor.radio.noril yes - stop vendor.ril-daemon - stop vendor.qcrild -esac - case "$baseband" in "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6") @@ -93,19 +85,6 @@ case "$baseband" in start vendor.ril-daemon fi - case "$baseband" in - "svlte2a" | "csfb") - start qmiproxy - ;; - "sglte" | "sglte2" ) - if [ "x$sgltecsfb" != "xtrue" ]; then - start qmiproxy - else - setprop persist.vendor.radio.voice.modem.index 0 - fi - ;; - esac - multisim=`getprop persist.radio.multisim.config` if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then diff --git a/rootdir/bin/init.lge.usb.default.sh b/rootdir/bin/init.lge.usb.default.sh deleted file mode 100644 index a2dab663..00000000 --- a/rootdir/bin/init.lge.usb.default.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/vendor/bin/sh - -target_operator=`getprop ro.vendor.lge.build.target_operator` -ui_version=`getprop ro.vendor.lge.lguiversion` -case "$target_operator" in - "ATT") - default="charge_only" - ;; - "VZW") - default="charge_only" - if [ -f "/vendor/etc/usbautorun.iso" ]; then - if [ -f "/sys/class/android_usb/android0/f_cdrom_storage/lun/cdrom_usbmode" ]; then - echo 0 > /sys/class/android_usb/android0/f_cdrom_storage/lun/cdrom_usbmode - fi - fi - ;; - *) - if [ "${ui_version//./}" -ge "50" ]; then - default="charge_only" - else - default="mtp" - fi - ;; -esac - -function waitForState() { - local i - local state=$1 - local value - for i in {1..20}; do - value=`getprop vendor.lge.usb.state` - if [ "x${state}" = "x${value}" ]; then - echo 0 - return - fi - sleep 0.050 - done - - echo 1 - return -} - -function setUsbConfig() { - setprop vendor.lge.usb.config $1 - waitForState $1 -} - -function updateDefaultFunction() { - setprop vendor.lge.usb.persist.config $1 - setprop vendor.lge.usb.config $1 -} - -usb_config=$1 -case "$usb_config" in - "boot") #factory status, select default - setUsbConfig none - updateDefaultFunction $default - ;; - "boot,adb") #factory status, select default - setUsbConfig none - updateDefaultFunction ${default},adb - ;; - *) ;; #USB persist config exists, do nothing -esac diff --git a/rootdir/bin/init.lge.usb.sh b/rootdir/bin/init.lge.usb.sh index 59c3e6b7..1dc89b6d 100644 --- a/rootdir/bin/init.lge.usb.sh +++ b/rootdir/bin/init.lge.usb.sh @@ -1,129 +1,13 @@ #!/vendor/bin/sh -# -# Allow USB enumeration with default PID/VID -# -if [ -e /sys/class/android_usb/f_mass_storage/lun/nofua ]; -then - echo 1 > /sys/class/android_usb/f_mass_storage/lun/nofua -fi -if [ -e /sys/class/android_usb/f_cdrom_storage/lun/nofua ]; -then - echo 1 > /sys/class/android_usb/f_cdrom_storage/lun/nofua -fi -if [ -e /sys/class/android_usb/f_mass_storage/rom/nofua ]; -then - echo 1 > /sys/class/android_usb/f_mass_storage/rom/nofua -fi - -bootmode=`getprop ro.bootmode` -target_operator=`getprop ro.vendor.lge.build.target_operator` -if [ "${bootmode:0:3}" != "qem" ] && [ "${bootmode:0:3}" != "pif" ]; then - # correct the wrong usb property - usb_config=$1 - case "$usb_config" in - "" | "pc_suite" | "mtp_only" | "auto_conf") - setprop vendor.lge.usb.persist.config mtp - ;; - "adb" | "pc_suite,adb" | "mtp_only,adb" | "auto_conf,adb") - setprop vendor.lge.usb.persist.config mtp,adb - ;; - "ptp_only") - setprop vendor.lge.usb.persist.config ptp - ;; - "ptp_only,adb") - setprop vendor.lge.usb.persist.config ptp,adb - ;; - * ) ;; #USB persist config exists, do nothing - esac - - # boot overloading - case "$target_operator" in - "ATT" | "CRK") - setprop vendor.lge.usb.boot.config.name mtp - ;; - *) - setprop vendor.lge.usb.boot.config.name boot - ;; - esac -fi - -if [ "$target_operator" == "VZW" ]; then - devicename=`getprop ro.product.model` - if [ -n "$devicename" ]; then - echo "$devicename" > /sys/devices/platform/lge_android_usb/model_name - fi - swversion=`getprop ro.vendor.lge.swversion` - if [ -n "$swversion" ]; then - echo "$swversion" > /sys/devices/platform/lge_android_usb/sw_version - fi - subversion=`getprop ro.vendor.lge.swversion_rev` - if [ -n "$subversion" ]; then - echo "$subversion" > /sys/devices/platform/lge_android_usb/sub_version - fi -fi - ################################################################################ # QCOM ################################################################################ -# Set the number of DIAG interfaces. -diag_count=`getprop ro.vendor.lge.usb.diag_count` -if [ "$diag_count" == "" ]; then - setprop ro.vendor.lge.usb.diag_count 1 -fi - # Set platform variables soc_hwplatform=`cat /sys/devices/soc0/hw_platform 2> /dev/null` soc_machine=`cat /sys/devices/soc0/machine 2> /dev/null` soc_machine=${soc_machine:0:2} -soc_id=`cat /sys/devices/soc0/soc_id 2> /dev/null` - -# -# Check ESOC for external modem -# -# Note: currently only a single MDM/SDX is supported -# -esoc_name=`cat /sys/bus/esoc/devices/esoc0/esoc_name 2> /dev/null` - -if [ -d /sys/bus/esoc/devices ]; then -for f in /sys/bus/esoc/devices/*; do - if [ -d $f ]; then - if [ `grep -e "^MDM" -e "^SDX" $f/esoc_name` ]; then - esoc_link=`cat $f/esoc_link` - break - fi - fi -done -fi - -target=`getprop ro.board.platform` - -# -# Override USB default composition -# sm8250 : esoc_name [SDX55M] , ro.baseband [mdm] , target [kona] -# sm8350 : esoc_name [ ] , ro.baseband [msm] , target [lahaina] -# If USB persist config not set, set default configuration -# -#if [ "$(getprop persist.vendor.usb.config)" == "" -a \ -# "$(getprop init.svc.vendor.usb-gadget-hal-1-0)" != "running" ]; then -# if [ "$esoc_name" == "" ]; then -# case "$(getprop ro.baseband)" in -# "msm") -# case "$target" in -# "lahaina") -# if [ -d /config/usb_gadget/g1/functions/qdss.qdss ]; then -# setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,qdss,adb -# else -# setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb -# fi -# #setprop persist.vendor.usb.config diag,adb -# ;; -# esac -# ;; -# esac -# fi -#fi # check configfs is mounted or not if [ -d /config/usb_gadget ]; then @@ -140,116 +24,4 @@ if [ -d /config/usb_gadget ]; then echo $serialno > /config/usb_gadget/g1/strings/0x409/serialnumber fi setprop vendor.usb.configfs 1 -else - # - # Do target specific things - # - case "$target" in - "msm8996" | "msm8953") - echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports - echo 131072 > /sys/module/g_android/parameters/mtp_tx_req_len - echo 131072 > /sys/module/g_android/parameters/mtp_rx_req_len - ;; - "msm8937") - case "$soc_id" in - "313" | "320") - echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports - ;; - esac - ;; - esac -fi - -# -# Initialize RNDIS Diag option. If unset, set it to 'none'. -# -diag_extra=`getprop persist.vendor.usb.config.extra` -if [ "$diag_extra" == "" ]; then - setprop persist.vendor.usb.config.extra none -fi - -# enable rps cpus on msm8937 target -setprop vendor.usb.rps_mask 0 -case "$soc_id" in - "294" | "295" | "353" | "354") - setprop vendor.usb.rps_mask 40 - ;; -esac - -# -# apply to use qdss_diag in user mode -# SM6150(steppe) /SM6250 /SM6350(lagoon) -# SM7150 /SM7250(lito) /SM7350 -# SM8150(msmnile) /SM8250(kona) /SM8350(lahaina) -# -case "$target" in - "lahaina" | "kona" | "msmnile" | "lito" | "steppe" | "steppe") - chown -h root.oem_2902 /sys/devices/platform/soc/6048000.tmc/coresight-tmc-etr/block_size - chmod 660 /sys/devices/platform/soc/6048000.tmc/coresight-tmc-etr/block_size - ;; -esac - -# -# Initialize UVC conifguration. -# -if [ -d /config/usb_gadget/g1/functions/uvc.0 ]; then - cd /config/usb_gadget/g1/functions/uvc.0 - - echo 3072 > streaming_maxpacket - echo 1 > streaming_maxburst - mkdir control/header/h - ln -s control/header/h control/class/fs/ - ln -s control/header/h control/class/ss - - mkdir -p streaming/uncompressed/u/360p - echo "666666\n1000000\n5000000\n" > streaming/uncompressed/u/360p/dwFrameInterval - - mkdir -p streaming/uncompressed/u/720p - echo 1280 > streaming/uncompressed/u/720p/wWidth - echo 720 > streaming/uncompressed/u/720p/wWidth - echo 29491200 > streaming/uncompressed/u/720p/dwMinBitRate - echo 29491200 > streaming/uncompressed/u/720p/dwMaxBitRate - echo 1843200 > streaming/uncompressed/u/720p/dwMaxVideoFrameBufferSize - echo 5000000 > streaming/uncompressed/u/720p/dwDefaultFrameInterval - echo "5000000\n" > streaming/uncompressed/u/720p/dwFrameInterval - - mkdir -p streaming/mjpeg/m/360p - echo "666666\n1000000\n5000000\n" > streaming/mjpeg/m/360p/dwFrameInterval - - mkdir -p streaming/mjpeg/m/720p - echo 1280 > streaming/mjpeg/m/720p/wWidth - echo 720 > streaming/mjpeg/m/720p/wWidth - echo 29491200 > streaming/mjpeg/m/720p/dwMinBitRate - echo 29491200 > streaming/mjpeg/m/720p/dwMaxBitRate - echo 1843200 > streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize - echo 5000000 > streaming/mjpeg/m/720p/dwDefaultFrameInterval - echo "5000000\n" > streaming/mjpeg/m/720p/dwFrameInterval - - echo 0x04 > /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bmaControls - - mkdir -p streaming/h264/h/960p - echo 1920 > streaming/h264/h/960p/wWidth - echo 960 > streaming/h264/h/960p/wWidth - echo 40 > streaming/h264/h/960p/bLevelIDC - echo "333667\n" > streaming/h264/h/960p/dwFrameInterval - - mkdir -p streaming/h264/h/1920p - echo "333667\n" > streaming/h264/h/1920p/dwFrameInterval - - mkdir streaming/header/h - ln -s streaming/uncompressed/u streaming/header/h - ln -s streaming/mjpeg/m streaming/header/h - ln -s streaming/h264/h streaming/header/h - ln -s streaming/header/h streaming/class/fs/ - ln -s streaming/header/h streaming/class/hs/ - ln -s streaming/header/h streaming/class/ss/ -fi - -################################################################################ -# DEVICE -################################################################################ - -if [ -f "/vendor/bin/init.lge.usb.dev.sh" ] -then - source /vendor/bin/init.lge.usb.dev.sh fi diff --git a/rootdir/bin/init.lge.zramswap.sh b/rootdir/bin/init.lge.zramswap.sh index 2768795f..4fc7442c 100644 --- a/rootdir/bin/init.lge.zramswap.sh +++ b/rootdir/bin/init.lge.zramswap.sh @@ -1,8 +1,8 @@ #!/vendor/bin/sh -target=`getprop ro.board.platform` -device=`getprop ro.product.device` -product=`getprop ro.product.name` +target=$(getprop ro.board.platform) +device=$(getprop ro.product.device) +product=$(getprop ro.product.name) start() { # Check the available memory @@ -15,7 +15,7 @@ start() { #check built-in zram devices nr_builtin_zram=$(ls /dev/block/zram* | grep -c zram) - if [ "$nr_builtin_zram" -ne "0" ] ; then + if [ "$nr_builtin_zram" -ne "0" ]; then #use the built-in zram devices nr_zramdev=${nr_builtin_zram} use_mod=0 @@ -40,136 +40,148 @@ start() { swappiness_new=80 case $target in - "msm8937") - compr_zram=lz4 - nr_multi_zram=4 - zram_async=0 - max_write_threads=0 - if [ $nr_zramdev -gt 1 ] ; then - sz_zram0=$(( memtotal_kb / 8 * 3 )) - sz_zram=$(( memtotal_kb / 4 )) + "msm8937") + compr_zram=lz4 + nr_multi_zram=4 + zram_async=0 + max_write_threads=0 + if [ $nr_zramdev -gt 1 ]; then + sz_zram0=$((memtotal_kb / 8 * 3)) + sz_zram=$((memtotal_kb / 4)) + else + if [ $memtotal_kb -gt 2048000 ]; then + sz_zram=$((memtotal_kb / 4 / ${nr_zramdev})) else - if [ memtotal_kb -gt 2048000 ] ; then - sz_zram=$(( memtotal_kb / 4 / ${nr_zramdev} )) - else - sz_zram=$(( memtotal_kb / 3 / ${nr_zramdev} )) - fi + sz_zram=$((memtotal_kb / 3 / ${nr_zramdev})) fi + fi ;; - "msm8953") - sz_zram=$(( memtotal_kb / 4 )) - sz_zram0=$(( memtotal_kb / 4 )) - compr_zram=lz4 - nr_multi_zram=4 - if [ memtotal_kb -gt 2048000 ] ; then - zram_async=1 - max_write_threads=4 - else - zram_async=0 - max_write_threads=0 - fi + "msm8953") + sz_zram=$((memtotal_kb / 4)) + sz_zram0=$((memtotal_kb / 4)) + compr_zram=lz4 + nr_multi_zram=4 + if [ $memtotal_kb -gt 2048000 ]; then + zram_async=1 + max_write_threads=4 + else + zram_async=0 + max_write_threads=0 + fi ;; - "msm8998" | "msm8996" | "msm8952") - sz_zram=$(( memtotal_kb / 4 )) - sz_zram0=$(( memtotal_kb / 4 )) - compr_zram=lz4 - nr_multi_zram=4 + "msm8998" | "msm8996" | "msm8952") + sz_zram=$((memtotal_kb / 4)) + sz_zram0=$((memtotal_kb / 4)) + compr_zram=lz4 + nr_multi_zram=4 ;; - "sdm845" | "msmnile" | "sm6150") - sz_zram=3145728 - sz_zram0=3145728 - compr_zram=lz4 - nr_multi_zram=4 - zram_async=1 - max_write_threads=8 + "sdm845" | "msmnile" | "sm6150") + sz_zram=3145728 + sz_zram0=3145728 + compr_zram=lz4 + nr_multi_zram=4 + zram_async=1 + max_write_threads=8 - # Must use == expression instead of -eq to compare string - if [ "$target" == "msmnile" ] ; then - # increase watermark about 2% - echo 200 > /proc/sys/vm/watermark_scale_factor - fi + # Must use == expression instead of -eq to compare string + if [ "$target" = "msmnile" ]; then + # increase watermark about 2% + echo 200 >/proc/sys/vm/watermark_scale_factor + fi ;; - "kona") - # use zram0 (50% of memtotal) only for hswap feature - # set 3GB zram size for the over 8GB DDR model - if [ $memtotal_kb -gt 6291456 ] ; then - sz_zram=3145728 - else - sz_zram=$(( memtotal_kb / 2 )) - fi - compr_zram=lz4 - nr_multi_zram=4 - # increase watermark about 2% - echo 200 > /proc/sys/vm/watermark_scale_factor - # disable watermark boost feature - echo 0 > /proc/sys/vm/watermark_boost_factor - ;; - - "lito") - # use zram0 only for hswap feature - sz_zram=$(( memtotal_kb / 2 )) - compr_zram=lz4 - nr_multi_zram=4 - # increase watermark about 2% - echo 0 > /proc/sys/vm/watermark_boost_factor - echo 200 > /proc/sys/vm/watermark_scale_factor + "kona") + # use zram0 (50% of memtotal) only for hswap feature + # set 3GB zram size for the over 8GB DDR model + if [ $memtotal_kb -gt 6291456 ]; then + sz_zram=3145728 + else + sz_zram=$((memtotal_kb / 2)) + fi + compr_zram=lz4 + nr_multi_zram=4 + # increase watermark about 2% + echo 200 >/proc/sys/vm/watermark_scale_factor + # disable watermark boost feature + echo 0 >/proc/sys/vm/watermark_boost_factor ;; - *) - sz_zram=$(( memtotal_kb / 4 / ${nr_zramdev} )) + "lito") + # use zram0 only for hswap feature + sz_zram=$((memtotal_kb / 2)) + compr_zram=lz4 + nr_multi_zram=4 + # increase watermark about 2% + echo 0 >/proc/sys/vm/watermark_boost_factor + echo 200 >/proc/sys/vm/watermark_scale_factor + ;; + + *) + sz_zram=$((memtotal_kb / 4 / ${nr_zramdev})) ;; esac echo sz_zram size is ${sz_zram} # load kernel module for zram - if [ "$use_mod" -eq "1" ] ; then + if [ "$use_mod" -eq 1 ]; then modpath=/system/lib/modules/zram.ko modargs="num_devices=${nr_zramdev}" - echo zram.ko is $modargs + echo "zram.ko is $modargs" - if [ -f $modpath ] ; then - insmod $modpath $modargs && (echo "zram module loaded") || (echo "module loading failed and exiting(${?})" ; exit $?) + if [ -f "$modpath" ]; then + ret=$(insmod "$modpath" "$modargs") + if [ "$ret" -eq 0 ]; then + echo 'zram module loaded' + else + echo "module loading failed and exiting($ret)" + exit $ret + fi else - echo "zram module not exist(${?})" - exit $? + echo "zram module not exist($?)" + exit 1 fi fi # initialize and configure the zram devices as a swap partition zramdev_num=0 - if [ "$sz_zram0" -eq "0" ] ; then + if [ "$sz_zram0" -eq "0" ]; then sz_zram0=$((${sz_zram} * ${nr_zramdev})) fi swap_prio=5 - while [[ $zramdev_num -lt $nr_zramdev ]]; do + while [ "$zramdev_num" -lt "$nr_zramdev" ]; do modpath_comp_streams=/sys/block/zram${zramdev_num}/max_comp_streams modpath_comp_algorithm=/sys/block/zram${zramdev_num}/comp_algorithm # If compr_zram is not available, then use default zram comp_algorithm available_comp_algorithm="$(cat $modpath_comp_algorithm | grep $compr_zram)" if [ "$available_comp_algorithm" ]; then - if [ -f $modpath_comp_streams ] ; then - echo $nr_multi_zram > /sys/block/zram${zramdev_num}/max_comp_streams + if [ -f $modpath_comp_streams ]; then + echo $nr_multi_zram >/sys/block/zram${zramdev_num}/max_comp_streams fi - if [ -f $modpath_comp_algorithm ] ; then - echo $compr_zram > /sys/block/zram${zramdev_num}/comp_algorithm + if [ -f $modpath_comp_algorithm ]; then + echo $compr_zram >/sys/block/zram${zramdev_num}/comp_algorithm fi fi - if [ "$zramdev_num" -ne "0" ] ; then - echo ${sz_zram}k > /sys/block/zram${zramdev_num}/disksize + if [ "$zramdev_num" -ne "0" ]; then + echo ${sz_zram}k >/sys/block/zram${zramdev_num}/disksize else - if [ "$zram_async" -ne "0" ] ; then - echo $zram_async > /sys/block/zram${zramdev_num}/async - echo $max_write_threads > /sys/block/zram${zramdev_num}/max_write_threads + if [ "$zram_async" -ne "0" ]; then + echo $zram_async >/sys/block/zram${zramdev_num}/async + echo $max_write_threads >/sys/block/zram${zramdev_num}/max_write_threads fi - echo ${sz_zram0}k > /sys/block/zram${zramdev_num}/disksize + echo ${sz_zram0}k >/sys/block/zram${zramdev_num}/disksize fi - mkswap /dev/block/zram${zramdev_num} && (echo "mkswap ${zramdev_num}") || (echo "mkswap ${zramdev_num} failed and exiting(${?})" ; exit $?) - swapon -p $swap_prio /dev/block/zram0 && (echo "swapon ${zramdev_num}") || (echo "swapon ${zramdev_num} failed and exiting(${?})" ; exit $?) + mkswap /dev/block/zram${zramdev_num} && (echo "mkswap ${zramdev_num}") || ( + echo "mkswap ${zramdev_num} failed and exiting(${?})" + exit $? + ) + swapon -p $swap_prio /dev/block/zram0 && (echo "swapon ${zramdev_num}") || ( + echo "swapon ${zramdev_num} failed and exiting(${?})" + exit $? + ) ((zramdev_num++)) ((swap_prio++)) done @@ -181,32 +193,35 @@ start() { overcommit_memory=1 page_cluster=0 - if [ "$deny_minfree_change" -ne "1" ] ; then - let min_free_kbytes=$(cat /proc/sys/vm/min_free_kbytes)*2 + if [ "$deny_minfree_change" -ne "1" ]; then + let min_free_kbytes=$(cat /proc/sys/vm/min_free_kbytes)*2 fi laptop_mode=0 - echo $swappiness_new > /proc/sys/vm/swappiness - echo $overcommit_memory > /proc/sys/vm/overcommit_memory - echo $page_cluster > /proc/sys/vm/page-cluster - if [ "$deny_minfree_change" -ne "1" ] ; then - echo $min_free_kbytes > /proc/sys/vm/min_free_kbytes + echo $swappiness_new >/proc/sys/vm/swappiness + echo $overcommit_memory >/proc/sys/vm/overcommit_memory + echo $page_cluster >/proc/sys/vm/page-cluster + if [ "$deny_minfree_change" -ne "1" ]; then + echo $min_free_kbytes >/proc/sys/vm/min_free_kbytes fi - echo $laptop_mode > /proc/sys/vm/laptop_mode + echo $laptop_mode >/proc/sys/vm/laptop_mode } stop() { swaps=$(grep zram /proc/swaps) swaps=${swaps%%partition*} - if [ $swaps ] ; then + if [ $swaps ]; then for i in $swaps; do - swapoff $i + swapoff $i done for j in $(ls /sys/block | grep zram); do echo 1 ${j}/reset done - if [ $(lsmod | grep -c zram) -ne "0" ] ; then - rmmod zram && (echo "zram unloaded") || (echo "zram unload fail(${?})" ; exit $?) + if [ $(lsmod | grep -c zram) -ne "0" ]; then + rmmod zram && (echo "zram unloaded") || ( + echo "zram unload fail(${?})" + exit $? + ) fi fi } @@ -214,10 +229,13 @@ stop() { cmd=${1-start} case $cmd in - "start") start +"start") + start ;; - "stop") stop +"stop") + stop ;; - *) echo "Undefined command!" +*) + echo 'Undefined command!' ;; esac diff --git a/rootdir/bin/init.qcom.devstart.sh b/rootdir/bin/init.qcom.devstart.sh deleted file mode 100644 index 498503db..00000000 --- a/rootdir/bin/init.qcom.devstart.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /vendor/bin/sh - -echo 1 > /sys/kernel/boot_cdsp/boot - diff --git a/rootdir/bin/init.qcom.early_boot.sh b/rootdir/bin/init.qcom.early_boot.sh index f420df43..5292dfe8 100644 --- a/rootdir/bin/init.qcom.early_boot.sh +++ b/rootdir/bin/init.qcom.early_boot.sh @@ -1,4 +1,4 @@ -#! /vendor/bin/sh +#!/vendor/bin/sh # Copyright (c) 2012-2013,2016,2018-2020 The Linux Foundation. All rights reserved. # @@ -91,201 +91,6 @@ function set_density_by_fb() { target=`getprop ro.board.platform` case "$target" in - "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") - case "$soc_hwplatform" in - "FFA" | "SVLTE_FFA") - # linking to surf_keypad_qwerty.kcm.bin instead of surf_keypad_numeric.kcm.bin so that - # the UI keyboard works fine. - ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin - ;; - "Fluid") - setprop vendor.display.lcd_density 240 - setprop qcom.bt.dev_power_class 2 - ;; - *) - ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin - ;; - esac - ;; - "sm6150") - case "$soc_hwplatform" in - "ADP") - setprop vendor.display.lcd_density 160 - ;; - esac - case "$soc_hwid" in - 365|366) - sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null - setprop vendor.media.target.version 1 - if [ $sku_ver -eq 1 ]; then - setprop vendor.media.target.version 2 - fi - ;; - 355|369|377|384) - setprop vendor.chre.enabled 0 - ;; - *) - esac - ;; - "msm8660") - case "$soc_hwplatform" in - "Fluid") - setprop vendor.display.lcd_density 240 - ;; - "Dragon") - setprop ro.sound.alsa "WM8903" - ;; - esac - ;; - - "msm8960") - # lcd density is write-once. Hence the separate switch case - case "$soc_hwplatform" in - "Liquid") - if [ "$soc_hwver" == "196608" ]; then # version 0x30000 is 3D sku - setprop ro.sf.hwrotation 90 - fi - - setprop vendor.display.lcd_density 160 - ;; - "MTP") - setprop vendor.display.lcd_density 240 - ;; - *) - case "$soc_hwid" in - "109") - setprop vendor.display.lcd_density 160 - ;; - *) - setprop vendor.display.lcd_density 240 - ;; - esac - ;; - esac - - #Set up composition type based on the target - case "$soc_hwid" in - 87) - #8960 - setprop debug.composition.type dyn - ;; - 153|154|155|156|157|138) - #8064 V2 PRIME | 8930AB | 8630AB | 8230AB | 8030AB | 8960AB - setprop debug.composition.type c2d - ;; - *) - esac - ;; - - "msm8974") - case "$soc_hwplatform" in - "Liquid") - setprop vendor.display.lcd_density 160 - # Liquid do not have hardware navigation keys, so enable - # Android sw navigation bar - setprop ro.hw.nav_keys 0 - ;; - "Dragon") - setprop vendor.display.lcd_density 240 - ;; - *) - setprop vendor.display.lcd_density 320 - ;; - esac - ;; - - "msm8226") - case "$soc_hwplatform" in - *) - setprop vendor.display.lcd_density 320 - ;; - esac - ;; - - "msm8610" | "apq8084" | "mpq8092") - case "$soc_hwplatform" in - *) - setprop vendor.display.lcd_density 240 - ;; - esac - ;; - "apq8084") - case "$soc_hwplatform" in - "Liquid") - setprop vendor.display.lcd_density 320 - # Liquid do not have hardware navigation keys, so enable - # Android sw navigation bar - setprop ro.hw.nav_keys 0 - ;; - "SBC") - setprop vendor.display.lcd_density 200 - # SBC do not have hardware navigation keys, so enable - # Android sw navigation bar - setprop qemu.hw.mainkeys 0 - ;; - *) - setprop vendor.display.lcd_density 480 - ;; - esac - ;; - "msm8996") - case "$soc_hwplatform" in - "Dragon") - setprop vendor.display.lcd_density 240 - setprop qemu.hw.mainkeys 0 - ;; - "ADP") - setprop vendor.display.lcd_density 160 - setprop qemu.hw.mainkeys 0 - ;; - "SBC") - setprop vendor.display.lcd_density 240 - setprop qemu.hw.mainkeys 0 - ;; - *) - setprop vendor.display.lcd_density 560 - ;; - esac - ;; - "msm8937" | "msm8940") - # Set vendor.opengles.version based on chip id. - # MSM8937 and MSM8940 variants supports OpenGLES 3.1 - # 196608 is decimal for 0x30000 to report version 3.0 - # 196609 is decimal for 0x30001 to report version 3.1 - # 196610 is decimal for 0x30002 to report version 3.2 - case "$soc_hwid" in - 294|295|296|297|298|313|353|354|363|364) - setprop vendor.opengles.version 196610 - if [ $soc_hwid = 354 ] - then - setprop vendor.media.target.version 1 - log -t BOOT -p i "SDM429 early_boot prop set for: HwID '$soc_hwid'" - fi - ;; - 303|307|308|309|320|386|436) - # Vulkan is not supported for 8917 variants - setprop vendor.opengles.version 196608 - setprop persist.graphics.vulkan.disable true - ;; - *) - setprop vendor.opengles.version 196608 - ;; - esac - ;; - "msm8909") - case "$soc_hwplatform" in - *) - setprop persist.graphics.vulkan.disable true - ;; - esac - ;; - "msm8998" | "apq8098_latv") - case "$soc_hwplatform" in - *) - setprop vendor.display.lcd_density 560 - ;; - esac - ;; "sdm845") case "$soc_hwplatform" in *) @@ -297,145 +102,7 @@ case "$target" in ;; esac ;; - "msmnile") - case "$soc_hwplatform" in - *) - if [ $fb_width -le 1600 ]; then - setprop vendor.display.lcd_density 560 - else - setprop vendor.display.lcd_density 640 - fi - ;; - esac - ;; - "kona") - case "$soc_hwplatform" in - *) - setprop vendor.media.target_variant "_kona" - if [ $fb_width -le 1600 ]; then - setprop vendor.display.lcd_density 560 - else - setprop vendor.display.lcd_density 640 - fi - ;; - esac - ;; - "lito") - case "$soc_hwid" in - 400|440) - sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null - if [ $sku_ver -eq 1 ]; then - setprop vendor.media.target.version 1 - fi - ;; - 434|459) - sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null - setprop vendor.media.target.version 2 - if [ $sku_ver -eq 1 ]; then - setprop vendor.media.target.version 3 - fi - ;; - 476) - # Fraser soc_id 476 - setprop vendor.display.enable_qsync_idle 1 - ;; - esac - ;; - "bengal") - case "$soc_hwid" in - 441|473) - # 441 is for scuba and 473 for scuba iot qcm - setprop vendor.fastrpc.disable.cdsprpcd.daemon 1 - setprop vendor.media.target.version 2 - setprop vendor.gralloc.disable_ubwc 1 - setprop vendor.display.enhance_idle_time 1 - setprop vendor.netflix.bsp_rev "" - # 196609 is decimal for 0x30001 to report version 3.1 - setprop vendor.opengles.version 196609 - sku_ver=`cat /sys/devices/platform/soc/5a00000.qcom,vidc1/sku_version` 2> /dev/null - if [ $sku_ver -eq 1 ]; then - setprop vendor.media.target.version 3 - fi - ;; - 471|474) - # 471 is for scuba APQ and 474 for scuba iot qcs - setprop vendor.fastrpc.disable.cdsprpcd.daemon 1 - setprop vendor.gralloc.disable_ubwc 1 - setprop vendor.display.enhance_idle_time 1 - setprop vendor.netflix.bsp_rev "" - ;; - *) - # default case is for bengal - setprop vendor.netflix.bsp_rev "Q6115-31409-1" - ;; - esac - ;; - "sdm710" | "msmpeafowl") - case "$soc_hwplatform" in - *) - if [ $fb_width -le 1600 ]; then - setprop vendor.display.lcd_density 560 - else - setprop vendor.display.lcd_density 640 - fi - - sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null - if [ $sku_ver -eq 1 ]; then - setprop vendor.media.target.version 1 - fi - ;; - esac - ;; - "msm8953") - cap_ver = 1 - if [ -e "/sys/devices/platform/soc/1d00000.qcom,vidc/capability_version" ]; then - cap_ver=`cat /sys/devices/platform/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null - else - cap_ver=`cat /sys/devices/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null - fi - - if [ $cap_ver -eq 1 ]; then - setprop vendor.media.target.version 1 - fi - ;; - #Set property to differentiate SDM660 & SDM455 - #SOC ID for SDM455 is 385 - "sdm660") - case "$soc_hwplatform" in - *) - if [ $fb_width -le 1600 ]; then - setprop vendor.display.lcd_density 560 - else - setprop vendor.display.lcd_density 640 - fi - - if [ $soc_hwid -eq 385 ]; then - setprop vendor.media.target.version 1 - fi - ;; - esac - ;; - "holi") - setprop vendor.media.target_variant "_holi" - ;; esac -case "$target" in - "msm8937") - case "$soc_hwid" in - 386|354|353|303) - # enable qrtr-ns service for kernel 4.14 or above - KernelVersionStr=`cat /proc/sys/kernel/osrelease` - KernelVersionS=${KernelVersionStr:2:2} - KernelVersionA=${KernelVersionStr:0:1} - KernelVersionB=${KernelVersionS%.*} - - if [ $KernelVersionA -ge 4 ] && [ $KernelVersionB -ge 14 ]; then - setprop ctl.vendor.qrtrns_enable 1 - fi - ;; - esac - ;; - esac baseband=`getprop ro.baseband` #enable atfwd daemon all targets except sda, apq, qcs @@ -452,43 +119,6 @@ esac #property if any target is setting forcefully. set_density_by_fb - -# set Lilliput LCD density for ADP -product=`getprop ro.build.product` - -case "$product" in - "msmnile_au") - setprop vendor.display.lcd_density 160 - echo 902400000 > /sys/class/devfreq/soc:qcom,cpu0-cpu-l3-lat/min_freq - echo 1612800000 > /sys/class/devfreq/soc:qcom,cpu0-cpu-l3-lat/max_freq - echo 902400000 > /sys/class/devfreq/soc:qcom,cpu4-cpu-l3-lat/min_freq - echo 1612800000 > /sys/class/devfreq/soc:qcom,cpu4-cpu-l3-lat/max_freq - ;; - *) - ;; -esac -case "$product" in - "sm6150_au") - setprop vendor.display.lcd_density 160 - ;; - *) - ;; -esac -case "$product" in - "sdmshrike_au") - setprop vendor.display.lcd_density 160 - ;; - *) - ;; -esac - -case "$product" in - "msmnile_gvmq") - setprop vendor.display.lcd_density 160 - ;; - *) - ;; -esac # Setup display nodes & permissions # HDMI can be fb1 or fb2 # Loop through the sysfs nodes and determine diff --git a/rootdir/bin/init.qcom.post_boot.sh b/rootdir/bin/init.qcom.post_boot.sh index a5c22847..91b9f0e5 100644 --- a/rootdir/bin/init.qcom.post_boot.sh +++ b/rootdir/bin/init.qcom.post_boot.sh @@ -1,4 +1,4 @@ -#! /vendor/bin/sh +#!/vendor/bin/sh # Copyright (c) 2012-2013, 2016-2020, The Linux Foundation. All rights reserved. # diff --git a/rootdir/bin/init.qcom.sh b/rootdir/bin/init.qcom.sh index d3a0c82d..c7047d02 100644 --- a/rootdir/bin/init.qcom.sh +++ b/rootdir/bin/init.qcom.sh @@ -1,4 +1,4 @@ -#! /vendor/bin/sh +#!/vendor/bin/sh # Copyright (c) 2009-2016, The Linux Foundation. All rights reserved. # @@ -28,12 +28,6 @@ # target=`getprop ro.board.platform` -low_ram=`getprop ro.config.low_ram` -if [ -f /sys/devices/soc0/soc_id ]; then - platformid=`cat /sys/devices/soc0/soc_id` -else - platformid=`cat /sys/devices/system/soc/soc0/id` -fi start_battery_monitor() { @@ -80,58 +74,6 @@ start_vm_bms() fi } -start_msm_irqbalance_8939() -{ - if [ -f /vendor/bin/msm_irqbalance ]; then - case "$platformid" in - "239" | "293" | "294" | "295" | "304" | "338" | "313" | "353" | "354") - start vendor.msm_irqbalance;; - "349" | "350" ) - start vendor.msm_irqbal_lb;; - esac - fi -} - -start_msm_irqbalance_msmnile() -{ - if [ -f /vendor/bin/msm_irqbalance ]; then - start vendor.msm_irqbalance - fi -} - -start_msm_irqbalance_kona() -{ - if [ -f /vendor/bin/msm_irqbalance ]; then - start vendor.msm_irqbalance - fi -} - -start_msm_irqbalance_lito() -{ - if [ -f /vendor/bin/msm_irqbalance ]; then - start vendor.msm_irqbalance - fi -} - -start_msm_irqbalance_atoll() -{ - if [ -f /vendor/bin/msm_irqbalance ]; then - start vendor.msm_irqbalance - fi -} - -start_msm_irqbalance660() -{ - if [ -f /vendor/bin/msm_irqbalance ]; then - case "$platformid" in - "317" | "321" | "324" | "325" | "326" | "336" | "345" | "346" | "360" | "393") - start vendor.msm_irqbalance;; - "318" | "327" | "385") - start vendor.msm_irqbl_sdm630;; - esac - fi -} - start_msm_irqbalance() { if [ -f /vendor/bin/msm_irqbalance ]; then @@ -149,281 +91,9 @@ case "$baseband" in esac case "$target" in - "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") - if [ -f /sys/devices/soc0/hw_platform ]; then - value=`cat /sys/devices/soc0/hw_platform` - else - value=`cat /sys/devices/system/soc/soc0/hw_platform` - fi - case "$value" in - "Fluid") - start profiler_daemon;; - esac - ;; - "msm8660" ) - if [ -f /sys/devices/soc0/hw_platform ]; then - platformvalue=`cat /sys/devices/soc0/hw_platform` - else - platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform` - fi - case "$platformvalue" in - "Fluid") - start profiler_daemon;; - esac - ;; - "msm8960") - case "$baseband" in - "msm") - start_battery_monitor;; - esac - - if [ -f /sys/devices/soc0/hw_platform ]; then - platformvalue=`cat /sys/devices/soc0/hw_platform` - else - platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform` - fi - case "$platformvalue" in - "Fluid") - start profiler_daemon;; - "Liquid") - start profiler_daemon;; - esac - ;; - "msm8974") - platformvalue=`cat /sys/devices/soc0/hw_platform` - case "$platformvalue" in - "Fluid") - start profiler_daemon;; - "Liquid") - start profiler_daemon;; - esac - case "$baseband" in - "msm") - start_battery_monitor - ;; - esac - start_charger_monitor - ;; - "sdm660") - if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` - else - soc_id=`cat /sys/devices/system/soc/soc0/id` - fi - - if [ -f /sys/devices/soc0/hw_platform ]; then - hw_platform=`cat /sys/devices/soc0/hw_platform` - else - hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` - fi - - case "$soc_id" in - "317" | "324" | "325" | "326" | "318" | "327" ) - case "$hw_platform" in - "Surf") - setprop qemu.hw.mainkeys 0 - ;; - "MTP") - setprop qemu.hw.mainkeys 0 - ;; - "RCM") - setprop qemu.hw.mainkeys 0 - ;; - "QRD") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - esac - start_msm_irqbalance660 - ;; - "apq8084") - platformvalue=`cat /sys/devices/soc0/hw_platform` - case "$platformvalue" in - "Fluid") - start profiler_daemon;; - "Liquid") - start profiler_daemon;; - esac - ;; - "msm8226") - start_charger_monitor - ;; - "msm8610") - start_charger_monitor - ;; - "msm8916") - start_vm_bms - start_msm_irqbalance_8939 - if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` - else - soc_id=`cat /sys/devices/system/soc/soc0/id` - fi - - if [ -f /sys/devices/soc0/platform_subtype_id ]; then - platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` - fi - if [ -f /sys/devices/soc0/hw_platform ]; then - hw_platform=`cat /sys/devices/soc0/hw_platform` - fi - case "$soc_id" in - "239") - case "$hw_platform" in - "Surf") - case "$platform_subtype_id" in - "1") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - "MTP") - case "$platform_subtype_id" in - "3") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - esac - ;; - esac - ;; - "msm8994" | "msm8992" | "msm8998" | "apq8098_latv" | "sdm845" | "sdm710" | "qcs605" | "sm6150" | "trinket" | "bengal") + "sdm845") start_msm_irqbalance ;; - "msm8996") - if [ -f /sys/devices/soc0/hw_platform ]; then - hw_platform=`cat /sys/devices/soc0/hw_platform` - fi - case "$hw_platform" in - "MTP" | "CDP") - #Loop through the sysfs nodes and determine the correct sysfs to change the permission and ownership. - for count in 0 1 2 3 4 5 6 7 8 9 10 - do - dir="/sys/devices/soc/75ba000.i2c/i2c-12/12-0020/input/input"$count - if [ -d "$dir" ]; then - chmod 0660 $dir/secure_touch_enable - chmod 0440 $dir/secure_touch - chown system.drmrpc $dir/secure_touch_enable - chown system.drmrpc $dir/secure_touch - break - fi - done - ;; - esac - ;; - "msm8909") - start_vm_bms - ;; - "msmnile") - start_msm_irqbalance_msmnile - ;; - "kona") - start_msm_irqbalance_kona - ;; - "lito") - start_msm_irqbalance_lito - ;; - "atoll") - start_msm_irqbalance_atoll - ;; - "msm8937") - start_msm_irqbalance_8939 - if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` - else - soc_id=`cat /sys/devices/system/soc/soc0/id` - fi - - if [ -f /sys/devices/soc0/hw_platform ]; then - hw_platform=`cat /sys/devices/soc0/hw_platform` - else - hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` - fi - if [ "$low_ram" != "true" ]; then - case "$soc_id" in - "294" | "295" | "303" | "307" | "308" | "309" | "313" | "320" | "353" | "354" | "363" | "364") - case "$hw_platform" in - "Surf") - setprop qemu.hw.mainkeys 0 - ;; - "MTP") - setprop qemu.hw.mainkeys 0 - ;; - "RCM") - setprop qemu.hw.mainkeys 0 - ;; - "QRD") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - esac - fi - ;; - "msm8953") - start_msm_irqbalance_8939 - if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` - else - soc_id=`cat /sys/devices/system/soc/soc0/id` - fi - - if [ -f /sys/devices/soc0/hw_platform ]; then - hw_platform=`cat /sys/devices/soc0/hw_platform` - else - hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` - fi - case "$soc_id" in - "293" | "304" | "338" | "351" | "349" | "350" ) - case "$hw_platform" in - "Surf") - setprop qemu.hw.mainkeys 0 - ;; - "MTP") - setprop qemu.hw.mainkeys 0 - ;; - "RCM") - setprop qemu.hw.mainkeys 0 - ;; - "QRD") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - esac - ;; - "sdm710") - if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` - else - soc_id=`cat /sys/devices/system/soc/soc0/id` - fi - - if [ -f /sys/devices/soc0/hw_platform ]; then - hw_platform=`cat /sys/devices/soc0/hw_platform` - else - hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` - fi - case "$soc_id" in - "336" | "337" | "347" | "360" | "393" ) - case "$hw_platform" in - "Surf") - setprop qemu.hw.mainkeys 0 - ;; - "MTP") - setprop qemu.hw.mainkeys 0 - ;; - "RCM") - setprop qemu.hw.mainkeys 0 - ;; - "QRD") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - esac - ;; esac # diff --git a/rootdir/bin/init.qcom.usb.sh b/rootdir/bin/init.qcom.usb.sh deleted file mode 100644 index 5c377b73..00000000 --- a/rootdir/bin/init.qcom.usb.sh +++ /dev/null @@ -1,231 +0,0 @@ -#!/vendor/bin/sh -# Copyright (c) 2012-2018, 2020 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. -# -# - -if [ "$(getprop ro.vendor.lge.platform.type)" != "jump" ]; then - exit 1; -fi - -# Set platform variables -soc_hwplatform=`cat /sys/devices/soc0/hw_platform 2> /dev/null` -soc_machine=`cat /sys/devices/soc0/machine 2> /dev/null` -soc_machine=${soc_machine:0:2} -soc_id=`cat /sys/devices/soc0/soc_id 2> /dev/null` - -# -# Check ESOC for external modem -# -# Note: currently only a single MDM/SDX is supported -# -esoc_name=`cat /sys/bus/esoc/devices/esoc0/esoc_name 2> /dev/null` - -target=`getprop ro.board.platform` - -# -# Override USB default composition -# -# If USB persist config not set, set default configuration -if [ "$(getprop persist.vendor.usb.config)" == "" -a "$(getprop ro.build.type)" != "user" -a \ - "$(getprop init.svc.vendor.usb-gadget-hal-1-0)" != "running" ]; then - if [ "$esoc_name" != "" ]; then - setprop persist.vendor.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb - else - case "$(getprop ro.baseband)" in - "apq") - setprop persist.vendor.usb.config diag,adb - ;; - *) - case "$soc_hwplatform" in - "Dragon" | "SBC") - setprop persist.vendor.usb.config diag,adb - ;; - *) - case "$soc_machine" in - "SA") - setprop persist.vendor.usb.config diag,adb - ;; - *) - case "$target" in - "msm8996") - setprop persist.vendor.usb.config diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,adb - ;; - "msm8909") - setprop persist.vendor.usb.config diag,serial_smd,rmnet_qti_bam,adb - ;; - "msm8937") - if [ -d /config/usb_gadget ]; then - setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb - else - case "$soc_id" in - "313" | "320") - setprop persist.vendor.usb.config diag,serial_smd,rmnet_ipa,adb - ;; - *) - setprop persist.vendor.usb.config diag,serial_smd,rmnet_qti_bam,adb - ;; - esac - fi - ;; - "msm8953") - if [ -d /config/usb_gadget ]; then - setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb - else - setprop persist.vendor.usb.config diag,serial_smd,rmnet_ipa,adb - fi - ;; - "msm8998" | "sdm660" | "apq8098_latv") - setprop persist.vendor.usb.config diag,serial_cdev,rmnet,adb - ;; - "sdm845" | "sdm710") - setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb - ;; - "msmnile" | "sm6150" | "trinket" | "lito" | "atoll" | "bengal" | "lahaina" | "holi") - setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,qdss,adb - ;; - *) - setprop persist.vendor.usb.config diag,adb - ;; - esac - ;; - esac - ;; - esac - ;; - esac - fi -fi - -# This check is needed for GKI 1.0 targets where QDSS is not available -if [ "$(getprop persist.vendor.usb.config)" == "diag,serial_cdev,rmnet,dpl,qdss,adb" -a \ - ! -d /config/usb_gadget/g1/functions/qdss.qdss ]; then - setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb -fi - -# Start peripheral mode on primary USB controllers for Automotive platforms -case "$soc_machine" in - "SA") - if [ -f /sys/bus/platform/devices/a600000.ssusb/mode ]; then - default_mode=`cat /sys/bus/platform/devices/a600000.ssusb/mode` - case "$default_mode" in - "none") - echo peripheral > /sys/bus/platform/devices/a600000.ssusb/mode - ;; - esac - fi - ;; -esac - -# check configfs is mounted or not -if [ -d /config/usb_gadget ]; then - # Chip-serial is used for unique MSM identification in Product string - msm_serial=`cat /sys/devices/soc0/serial_number`; - msm_serial_hex=`printf %08X $msm_serial` - machine_type=`cat /sys/devices/soc0/machine` - setprop vendor.usb.product_string "$machine_type-$soc_hwplatform _SN:$msm_serial_hex" - - # ADB requires valid iSerialNumber; if ro.serialno is missing, use dummy - serialnumber=`cat /config/usb_gadget/g1/strings/0x409/serialnumber 2> /dev/null` - if [ "$serialnumber" == "" ]; then - serialno=1234567 - echo $serialno > /config/usb_gadget/g1/strings/0x409/serialnumber - fi - setprop vendor.usb.configfs 1 -fi - -# -# Initialize RNDIS Diag option. If unset, set it to 'none'. -# -diag_extra=`getprop persist.vendor.usb.config.extra` -if [ "$diag_extra" == "" ]; then - setprop persist.vendor.usb.config.extra none -fi - -# enable rps cpus on msm8937 target -setprop vendor.usb.rps_mask 0 -case "$soc_id" in - "294" | "295" | "353" | "354") - setprop vendor.usb.rps_mask 40 - ;; -esac - -# -# Initialize UVC conifguration. -# -if [ -d /config/usb_gadget/g1/functions/uvc.0 ]; then - cd /config/usb_gadget/g1/functions/uvc.0 - - echo 3072 > streaming_maxpacket - echo 1 > streaming_maxburst - mkdir control/header/h - ln -s control/header/h control/class/fs/ - ln -s control/header/h control/class/ss - - mkdir -p streaming/uncompressed/u/360p - echo "666666\n1000000\n5000000\n" > streaming/uncompressed/u/360p/dwFrameInterval - - mkdir -p streaming/uncompressed/u/720p - echo 1280 > streaming/uncompressed/u/720p/wWidth - echo 720 > streaming/uncompressed/u/720p/wWidth - echo 29491200 > streaming/uncompressed/u/720p/dwMinBitRate - echo 29491200 > streaming/uncompressed/u/720p/dwMaxBitRate - echo 1843200 > streaming/uncompressed/u/720p/dwMaxVideoFrameBufferSize - echo 5000000 > streaming/uncompressed/u/720p/dwDefaultFrameInterval - echo "5000000\n" > streaming/uncompressed/u/720p/dwFrameInterval - - mkdir -p streaming/mjpeg/m/360p - echo "666666\n1000000\n5000000\n" > streaming/mjpeg/m/360p/dwFrameInterval - - mkdir -p streaming/mjpeg/m/720p - echo 1280 > streaming/mjpeg/m/720p/wWidth - echo 720 > streaming/mjpeg/m/720p/wWidth - echo 29491200 > streaming/mjpeg/m/720p/dwMinBitRate - echo 29491200 > streaming/mjpeg/m/720p/dwMaxBitRate - echo 1843200 > streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize - echo 5000000 > streaming/mjpeg/m/720p/dwDefaultFrameInterval - echo "5000000\n" > streaming/mjpeg/m/720p/dwFrameInterval - - echo 0x04 > /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bmaControls - - mkdir -p streaming/h264/h/960p - echo 1920 > streaming/h264/h/960p/wWidth - echo 960 > streaming/h264/h/960p/wWidth - echo 40 > streaming/h264/h/960p/bLevelIDC - echo "333667\n" > streaming/h264/h/960p/dwFrameInterval - - mkdir -p streaming/h264/h/1920p - echo "333667\n" > streaming/h264/h/1920p/dwFrameInterval - - mkdir streaming/header/h - ln -s streaming/uncompressed/u streaming/header/h - ln -s streaming/mjpeg/m streaming/header/h - ln -s streaming/h264/h streaming/header/h - ln -s streaming/header/h streaming/class/fs/ - ln -s streaming/header/h streaming/class/hs/ - ln -s streaming/header/h streaming/class/ss/ -fi diff --git a/rootdir/etc/init/hw/init.lge.usb.rc b/rootdir/etc/init/hw/init.lge.usb.rc index c776783d..3867870c 100644 --- a/rootdir/etc/init/hw/init.lge.usb.rc +++ b/rootdir/etc/init/hw/init.lge.usb.rc @@ -66,7 +66,7 @@ on boot mount functionfs diag_mdm2 /dev/ffs-diag-2 uid=2000,gid=1000,rmode=0770,fmode=0660,no_disconnect=1 setprop sys.usb.mtp.device_type 3 setprop vendor.lge.usb.controller ${sys.usb.controller} - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.sh ${persist.sys.usb.config} + exec /vendor/bin/init.lge.usb.sh ${persist.sys.usb.config} on boot && property:vendor.usb.use_ffs_mtp=1 mkdir /config/usb_gadget/g1/functions/ffs.mtp @@ -76,15 +76,6 @@ on boot && property:vendor.usb.use_ffs_mtp=1 mkdir /dev/usb-ffs/ptp 0770 mtp mtp mount functionfs ptp /dev/usb-ffs/ptp rmode=0770,fmode=0660,uid=1024,gid=1024,no_disconnect=1 -service vendor.lge-usb-def-sh /vendor/bin/init.lge.usb.default.sh ${persist.sys.usb.config} - class core - user root - oneshot - disabled - -on property:persist.vendor.lge.usb.provisioned=1 - start vendor.lge-usb-def-sh - on property:vendor.lge.usb.persist.config=* setprop persist.sys.usb.config ${vendor.lge.usb.persist.config} @@ -246,14 +237,6 @@ service vendor.upnp_server /vendor/bin/upnp-server disabled oneshot -service vendor.stop_upnp /system/bin/pkill upnp-server - disabled - oneshot - -service vendor.stop_mausbd /system/bin/pkill mausbd - disabled - oneshot - on property:persist.vendor.lge.mausb.enable=1 start vendor.mausbueventd @@ -324,9 +307,6 @@ on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,dpl # LAO ################################################################################ -on property:persist.vendor.lge.usb.diag_enable=* - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.diag.sh ${persist.vendor.lge.usb.diag_enable} - # adb on property:sys.usb.config=adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 @@ -343,13 +323,13 @@ on property:sys.usb.config=adb && property:sys.usb.configfs=0 # boot on property:sys.usb.config=boot && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=boot,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 start adbd setprop sys.usb.state ${sys.usb.config} @@ -357,13 +337,13 @@ on property:sys.usb.config=boot,adb && property:sys.usb.configfs=0 # charge_only on property:sys.usb.config=charge_only && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=charge_only,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 start adbd setprop sys.usb.state ${sys.usb.config} @@ -371,13 +351,13 @@ on property:sys.usb.config=charge_only,adb && property:sys.usb.configfs=0 # mtp on property:sys.usb.config=mtp && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 start adbd setprop sys.usb.state ${sys.usb.config} @@ -385,13 +365,13 @@ on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=0 # ptp on property:sys.usb.config=ptp && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 start adbd setprop sys.usb.state ${sys.usb.config} @@ -399,13 +379,13 @@ on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=0 # rndis on property:sys.usb.config=rndis && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 start adbd setprop sys.usb.state ${sys.usb.config} @@ -413,13 +393,13 @@ on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=0 # cdrom_storage on property:sys.usb.config=cdrom_storage && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=cdrom_storage,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 - exec u:r:lge-usb-sh:s0 -- /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} + exec /vendor/bin/init.lge.usb.lao.sh ${sys.usb.config} write /sys/class/android_usb/android0/enable 1 start adbd setprop sys.usb.state ${sys.usb.config} diff --git a/rootdir/etc/init/hw/init.qcom.rc b/rootdir/etc/init/hw/init.qcom.rc index a06fcc39..9edcba48 100644 --- a/rootdir/etc/init/hw/init.qcom.rc +++ b/rootdir/etc/init/hw/init.qcom.rc @@ -89,10 +89,7 @@ on early-boot # Allow subsystem (modem etc) debugging write /sys/kernel/debug/bootkpi/kpi_values "M - Start adsp" write /sys/kernel/boot_adsp/boot 1 - - # for boot time, move to init.qcom.devstart.sh - #write /sys/kernel/boot_cdsp/boot 1 - exec_background u:r:vendor_qti_init_shell:s0 -- /vendor/bin/init.qcom.devstart.sh + write /sys/kernel/boot_cdsp/boot 1 write /sys/devices/virtual/npu/msm_npu/boot 1 write /sys/kernel/boot_slpi/boot 1 @@ -175,11 +172,6 @@ on boot # Enable PowerHAL hint processing setprop vendor.powerhal.init 1 - - #Remove SUID bit for iproute2 ip tool - chmod 0755 /system/bin/ip - - chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state setprop net.tcp.2g_init_rwnd 10 @@ -533,12 +525,6 @@ service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config" user root oneshot -service qmiproxy /system/bin/qmiproxy - class main - user radio - group radio diag - disabled - service vendor.wigig_supplicant /vendor/bin/hw/wpa_supplicant \ -iwigig0 -Dnl80211 -c/data/vendor/wifi/wigig_supplicant.conf \ -m/data/vendor/wifi/wigig_p2p_supplicant.conf \ @@ -554,14 +540,6 @@ service vendor.wigig_supplicant /vendor/bin/hw/wpa_supplicant \ disabled oneshot -# Data Migration -service vendor.move_wifi_data /system/bin/move_wifi_data.sh - class main - user wifi - group wifi - disabled - oneshot - service wigignpt /vendor/bin/wigignpt # interface vendor.qti.hardware.wigig.netperftuner@1.0::INetPerfTuner default class hal @@ -581,46 +559,6 @@ service vendor.sensingdaemon /vendor/bin/sensingdaemon group wifi disabled -service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG - class late_start - disabled - oneshot - -service dhcpcd_bond0 /system/bin/dhcpcd -ABKLG - class late_start - disabled - oneshot - -service dhcpcd_p2p /system/bin/dhcpcd -ABKLG - class late_start - disabled - oneshot - -service dhcpcd_wigig0 /system/bin/dhcpcd -ABKLG - class late_start - disabled - oneshot - -service iprenew_wlan0 /system/bin/dhcpcd -n - class late_start - disabled - oneshot - -service iprenew_bond0 /system/bin/dhcpcd -n - class late_start - disabled - oneshot - -service iprenew_p2p /system/bin/dhcpcd -n - class late_start - disabled - oneshot - -service iprenew_wigig0 /system/bin/dhcpcd -n - class late_start - disabled - oneshot - service ptt_socket_app /system/vendor/bin/ptt_socket_app -d class main user wifi @@ -654,16 +592,6 @@ on property:sys.shutdown.requested=* write /sys/kernel/shutdown_wlan/shutdown 1 stop cnss-daemon -service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG - class late_start - disabled - oneshot - -service iprenew_bt-pan /system/bin/dhcpcd -n - class late_start - disabled - oneshot - service ssgqmigd /vendor/bin/ssgqmigd class late_start user radio @@ -704,13 +632,6 @@ service qcom-post-boot /vendor/bin/init.qcom.post_boot.sh disabled oneshot -service qti-testscripts /system/bin/sh /product/etc/init.qcom.testscripts.sh - class late_start - user root - disabled - oneshot - seclabel u:r:qti-testscripts:s0 - service wifi-sdio-on /vendor/bin/init.qcom.sdio.sh class late_start group wifi inet @@ -725,7 +646,6 @@ service wifi-crda /vendor/bin/init.crda.sh on property:sys.boot_completed=1 start qcom-post-boot - start qti-testscripts on property:ro.vendor.ril.mbn_copy_completed=1 write /data/vendor/radio/copy_complete 1 @@ -770,12 +690,6 @@ service vendor.ril-daemon3 /vendor/bin/hw/rild -c 3 group radio cache inet misc audio sdcard_r sdcard_rw diag oem_2901 log capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW -service profiler_daemon /system/bin/profiler_daemon - class late_start - user root - group root - disabled - service charger /system/bin/charger class charger user system @@ -909,12 +823,6 @@ service chre /vendor/bin/chre on property:vendor.chre.enabled=0 stop chre -service bugreport /system/bin/dumpstate -d -p -B -z -o /data/user_de/0/com.android.shell/files/bugreports/bugreport - class main - disabled - oneshot - keycodes 114 115 116 - #Set GPU Opengles version on property:vendor.opengles.version=* setprop ro.opengles.version ${vendor.opengles.version} @@ -937,11 +845,5 @@ service vendor.audio-hal /vendor/bin/hw/android.hardware.audio.service #hax for safnet import /vendor/etc/init/hw/init.safailnet.rc -on property:init.svc.cnss_diag=running - stop cnss_diag - -on property:init.svc.tcpdump=running - stop tcpdump - on property:init.svc.vendor.ipacm-diag=running stop vendor.ipacm-diag diff --git a/rootdir/etc/init/hw/init.qcom.usb.rc b/rootdir/etc/init/hw/init.qcom.usb.rc index a419a7d2..9d7d7440 100644 --- a/rootdir/etc/init/hw/init.qcom.usb.rc +++ b/rootdir/etc/init/hw/init.qcom.usb.rc @@ -38,14 +38,10 @@ on charger mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 write /config/usb_gadget/g1/configs/b.1/MaxPower 900 symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 - exec u:r:vendor_qti_init_shell:s0 -- /vendor/bin/init.qcom.usb.sh write /config/usb_gadget/g1/strings/0x409/product ${vendor.usb.product_string} setprop sys.usb.config mass_storage setprop sys.usb.configfs 1 -on init - exec u:r:vendor-qti-testscripts:s0 -- /vendor/bin/sh /vendor/bin/init.qti.usb.debug.sh - on boot mount configfs none /config mkdir /config/usb_gadget/g1 0755 @@ -110,7 +106,6 @@ on boot mkdir /dev/ffs-diag-2 0770 shell system mount functionfs diag_mdm2 /dev/ffs-diag-2 uid=2000,gid=1000,rmode=0770,fmode=0660,no_disconnect=1 setprop sys.usb.mtp.device_type 3 - exec u:r:vendor_qti_init_shell:s0 -- /vendor/bin/init.qcom.usb.sh write /config/usb_gadget/g1/strings/0x409/product ${vendor.usb.product_string} write /config/usb_gadget/g2/strings/0x409/product ${vendor.usb.product_string} setprop sys.usb.config ${persist.vendor.usb.config} diff --git a/rootdir/etc/init/hw/init.qti.ufs.rc b/rootdir/etc/init/hw/init.qti.ufs.rc deleted file mode 100644 index a37e55ee..00000000 --- a/rootdir/etc/init/hw/init.qti.ufs.rc +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2011-2016, 2018-2020 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. -# - -on init - exec u:r:vendor-qti-testscripts:s0 -- /vendor/bin/sh /vendor/bin/init.qti.ufs.debug.sh diff --git a/rootdir/etc/init/hw/init.safailnet.rc b/rootdir/etc/init/hw/init.safailnet.rc index c0682315..7e411145 100644 --- a/rootdir/etc/init/hw/init.safailnet.rc +++ b/rootdir/etc/init/hw/init.safailnet.rc @@ -3,5 +3,5 @@ # Ported to ramdisk by jhenrique09 on boot - # selinux nodes, hide permissive state + # hide selinux node chmod 0440 /sys/fs/selinux/policy diff --git a/rootdir/etc/init/hw/init.sdm845.rc b/rootdir/etc/init/hw/init.sdm845.rc index a7f11d87..29a79543 100644 --- a/rootdir/etc/init/hw/init.sdm845.rc +++ b/rootdir/etc/init/hw/init.sdm845.rc @@ -38,9 +38,6 @@ on fs chown system system /proc/reclaim_pid - # We use reservedsize option in fstab instead of tune2fs. No more use tune2fs - # Executing tune2fs to reserve some region in /data.(40MB) - # exec /system/bin/tune2fs -u system -r 10240 /dev/block/bootdevice/by-name/userdata on late-fs mount_all /vendor/etc/fstab.${ro.hardware} --late diff --git a/rootdir/etc/init/hw/init.target.rc b/rootdir/etc/init/hw/init.target.rc index 4b5fbaba..4b098281 100644 --- a/rootdir/etc/init/hw/init.target.rc +++ b/rootdir/etc/init/hw/init.target.rc @@ -33,7 +33,6 @@ on early-init mkdir /dsp 0771 media media mkdir /firmware 0771 system system mkdir /bt_firmware 0771 system system - symlink /data/tombstones /tombstones on init write /dev/stune/foreground/schedtune.sched_boost_no_override 1 @@ -110,15 +109,6 @@ service sec_nvm /vendor/bin/sec_nvm user system group system -on post-fs-data - mkdir /data/tombstones 0771 system system - mkdir /tombstones/modem 0771 system system - mkdir /tombstones/lpass 0771 system system - mkdir /tombstones/wcnss 0771 system system - mkdir /tombstones/dsps 0771 system system - mkdir /data/vendor/hbtp 0750 system system - mkdir /data/vendor/nnhal 0700 system system - # For cpusets initialize for Silver Only first and then Silver + Gold # Silver Only configuration cannot work with 0-7 on boot @@ -155,11 +145,6 @@ on property:vendor.usb.controller=* #Load WLAN driver insmod /vendor/lib/modules/qca_cld3_wlan.ko -#start camera server as daemon -#service qcamerasvr /system/bin/mm-qcamera-daemon -# class late_start -# user camera -# group camera system inet input graphics #pd-mapper service vendor.pd_mapper /vendor/bin/pd-mapper class core @@ -214,11 +199,6 @@ service hdcp_srm /vendor/bin/hdcp_srm user system group system -#service qosmgrd /system/bin/qosmgr /system/etc/qosmgr_rules.xml -# user system -# group system -# disabled -# service thermal-engine /system/vendor/bin/thermal-engine class main user root @@ -228,149 +208,6 @@ service thermal-engine /system/vendor/bin/thermal-engine socket thermal-send-rule stream 0660 system system group root -#service security-check1 /sbin/security_boot_check system -# class core -# oneshot -# -#service security-check2 /sbin/security_boot_check recovery -# class core -# oneshot -# -#service time_daemon /system/vendor/bin/time_daemon -# class late_start -# user root -# group root - -#service audiod /vendor/bin/audiod -# class late_start -# user system -# group system -# -#service usf_tester /vendor/bin/usf_tester -# user system -# group system inet -# disabled -# -#service usf_epos /vendor/bin/usf_epos -# user system -# group system inet -# disabled -# -#service usf_gesture /vendor/bin/usf_gesture -# user system -# group system inet -# disabled -# - -#service usf_sync_gesture /system/bin/usf_sync_gesture -# user system -# group system inet -# disabled -# - -#service usf_p2p /system/bin/usf_p2p -# user system -# group system inet -# disabled -# -#service usf_hovering /vendor/bin/usf_hovering -# user system -# group system inet -# disabled -# -#service usf_proximity /system/bin/usf_proximity -# user system -# group system inet -# disabled -# -#service usf-post-boot /system/vendor/bin/sh /system/etc/usf_post_boot.sh -# class late_start -# user root -# disabled -# oneshot -# -#on property:init.svc.bootanim=stopped -# start usf-post-boot -# -# -#on boot -# insmod /system/lib/modules/adsprpc.ko -# insmod /system/lib/modules/mhi.ko -## access permission for secure touch -# chmod 0660 /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch_enable -# chmod 0440 /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch -# chmod 0660 /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch_enable -# chmod 0440 /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch -# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch_enable -# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch -# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch_enable -# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch -# -# -# -#service mdm_helper /system/bin/mdm_helper -# class core -# onrestart setprop ro.service.mdm_helper_restarted "true" -# disabled -# -#service mdm_helper_proxy /system/bin/mdm_helper_proxy -# class core -# disabled -# -#service mdm_launcher /system/bin/sh /init.mdm.sh -# class main -# oneshot -# -#service qcamerasvr /system/bin/mm-qcamera-daemon -# class late_start -# user camera -# group camera system inet input graphics -# -# Stop mdm_helper_proxy in case of shutdown -#on property:sys.shutdown.requested=* -# stop mdm_helper_proxy -# -# Stop mdm_helper_proxy on APQ target -#on property:ro.radio.noril=yes -# stop mdm_helper_proxy -# -#on property:persist.airplane.mode.pwr.svg=enabled -# setprop ro.mdm_helper_proxy_req false -# -#on property:init.svc.ril-daemon=running -# setprop ro.mdm_helper_proxy_req true -# -## Start mdm_helper_proxy -#on property:ro.mdm_helper_proxy_req=true -# start mdm_helper_proxy -# -## QCA1530 SoC core detect -#service gnss-detect /system/vendor/bin/gnss.qca1530.sh detect -# class core -# oneshot -# -## QCA1530 SoC late_start group trigger -#service gnss-init /system/vendor/bin/gnss.qca1530.sh init -# class late_start -# oneshot -# -## QCA1530 SoC Service Daemon -#service gnss-svcd /system/vendor/bin/gnss.qca1530.sh start -# class late_start -# user root -# group gps system qcom_diag diag log inet net_raw -# disabled - -# LGE_WIFI, Block qcom cnss_diag service start -#on property:vold.decrypt=trigger_restart_framework -# start cnss_diag -# -#service cnss_diag /system/vendor/bin/cnss_diag -q -f -t HELIUM -# class main -# user system -# group system wifi inet sdcard_rw media_rw diag -# oneshot - service ppd /vendor/bin/mm-pp-dpps class late_start user system @@ -387,24 +224,6 @@ on property:init.svc.vendor.hwcomposer-2-2=running on property:init.svc.vendor.hwcomposer-2-2=restarting stop ppd -#service nqs /system/bin/nqs -# class late_start -# socket nqs_qsb_comm stream 660 system system -# user system -# group drmrpc -# -#service adsprpcd /system/vendor/bin/adsprpcd -# class main -# user media -# group media -# -##Start picture quality tuning service -#service vqttoolservice /system/bin/vqttoolservice -# class late_start -# socket vqtss stream 0660 system system -# user system -# group system - service hbtp /system/vendor/bin/hbtp_daemon class main user system diff --git a/rootdir/etc/init/init.lge.vendor.on_post_fs_data.rc b/rootdir/etc/init/init.lge.vendor.on_post_fs_data.rc index 38aa8ca1..8490a530 100644 --- a/rootdir/etc/init/init.lge.vendor.on_post_fs_data.rc +++ b/rootdir/etc/init/init.lge.vendor.on_post_fs_data.rc @@ -50,9 +50,6 @@ on post-fs-data chown system system /sys/devices/virtual/input/lge_touch/sp_link_touch_off # LGE_CHANGE_E, [display] feature : SP MIRRORING - #NTCODE_LISTING - mkdir /data/app-system 0771 system system - #LGP_DATA_APN_BACKUP mkdir /mnt/vendor/persist-lg/lgdata 0775 radio radio @@ -92,7 +89,7 @@ on post-fs-data restorecon /sys/kernel/debug/tzdbg restorecon_recursive /sys/kernel/debug/tzdbg - #Widevine firmware copy + # Widevine firmware copy # reducing booting time. changing to background start exec_background - system system -- /vendor/bin/cpfirmware widevine /mnt/vendor/persist-lg/firmware @@ -105,7 +102,7 @@ on post-fs-data mkdir /vendor/persist-lg/rtnlastdate 0770 system radio #Create camera dir for EEPROM data - mkdir mnt/vendor/persist-lg/camera 0771 cameraserver radio + mkdir /mnt/vendor/persist-lg/camera 0771 cameraserver radio #Create Touch self test folder mkdir /data/vendor/touch 0771 system system diff --git a/rootdir/etc/init/vendor.lge.power.rc b/rootdir/etc/init/vendor.lge.power.rc index 613c43f3..878de390 100644 --- a/rootdir/etc/init/vendor.lge.power.rc +++ b/rootdir/etc/init/vendor.lge.power.rc @@ -248,12 +248,8 @@ on boot chmod 664 /sys/class/power/vfps/vfps_fcnt chown system system /sys/class/power/vfps/vfps_ratio chmod 664 /sys/class/power/vfps/vfps_ratio - chown system system /sys/class/power_supply/battery/input_suspend - chmod 664 /sys/class/power_supply/battery/input_suspend chown system system /sys/class/power_supply/battery/safety_timer_enabled chmod 664 /sys/class/power_supply/battery/safety_timer_enabled - chown system system /sys/class/power_supply/battery/battery_charging_enabled - chmod 664 /sys/class/power_supply/battery/battery_charging_enabled chown system system /sys/devices/virtual/lg_rgb_led/use_patterns/blink_patterns chmod 0644 /sys/devices/virtual/lg_rgb_led/use_patterns/blink_patterns chown system system /sys/devices/virtual/lg_rgb_led/use_patterns/input_patterns diff --git a/rootdir/etc/ueventd.rc b/rootdir/etc/ueventd.rc index 18231a38..00119a65 100644 --- a/rootdir/etc/ueventd.rc +++ b/rootdir/etc/ueventd.rc @@ -413,3 +413,7 @@ firmware_directories /vendor/firmware_mnt/image/ /sys/class/kgsl/kgsl-3d0 force_bus_on 0664 root system /sys/class/kgsl/kgsl-3d0 force_clk_on 0664 root system /sys/class/kgsl/kgsl-3d0 bus_split 0664 root system + +# Charger +/sys/class/power_supply/battery battery_charging_enabled 0660 system system +/sys/class/power_supply/battery input_suspend 0660 system system diff --git a/sdm845.mk b/sdm845.mk index 0a1cec41..3fe213ae 100644 --- a/sdm845.mk +++ b/sdm845.mk @@ -15,7 +15,7 @@ # # Inherit proprietary blobs -$(call inherit-product-if-exists, vendor/lge/sdm845-common/sdm845-common-vendor.mk) +$(call inherit-product, vendor/lge/sdm845-common/sdm845-common-vendor.mk) COMMON_PATH := device/lge/sdm845-common @@ -228,7 +228,7 @@ PRODUCT_PACKAGES += \ # Display PRODUCT_PACKAGES += \ - android.hardware.graphics.composer@2.2-service \ + android.hardware.graphics.composer@2.3-service \ android.hardware.graphics.mapper@2.0-impl-qti-display \ vendor.qti.hardware.display.allocator-service \ android.hardware.memtrack@1.0-impl \ @@ -452,7 +452,6 @@ PRODUCT_PACKAGES += \ # Power PRODUCT_PACKAGES += \ - android.hardware.power@1.2 \ android.hardware.power@1.2.vendor \ android.hardware.power-service.lge-libperfmgr \ android.hardware.power.stats@1.0-service.lge @@ -528,7 +527,7 @@ PRODUCT_SOONG_NAMESPACES += \ $(LOCAL_PATH) \ hardware/google/interfaces \ hardware/google/pixel \ - hardware/lge/ + hardware/lge # Telephony PRODUCT_PACKAGES += \ @@ -543,16 +542,24 @@ PRODUCT_BOOT_JARS += \ # Lights PRODUCT_PACKAGES += \ - android.hardware.light@2.0-service.lge_sdm845 + android.hardware.light@2.0-service.lge -# LiveDisplay +# Live Display PRODUCT_PACKAGES += \ - vendor.lineage.livedisplay@2.1-service.lge_sdm845 + vendor.lineage.livedisplay@2.0-service.lge + +# Lineage Health +PRODUCT_PACKAGES += \ + vendor.lineage.health-service.default # Touch PRODUCT_PACKAGES += \ vendor.lineage.touch@1.0-service.lge_sdm845 +# Trust HAL +PRODUCT_PACKAGES += \ + vendor.lineage.trust@1.0-service + # USB PRODUCT_PACKAGES += \ android.hardware.usb@1.0-service \ @@ -564,7 +571,7 @@ PRODUCT_PACKAGES += \ # Vibrator PRODUCT_PACKAGES += \ - android.hardware.vibrator@1.3-service.lge + android.hardware.vibrator-service.lge # WiFi PRODUCT_PACKAGES += \ diff --git a/sepolicy/private/file_contexts b/sepolicy/private/file_contexts deleted file mode 100644 index 19bbf33a..00000000 --- a/sepolicy/private/file_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# Executables -/system/bin/chargeonlymode u:object_r:charger_exec:s0 diff --git a/sepolicy/private/property_contexts b/sepolicy/private/property_contexts deleted file mode 100644 index c23a3d20..00000000 --- a/sepolicy/private/property_contexts +++ /dev/null @@ -1,2 +0,0 @@ -# SettingsLib -settingsdebug.instant.packages u:object_r:settingslib_prop:s0 diff --git a/sepolicy/private/seapp_contexts b/sepolicy/private/seapp_contexts deleted file mode 100644 index d91b70ea..00000000 --- a/sepolicy/private/seapp_contexts +++ /dev/null @@ -1 +0,0 @@ -user=system seinfo=platform name=org.lineageos.pocketmode domain=pocketmode_app type=system_app_data_file diff --git a/sepolicy/private/temp.te b/sepolicy/private/temp.te deleted file mode 100644 index a2a6bf1d..00000000 --- a/sepolicy/private/temp.te +++ /dev/null @@ -1,7 +0,0 @@ -get_prop(vendor_init, init_service_status_private_prop) -#============= linkerconfig ============== -allow linkerconfig self:capability kill; - -#============= odrefresh ============== -allow odrefresh self:capability kill; -allow kernel self:capability kill; diff --git a/sepolicy/public/property.te b/sepolicy/public/property.te deleted file mode 100644 index 27d0385a..00000000 --- a/sepolicy/public/property.te +++ /dev/null @@ -1,2 +0,0 @@ -# SettingsLib -system_public_prop(settingslib_prop) diff --git a/sepolicy/public/temp.te b/sepolicy/public/temp.te deleted file mode 100644 index e69de29b..00000000 diff --git a/sepolicy/vendor/attributes b/sepolicy/vendor/attributes new file mode 100644 index 00000000..1265c564 --- /dev/null +++ b/sepolicy/vendor/attributes @@ -0,0 +1,5 @@ +attribute hal_lgdata; +attribute hal_lgdata_server; + +attribute hal_vssims; +attribute hal_vssims_server; diff --git a/sepolicy/vendor/device.te b/sepolicy/vendor/device.te index 843d61af..ab98b426 100644 --- a/sepolicy/vendor/device.te +++ b/sepolicy/vendor/device.te @@ -1,3 +1,7 @@ +type mpt_block_device, dev_type; +type drm_block_device, dev_type; +type sns_block_device, dev_type; + type fingerprint_device, dev_type; type gps_device, dev_type; diff --git a/sepolicy/vendor/file.te b/sepolicy/vendor/file.te index ca1791c4..d9f8def7 100644 --- a/sepolicy/vendor/file.te +++ b/sepolicy/vendor/file.te @@ -10,6 +10,7 @@ type proc_sysctl_schedboost, proc_type, fs_type; type proc_tp, proc_type, fs_type; type sysfs_fingerprint, sysfs_type, fs_type; +type sysfs_lge_power, sysfs_type, fs_type; type sysfs_gps, sysfs_type, fs_type; type sysfs_msm_subsys, sysfs_type, fs_type; type sysfs_rpm, sysfs_type, fs_type; diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 8c3e17d8..c3f72b77 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -1,3 +1,7 @@ +/dev/block/platform/soc/1d84000.ufshc/sda1 u:object_r:mpt_block_device:s0 +/dev/block/platform/soc/1d84000.ufshc/sda2 u:object_r:drm_block_device:s0 +/dev/block/platform/soc/1d84000.ufshc/sda3 u:object_r:sns_block_device:s0 + # Audio devices /dev/elliptic(.*)? u:object_r:sound_device:s0 @@ -18,6 +22,11 @@ /vendor/bin/lhd u:object_r:lhd_exec:s0 /vendor/bin/nv_mac u:object_r:wcnss_service_exec:s0 +/vendor/bin/init.lge.zramswap.sh u:object_r:zramswap_exec:s0 +/vendor/bin/init.lge.usb.sh u:object_r:qti_init_shell_exec:s0 +/vendor/bin/init.lge.usb.lao.sh u:object_r:qti_init_shell_exec:s0 +/vendor/bin/cpfirmware u:object_r:qti_init_shell_exec:s0 + # Fingerprint devices /dev/goodix_fp u:object_r:fingerprint_device:s0 /dev/vfsspi u:object_r:fingerprint_device:s0 @@ -37,21 +46,20 @@ /sys/devices/platform/soc/[a-z0-9]+.qcom,mdss_mdp/drm/card([0-3])+/card([0-3])+-DSI-1/panel_info u:object_r:sysfs_graphics:s0 /sys/devices/platform/soc/soc:qcom,dsi-display-primary/fod_ui u:object_r:sysfs_graphics:s0 -# Leds nodes -/sys/devices/platform/soc/[a-z0-9]+.i2c/i2c-[0-9]/[0-9]-[a-z0-9]+/leds/ir(/.*)? u:object_r:sysfs_leds:s0 - # HALs /vendor/bin/hw/android\.hardware\.biometrics\.fingerprint@2\.1-service\.lge_sdm845 u:object_r:hal_fingerprint_default_exec:s0 -/vendor/bin/hw/android\.hardware\.light@2\.0-service\.lge_sdm845 u:object_r:hal_light_default_exec:s0 /vendor/bin/hw/android\.hardware\.neuralnetworks@1\.3-service-qti u:object_r:hal_neuralnetworks_default_exec:s0 /vendor/bin/hw/android\.hardware\.power-service\.lge-libperfmgr u:object_r:hal_power_default_exec:s0 -/vendor/bin/hw/vendor\.lineage\.livedisplay@2\.1-service\.lge_sdm845 u:object_r:hal_lineage_livedisplay_qti_exec:s0 /vendor/bin/hw/android\.hardware\.atrace@1\.0-service\.pixel u:object_r:hal_atrace_default_exec:s0 /vendor/bin/hw/android\.hardware\.power\.stats@1\.0-service\.lge u:object_r:hal_power_stats_default_exec:s0 /vendor/bin/hw/android\.hardware\.nfc@1\.2-service-pn55x u:object_r:hal_nfc_default_exec:s0 /vendor/bin/hw/android\.hardware\.thermal@2\.0-service.mock u:object_r:hal_thermal_default_exec:s0 /vendor/bin/hw/vendor\.lineage\.touch@1\.0-service\.lge_sdm845 u:object_r:hal_lineage_touch_default_exec:s0 +/vendor/bin/hw/android\.hardware\.contexthub-service\.generic u:object_r:hal_contexthub_default_exec:s0 +/vendor/bin/hw/vendor\.lge\.hardware\.lgdata@1\.1-service u:object_r:hal_lgdata_default_exec:s0 +/vendor/bin/hw/vendor\.lge\.hardware\.vss_ims@1\.0-service u:object_r:hal_vssims_default_exec:s0 + # Persist files /mnt/vendor/persist/audio(/.*)? u:object_r:persist_audio_file:s0 /mnt/vendor/persist/camera(/.*)? u:object_r:persist_camera_file:s0 @@ -63,7 +71,12 @@ /dev/socket/audio_hw_socket u:object_r:audio_socket:s0 /dev/socket/gps u:object_r:gps_socket:s0 - # QtiMapper-Shim blobs /vendor/lib(64)?/vendor\.qti\.hardware\.display\.mappershim\.so u:object_r:same_process_hal_file:s0 /vendor/lib(64)?/android\.hardware\.graphics\.mappershim\.so u:object_r:same_process_hal_file:s0 + +/vendor/lib(64)?/libadreno_app_profiles\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libgpudataproducer\.so u:object_r:same_process_hal_file:s0 + +# NFC +/dev/pn547 u:object_r:nfc_device:s0 diff --git a/sepolicy/vendor/fsck.te b/sepolicy/vendor/fsck.te new file mode 100644 index 00000000..2c255630 --- /dev/null +++ b/sepolicy/vendor/fsck.te @@ -0,0 +1,5 @@ +allow fsck { + mpt_block_device + drm_block_device + sns_block_device +}:blk_file rw_file_perms; diff --git a/sepolicy/vendor/genfs_contexts b/sepolicy/vendor/genfs_contexts index ba992bb0..ab725d11 100644 --- a/sepolicy/vendor/genfs_contexts +++ b/sepolicy/vendor/genfs_contexts @@ -3,6 +3,8 @@ genfscon proc /sys/kernel/sched_boost u:object_r:proc_sysctl_sch genfscon proc /tp_fw_version u:object_r:proc_tp:s0 genfscon proc /tp_lockdown_info u:object_r:proc_tp:s0 +genfscon sysfs /devices/platform/lge-unified-nodes/ u:object_r:sysfs_lge_power:s0 + genfscon sysfs /devices/platform/soc/17300000.qcom,lpass/subsys4/restart_level u:object_r:sysfs_ssr_toggle:s0 genfscon sysfs /devices/platform/soc/188101c.qcom,spss/subsys0/restart_level u:object_r:sysfs_ssr_toggle:s0 genfscon sysfs /devices/platform/soc/4080000.qcom,mss/subsys7/restart_level u:object_r:sysfs_ssr_toggle:s0 @@ -28,3 +30,11 @@ genfscon sysfs /devices/platform/soc/soc:qcom,llccbw u genfscon sysfs /devices/platform/soc/soc:qcom,mincpubw u:object_r:sysfs_msm_subsys:s0 genfscon sysfs /power/rpmh_stats/master_stats u:object_r:sysfs_rpm:s0 genfscon sysfs /power/system_sleep/stats u:object_r:sysfs_system_sleep_stats:s0 + +genfscon sysfs /devices/platform/soc/171c0000.slim/tavil-slim-pgd/tavil_codec/extcon/extcon4/name u:object_r:sysfs_graphics:s0 +genfscon sysfs /devices/platform/soc/171c0000.slim/tavil-slim-pgd/tavil_codec/extcon/extcon4/state u:object_r:sysfs_graphics:s0 +genfscon sysfs /devices/platform/soc/171c0000.slim/tavil-slim-pgd/tavil_codec/extcon/extcon4/cable.0/ u:object_r:sysfs_graphics:s0 + +genfscon sysfs /devices/virtual/lg_rgb_led/use_patterns/ u:object_r:sysfs_graphics:s0 +genfscon sysfs /devices/virtual/panel/img_tune/ u:object_r:sysfs_livedisplay_tuneable:s0 +genfscon sysfs /devices/virtual/panel/brightness/hl_mode u:object_r:sysfs_livedisplay_tuneable:s0 diff --git a/sepolicy/vendor/glgps.te b/sepolicy/vendor/glgps.te index 9cc5983e..df901ea0 100644 --- a/sepolicy/vendor/glgps.te +++ b/sepolicy/vendor/glgps.te @@ -9,7 +9,8 @@ allow glgps fwk_sensor_hwservice:hwservice_manager find; allow glgps gps_data_file:dir create_dir_perms; allow glgps gps_data_file:fifo_file create_file_perms; allow glgps gps_data_file:file create_file_perms; -allow glgps gps_data_file:lnk_file create_file_perms; +# neverallow lnk_file ioctl +allow glgps gps_data_file:lnk_file create; allow glgps gps_data_file:sock_file create_file_perms; allow glgps gps_device:chr_file rw_file_perms; diff --git a/sepolicy/vendor/hal_health_default.te b/sepolicy/vendor/hal_health_default.te index 878b5a56..9b235eff 100644 --- a/sepolicy/vendor/hal_health_default.te +++ b/sepolicy/vendor/hal_health_default.te @@ -1,2 +1,4 @@ allow hal_health_default sysfs_wireless_supply:dir search; allow hal_health_default sysfs_wireless_supply:file r_file_perms; +r_dir_file(hal_health_default, sysfs_lge_power); +allow hal_health_default sysfs_usb_supply:file r_file_perms; diff --git a/sepolicy/vendor/hal_lgdata_default.te b/sepolicy/vendor/hal_lgdata_default.te new file mode 100644 index 00000000..6137dbb4 --- /dev/null +++ b/sepolicy/vendor/hal_lgdata_default.te @@ -0,0 +1,9 @@ +type hal_lgdata_default, domain; +init_daemon_domain(hal_lgdata_default) + +hal_server_domain(hal_lgdata_default, hal_lgdata) + +type hal_lgdata_default_exec, exec_type, vendor_file_type, file_type; + +add_hwservice(hal_lgdata_default, hal_lgdata_hwservice) +allow hal_lgdata_default self:socket create; diff --git a/sepolicy/vendor/hal_lineage_livedisplay_qti.te b/sepolicy/vendor/hal_lineage_livedisplay_qti.te deleted file mode 100644 index c2e74fb4..00000000 --- a/sepolicy/vendor/hal_lineage_livedisplay_qti.te +++ /dev/null @@ -1,2 +0,0 @@ -# Grant LiveDisplay access over the control nodes -allow hal_lineage_livedisplay_qti sysfs_graphics:file rw_file_perms; diff --git a/sepolicy/vendor/hal_lineage_touch_default.te b/sepolicy/vendor/hal_lineage_touch_default.te new file mode 100644 index 00000000..da01fb08 --- /dev/null +++ b/sepolicy/vendor/hal_lineage_touch_default.te @@ -0,0 +1 @@ +allow hal_lineage_touch_default_exec hal_lineage_touch_hwservice:hwservice_manager { add find }; diff --git a/sepolicy/vendor/hal_nfc_default.te b/sepolicy/vendor/hal_nfc_default.te index 8e142fd8..fcda5f6d 100644 --- a/sepolicy/vendor/hal_nfc_default.te +++ b/sepolicy/vendor/hal_nfc_default.te @@ -1,9 +1,7 @@ binder_call(hal_nfc_default, hal_secure_element_default) allow hal_nfc_default hal_nxpese_hwservice:hwservice_manager find; -allow hal_nfc_default hal_nxpnfc_hwservice:hwservice_manager { find add }; +add_hwservice(hal_nfc_default, hal_nxpnfc_hwservice) # Allow hal_nfc_default to create, read and write in nfc_vendor_data_file allow hal_nfc_default nfc_vendor_data_file:dir create_dir_perms; allow hal_nfc_default nfc_vendor_data_file:file create_file_perms; - -add_hwservice(hal_nfc_default, hal_nxpnfc_hwservice) diff --git a/sepolicy/vendor/hal_vssims_default.te b/sepolicy/vendor/hal_vssims_default.te new file mode 100644 index 00000000..466807f2 --- /dev/null +++ b/sepolicy/vendor/hal_vssims_default.te @@ -0,0 +1,9 @@ +type hal_vssims_default, domain; +init_daemon_domain(hal_vssims_default) + +hal_server_domain(hal_vssims_default, hal_vssims) + +type hal_vssims_default_exec, exec_type, vendor_file_type, file_type; + +add_hwservice(hal_vssims_default, hal_vssims_hwservice) +allow hal_vssims_default self:socket create; diff --git a/sepolicy/vendor/hwservice.te b/sepolicy/vendor/hwservice.te index 0ba48d22..adfb58ef 100644 --- a/sepolicy/vendor/hwservice.te +++ b/sepolicy/vendor/hwservice.te @@ -1,2 +1,8 @@ type hal_nxpese_hwservice, hwservice_manager_type; type hal_nxpnfc_hwservice, hwservice_manager_type; + +type hal_lgdata_hwservice, hwservice_manager_type; +type hal_vssims_hwservice, hwservice_manager_type; +type hal_lgradio_hwservice, hwservice_manager_type; + +type hal_mwqemadapter_hwservice, hwservice_manager_type; diff --git a/sepolicy/vendor/hwservice_contexts b/sepolicy/vendor/hwservice_contexts index 562c3a5c..4d2f9772 100644 --- a/sepolicy/vendor/hwservice_contexts +++ b/sepolicy/vendor/hwservice_contexts @@ -13,3 +13,11 @@ vendor.synaptics.fingerprints.interfaces.extensions::IFpCollection u: vendor.nxp.nxpese::INxpEse u:object_r:hal_nxpese_hwservice:s0 vendor.nxp.nxpnfc::INxpNfc u:object_r:hal_nxpnfc_hwservice:s0 + +vendor.lge.hardware.lgdata::ILgData u:object_r:hal_lgdata_hwservice:s0 +vendor.lge.hardware.lgdata::ILgDataVendorRil u:object_r:hal_lgdata_hwservice:s0 +vendor.lge.hardware.vss_ims::IVssIms u:object_r:hal_vssims_hwservice:s0 + +vendor.lge.hardware.radio::ILgeRadio u:object_r:hal_lgradio_hwservice:s0 + +vendor.qti.hardware.mwqemadapter::IMwqemAdapter u:object_r:hal_mwqemadapter_hwservice:s0 diff --git a/sepolicy/vendor/init.te b/sepolicy/vendor/init.te index 9e3ff6d0..4e17dcca 100644 --- a/sepolicy/vendor/init.te +++ b/sepolicy/vendor/init.te @@ -1,3 +1,7 @@ allow init socket_device:sock_file { unlink setattr create }; +allow init vfat:dir search; + dontaudit init { bt_firmware_file firmware_file }:filesystem getattr; + +allow init sysfs_livedisplay_tuneable:file { open write }; diff --git a/sepolicy/vendor/pocketmode_app.te b/sepolicy/vendor/pocketmode_app.te deleted file mode 100644 index b56db7a6..00000000 --- a/sepolicy/vendor/pocketmode_app.te +++ /dev/null @@ -1,13 +0,0 @@ -type pocketmode_app, domain; - -app_domain(pocketmode_app) - -# Allow pocketmode_app to find app_api_service -allow pocketmode_app app_api_service:service_manager find; - -# Allow pocketmode_app read and write /data/data subdirectory -allow pocketmode_app system_app_data_file:dir create_dir_perms; -allow pocketmode_app system_app_data_file:{ file lnk_file } create_file_perms; - -# Allow pocketmode_app to write to sysfs fingerprint nodes -allow pocketmode_app sysfs_fingerprint:file { w_file_perms getattr }; diff --git a/sepolicy/vendor/property.te b/sepolicy/vendor/property.te index e2bb00fb..5e2659a5 100644 --- a/sepolicy/vendor/property.te +++ b/sepolicy/vendor/property.te @@ -8,3 +8,7 @@ vendor_internal_prop(vendor_dpps_prop) vendor_public_prop(vendor_fp_prop) vendor_internal_prop(vendor_power_prop) + +vendor_internal_prop(vendor_camera_prop); + +vendor_internal_prop(rild_prop); diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index 05cc5350..e0fcd4cb 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -1,10 +1,22 @@ +# Audio +vendor.lge.wlan.earpiece u:object_r:vendor_audio_prop:s0 + # Camera camera. u:object_r:camera_prop:s0 +ro.camera. u:object_r:camera_prop:s0 persist.camera. u:object_r:camera_prop:s0 persist.debug.sf.showfps u:object_r:camera_dbg_prop:s0 persist.vendor.camera. u:object_r:camera_prop:s0 vidhance. u:object_r:camera_prop:s0 +persist.camera.arcbeauty. u:object_r:vendor_camera_prop:s0 +persist.vendor.lge.data.front.minfps u:object_r:vendor_camera_prop:s0 +persist.vendor.lge.data.rear.minfps u:object_r:vendor_camera_prop:s0 +persist.vendor.lge.camera. u:object_r:vendor_camera_prop:s0 +sys.camera.pd_test.result u:object_r:vendor_camera_prop:s0 +persist.debug.eis. u:object_r:vendor_camera_prop:s0 +vendor.lge.camera. u:object_r:vendor_camera_prop:s0 + # Display post processing init.svc.ppd u:object_r:vendor_dpps_prop:s0 ro.vendor.display.ad u:object_r:vendor_dpps_prop:s0 @@ -34,3 +46,8 @@ persist.sensor.sardisable u:object_r:sensors_prop:s0 # Thermal persist.sys.thermal. u:object_r:thermal_engine_prop:s0 sys.thermal. u:object_r:thermal_engine_prop:s0 + +# Rild +rild.libpath u:object_r:rild_prop:s0 +ro.ims.networkinfo u:object_r:rild_prop:s0 +vendor.lge.ril. u:object_r:rild_prop:s0 diff --git a/sepolicy/vendor/rild.te b/sepolicy/vendor/rild.te index 37f5ca58..09c5dede 100644 --- a/sepolicy/vendor/rild.te +++ b/sepolicy/vendor/rild.te @@ -1,2 +1,7 @@ dontaudit rild tombstone_data_file:dir search; -dontaudit rild vendor_file:file ioctl; + +allow rild hal_lgradio_hwservice:hwservice_manager { add find }; +allow rild hal_lgdata_hwservice:hwservice_manager find; +get_prop(rild, boot_status_prop) +set_prop(rild, rild_prop); +binder_call(rild, hal_lgdata_default) diff --git a/sepolicy/vendor/system_app.te b/sepolicy/vendor/system_app.te new file mode 100644 index 00000000..a41af316 --- /dev/null +++ b/sepolicy/vendor/system_app.te @@ -0,0 +1,5 @@ +r_dir_file(system_app, { + proc_pagetypeinfo + proc_vmallocinfo + sysfs_zram +}); diff --git a/sepolicy/vendor/temp.te b/sepolicy/vendor/temp.te index 434d1d54..b4883427 100644 --- a/sepolicy/vendor/temp.te +++ b/sepolicy/vendor/temp.te @@ -1,16 +1,10 @@ -#============= fsck ============== -allow fsck self:capability { kill }; - #============= hal_camera_default ============== allow hal_camera_default mnt_vendor_file:dir ra_dir_perms; allow hal_camera_default mnt_vendor_file:file rw_file_perms; allow hal_camera_default mnt_vendor_file:file create; -set_prop(hal_camera_default, vendor_default_prop) -allow hal_camera_default sysfs:file rw_file_perms; -allow hal_camera_default default_prop:file { getattr open read }; -#============= hal_lineage_livedisplay_qti ============== -allow hal_lineage_livedisplay_qti sysfs:file rw_file_perms; +set_prop(hal_camera_default, vendor_camera_prop) +allow hal_camera_default sysfs:file rw_file_perms; #============= hal_graphics_composer_default ============== get_prop(hal_graphics_composer_default, vendor_dpps_prop) @@ -44,19 +38,15 @@ allow qti_init_shell vfat:dir read; allow qti_init_shell vfat:file r_file_perms; allow qti_init_shell proc_sysctl_schedboost:file w_file_perms; allow qti_init_shell sysfs:file write; +allow qti_init_shell configfs:dir { add_name write }; #============= qtidataservices_app ============== -# neverallow -#allow qtidataservices_app self:socket create_socket_perms; allow qtidataservices_app self:socket create_socket_perms_no_ioctl; #============= rfs_access ============== allow rfs_access vfat:dir search; allow rfs_access vfat:file r_file_perms; -#============= thermal-engine ============== -allow thermal-engine sysfs:dir open; - #============= ueventd ============== allow ueventd metadata_file:dir search; allow ueventd vfat:dir search; @@ -65,13 +55,14 @@ allow ueventd vfat:file r_file_perms; #============= vendor_init ============== allow vendor_init device:file create_file_perms; get_prop(vendor_init, persist_debug_prop) -set_prop(vendor_init, bluetooth_prop) set_prop(vendor_init, camera_prop) set_prop(vendor_init, freq_prop) set_prop(vendor_init, vendor_ssr_prop) -set_prop(vendor_init, default_prop) -allow vendor_init block_device:blk_file r_file_perms; -allow vendor_init tombstone_data_file:dir getattr; + +allow vendor_init proc_cmdline:file r_file_perms; +allow vendor_init gsi_metadata_file:dir r_dir_perms; + +allow vendor_init rild_prop:property_service set; #============= vendor_pd_mapper ============== allow vendor_pd_mapper vfat:dir r_dir_perms; @@ -82,75 +73,38 @@ allow wcnss_service vendor_shell_exec:file execute_no_trans; allow wcnss_service kmsg_device:chr_file w_file_perms; allow wcnss_service rootfs:dir r_dir_perms; -#============= zygote ============== -allow zygote self:capability kill; +allow wcnss_service unlabeled:dir r_dir_perms; +allow wcnss_service unlabeled:file r_file_perms; #============= cnd ============== -allow cnd default_android_hwservice:hwservice_manager find; +allow cnd hal_mwqemadapter_hwservice:hwservice_manager find; #============= hal_fingerprint_default ============== allow hal_fingerprint_default vfat:dir search; allow hal_fingerprint_default vfat:file r_file_perms; -#============= hal_light_default ============== -allow hal_light_default sysfs:file rw_file_perms; - #============= init ============== allow init unlabeled:dir mounton; - -add_hwservice(init, default_android_hwservice) -add_hwservice(init, hal_lineage_touch_hwservice) -add_hwservice(init, hal_nfc_hwservice) -add_hwservice(init, hal_nxpnfc_hwservice) -add_hwservice(init, hal_power_stats_hwservice) -add_hwservice(init, hal_thermal_hwservice) -add_hwservice(init, hal_vibrator_hwservice) -add_hwservice(init, hidl_base_hwservice) -add_service(init, hal_contexthub_service) -allow init device:chr_file rw_file_perms; -allow init hal_audio_hwservice:hwservice_manager find; +allow init drm_block_device:lnk_file relabelto; allow init proc:file write; allow init same_process_hal_file:file execute; allow init self:socket create; -allow init sysfs:file { open write }; allow init sysfs_rpm:file open; allow init sysfs_system_sleep_stats:file open; -allow init vendor_file:file execute_no_trans; -allow init vendor_toolbox_exec:file execute_no_trans; allow init vfat:file r_file_perms; -allow init vndbinder_device:chr_file rw_file_perms; -binder_call(init, hwservicemanager) -binder_call(init, nfc) -binder_call(init, sysfs) -binder_call(init, vndservicemanager) -binder_call(init, hal_audio_default) +allow init { hwservicemanager nfc sysfs hal_audio_default }:binder call; +allow init sysfs_power:file w_file_perms; #============= hal_audio_default ============== allow hal_audio_default unlabeled:dir search; -set_prop(hal_audio_default, vendor_default_prop) +set_prop(hal_audio_default, { + vendor_audio_prop + vendor_bluetooth_prop +}) allow hal_audio_default oemfs:dir search; -#============= rild ============== -get_prop(rild, boot_status_prop) -add_hwservice(rild, default_android_hwservice) -binder_call(rild, init) -set_prop(rild, vendor_default_prop) -binder_call(rild, hal_lgdata_default) - -#============= qti_init_shell ============== -allow qti_init_shell vendor_file:file entrypoint; - -#============= network_stack ============== -allow network_stack fs_bpf:file { getattr open read write }; - -#============= nfc ============== -binder_call(nfc, init) - #============= sensors ============== -allow sensors mnt_vendor_file:file { r_file_perms create }; - -#============= system_app ============== -binder_call(system_app, init) +allow sensors mnt_vendor_file:file create_file_perms; #============= tee ============== allow tee mnt_vendor_file:dir { add_name remove_name write }; @@ -158,24 +112,22 @@ allow tee mnt_vendor_file:file create_file_perms; #============= vold ============== allow vold mnt_vendor_file:dir r_dir_perms; - -#============= system_server ============== -binder_call(system_server, init) -allow system_server proc:file r_file_perms; -allow system_server sysfs:file r_file_perms; -allow system_server vendor_file:file r_file_perms; +allow vold mnt_product_file:dir r_dir_perms; #============= hal_power_stats_default ============== +add_service(hal_power_stats_default, hal_power_stats_vendor_service) vndbinder_use(hal_power_stats) +binder_call(hal_power_stats_default, vndservicemanager) allow hal_power_stats_default sysfs_rpm:file r_file_perms; allow hal_power_stats_default sysfs_system_sleep_stats:file r_file_perms; -binder_call(hal_power_stats_default, vndservicemanager) get_prop(hal_power_stats_default, wifi_hal_prop) -add_service(hal_power_stats_default, default_android_vndservice) #============= hal_lineage_touch_default ============== allow hal_lineage_touch_default sysfs:file rw_file_perms; -#============= hal_nfc_default ============== -allow hal_nfc_default device:chr_file rw_file_perms; -allow init sysfs_power:file w_file_perms; +#============= hal_wifi_default ============== +allow hal_wifi_default proc_net:file write; + +#============= location ============== +allow location hal_cacert_hwservice:hwservice_manager find; +allow location sysfs_socinfo_sensitive:file read; diff --git a/sepolicy/vendor/thermal-engine.te b/sepolicy/vendor/thermal-engine.te index 6ef661dd..4be7ea55 100644 --- a/sepolicy/vendor/thermal-engine.te +++ b/sepolicy/vendor/thermal-engine.te @@ -6,5 +6,6 @@ allow thermal-engine sysfs_devfreq:dir r_dir_perms; set_prop(thermal-engine, thermal_engine_prop) -dontaudit thermal-engine sysfs:dir read; -dontaudit thermal-engine self:capability dac_override; +allow thermal-engine sysfs:dir r_dir_perms; + +allow thermal-engine sysfs_lge_power:file rw_file_perms; diff --git a/sepolicy/vendor/vndservice.te b/sepolicy/vendor/vndservice.te index b6d04631..f3a2f62b 100644 --- a/sepolicy/vendor/vndservice.te +++ b/sepolicy/vendor/vndservice.te @@ -1 +1,2 @@ type remosaic_daemon_service, vndservice_manager_type; +type hal_power_stats_vendor_service, vndservice_manager_type; diff --git a/sepolicy/vendor/vndservice_contexts b/sepolicy/vendor/vndservice_contexts index 2110b4cd..40f4cc91 100644 --- a/sepolicy/vendor/vndservice_contexts +++ b/sepolicy/vendor/vndservice_contexts @@ -1 +1,2 @@ android.IRemosaicDaemon u:object_r:remosaic_daemon_service:s0 +power.stats-vendor u:object_r:hal_power_stats_vendor_service:s0 diff --git a/sepolicy/vendor/zramswap.te b/sepolicy/vendor/zramswap.te new file mode 100644 index 00000000..02eed74b --- /dev/null +++ b/sepolicy/vendor/zramswap.te @@ -0,0 +1,25 @@ +type zramswap, domain; +type zramswap_exec, exec_type, vendor_file_type, file_type; + +init_daemon_domain(zramswap) + +# /dev/block/zram0 +allow zramswap block_device:dir r_dir_perms; +allow zramswap vendor_toolbox_exec:file execute_no_trans; +allow zramswap swap_block_device:blk_file rw_file_perms; + +# Allow /sys access to write zram disksize +allow zramswap sysfs_zram:dir r_dir_perms; +allow zramswap sysfs_zram:file rw_file_perms; + +allow zramswap proc:file rw_file_perms; + +# To read /proc/meminfo +allow zramswap proc_meminfo:file r_file_perms; + +# /proc/sys/vm/overcommit_memory +allow zramswap proc_overcommit_memory:file w_file_perms; + +allow zramswap rootfs:dir r_dir_perms; + +allow zramswap self:capability sys_admin; diff --git a/system.prop b/system.prop index b54908e8..f0a875d1 100644 --- a/system.prop +++ b/system.prop @@ -53,9 +53,9 @@ ro.telephony.default_network=9 persist.sys.fflag.override.settings_provider_model=false # Graphics -debug.renderengine.backend=threaded -debug.egl.hw=0 -debug.sf.hw=0 +debug.renderengine.backend=skiaglthreaded +ro.surface_flinger.enable_layer_caching=true +ro.hwui.use_vulkan=true debug.gralloc.gfx_ubwc_disable=0 debug.gralloc.enable_fb_ubwc=1 debug.sf.disable_backpressure=1 @@ -92,7 +92,6 @@ debug.sf.recomputecrop=0 debug.sf.gpu_comp_tiling=1 debug.sf.disable_hwc=0 ro.surface_flinger.use_color_management=true -debug.hwui.renderer=skiagl debug.sf.enable_transaction_tracing=false # Voice assistant @@ -146,6 +145,10 @@ arm64.memtag.process.system_server=off # Disable Skia tracing by default debug.hwui.skia_atrace_enabled=false +debug.hwui.use_hint_manager=true +debug.hwui.target_cpu_time_percent=30 +ro.surface_flinger.primary_display_orientation=ORIENTATION_0 +ro.surface_flinger.uclamp.min=130 # Adaptive Suspend suspend.short_suspend_threshold_millis=2000 diff --git a/touch/vendor.lineage.touch@1.0-service.lge_sdm845.xml b/touch/vendor.lineage.touch@1.0-service.lge_sdm845.xml index ae4d0a0f..fb862bb7 100644 --- a/touch/vendor.lineage.touch@1.0-service.lge_sdm845.xml +++ b/touch/vendor.lineage.touch@1.0-service.lge_sdm845.xml @@ -1,5 +1,5 @@ - + vendor.lineage.touch hwbinder 1.0 diff --git a/vendor.prop b/vendor.prop index 6917d4f1..ae3d9abe 100644 --- a/vendor.prop +++ b/vendor.prop @@ -122,6 +122,8 @@ dev.pm.dyn_samplingrate=1 ro.sf.lcd_density=560 ro.vendor.display.cabl=0 vendor.display.enable_default_color_mode=1 +vendor.display.use_layer_ext=1 +vendor.display.disable_scaler=1 persist.sys.sf.native_mode=0 # DRM