diff --git a/AndroidProducts.mk b/AndroidProducts.mk index efd88c912b67..df08817d109c 100644 --- a/AndroidProducts.mk +++ b/AndroidProducts.mk @@ -15,7 +15,9 @@ # PRODUCT_MAKEFILES := \ - $(LOCAL_DIR)/superior_sunfish.mk + $(LOCAL_DIR)/descendant_sunfish.mk #COMMON_LUNCH_CHOICES := \ - superior_sunfish-userdebug + descendant_sunfish-userdebug \ + descendant_sunfish-user + diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk index c2b1fc2ef865..2c7750a40a85 100644 --- a/BoardConfig-common.mk +++ b/BoardConfig-common.mk @@ -58,13 +58,11 @@ BOARD_KERNEL_PAGESIZE := 4096 BOARD_KERNEL_TAGS_OFFSET := 0x01E00000 BOARD_RAMDISK_OFFSET := 0x02000000 +TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-android- TARGET_KERNEL_CLANG_COMPILE := true TARGET_KERNEL_SOURCE := kernel/google/sunfish TARGET_KERNEL_CONFIG := sunfish_defconfig BOARD_KERNEL_IMAGE_NAME := Image.lz4 -TARGET_KERNEL_CROSS_COMPILE_PREFIX := aarch64-linux-gnu- -TARGET_KERNEL_CLANG_VERSION := proton -KERNEL_TOOLCHAIN := $(shell pwd)/prebuilts/clang/host/linux-x86/clang-proton/bin BOARD_INCLUDE_DTB_IN_BOOTIMG := true BOARD_BOOT_HEADER_VERSION := 2 @@ -216,6 +214,10 @@ TARGET_USES_DISPLAY_RENDER_INTENTS := true TARGET_USES_COLOR_METADATA := true TARGET_USES_DRM_PP := true +# SELinux +BOARD_SEPOLICY_DIRS += device/google/sunfish/sepolicy-descendant/dynamic +BOARD_SEPOLICY_DIRS += device/google/sunfish/sepolicy-descendant/vendor + # Vendor Interface Manifest DEVICE_MANIFEST_FILE := device/google/sunfish/manifest.xml DEVICE_MATRIX_FILE := device/google/sunfish/compatibility_matrix.xml diff --git a/component-overrides.xml b/component-overrides.xml index bb3419d8b395..c682a7b9d325 100644 --- a/component-overrides.xml +++ b/component-overrides.xml @@ -17,4 +17,7 @@ - \ No newline at end of file + + + + diff --git a/default-permissions.xml b/default-permissions.xml index e45d87ad3a10..cb6d360ed51f 100644 --- a/default-permissions.xml +++ b/default-permissions.xml @@ -103,9 +103,6 @@ - - - diff --git a/descendant.dependencies b/descendant.dependencies new file mode 100644 index 000000000000..5c9beb279fa0 --- /dev/null +++ b/descendant.dependencies @@ -0,0 +1,32 @@ +[ + { + "remote": "github", + "repository": "Descendant-Devices/android_device_google_sunfish", + "target_path": "device/google/sunfish", + "branch": "eleven" + }, + { + "remote": "github", + "repository": "DirtyUnicorns/android_vendor_google", + "target_path": "vendor/google", + "branch": "r11x" + }, + { + "remote": "github", + "repository": "DirtyUnicorns/android_device_google_sunfish-sepolicy", + "target_path": "device/google/sunfish-sepolicy", + "branch": "r11x" + } + { + "remote": "github", + "repository": "DirtyUnicorns/android_kernel_google_sunfish", + "target_path": "kernel/google/sunfish", + "branch": "r11x" + } + { + "remote": "github", + "repository": "koen01/android_bootable_recovery", + "target_path": "bootable/recovery", + "branch": "eleven" + } +] diff --git a/superior_sunfish.mk b/descendant_sunfish.mk similarity index 72% rename from superior_sunfish.mk rename to descendant_sunfish.mk index 6916bb981ef7..aa90e1698cca 100644 --- a/superior_sunfish.mk +++ b/descendant_sunfish.mk @@ -22,7 +22,7 @@ # # Include Superior common configuration -include vendor/superior/config/common.mk +$(call inherit-product, vendor/descendant/config/common_full_phone.mk) # Inherit from those products. Most specific first. $(call inherit-product, device/google/sunfish/aosp_sunfish.mk) @@ -30,23 +30,31 @@ $(call inherit-product, device/google/sunfish/aosp_sunfish.mk) # Boot amimation TARGET_BOOT_ANIMATION_RES := 1080 +# Descendant +TARGET_SUPPORTS_BLUR := true +TARGET_FACE_UNLOCK_SUPPORTED := true + # Inherit from the common Open Source product configuration $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) -PRODUCT_NAME := superior_sunfish +PRODUCT_NAME := descendant_sunfish PRODUCT_DEVICE := sunfish PRODUCT_BRAND := google PRODUCT_MODEL := Pixel 4a PRODUCT_BUILD_PROP_OVERRIDES += \ PRODUCT_NAME="sunfish" \ - PRIVATE_BUILD_DESC="sunfish-user 11 RQ1A.210105.002 6985033 release-keys" + PRIVATE_BUILD_DESC="sunfish-user 11 RQ2A.210505.002 7246365 release-keys" -BUILD_FINGERPRINT := "google/sunfish/sunfish:11/RQ1A.210105.002/6985033:user/release-keys" +BUILD_FINGERPRINT := "google/sunfish/sunfish:11/RQ2A.210505.002/7246365:user/release-keys" PRODUCT_PROPERTY_OVERRIDES += \ - ro.build.fingerprint=google/sunfish/sunfish:11/RQ1A.210105.002/6985033:user/release-keys + ro.build.fingerprint=google/sunfish/sunfish:11/RQ2A.210505.002/7246365:user/release-keys $(call inherit-product-if-exists, vendor/google/sunfish/sunfish-vendor.mk) -$(call inherit-product-if-exists, vendor/pixelgapps/pixel-gapps.mk) +#$(call inherit-product-if-exists, vendor/gapps/pixel-gapps.mk) + +# Clearwater vendor for my own extras +#$(call inherit-product-if-exists, vendor/clearwater/clearwater.mk) + diff --git a/device.mk b/device.mk index f336ce399939..7b49ef121c24 100644 --- a/device.mk +++ b/device.mk @@ -151,6 +151,12 @@ else $(LOCAL_PATH)/init.hardware.mpssrfs.rc.user:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.$(PRODUCT_PLATFORM).mpssrfs.rc endif +# Enable DIAG issue debug +ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT))) + PRODUCT_COPY_FILES += \ + $(LOCAL_PATH)/init.diagdebug.rc.userdebug:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.diagdebug.rc +endif + # A/B support PRODUCT_PACKAGES += \ otapreopt_script \ @@ -875,13 +881,7 @@ PRODUCT_PACKAGES += $(HIDL_WRAPPER) # Increment the SVN for any official public releases PRODUCT_PROPERTY_OVERRIDES += \ - ro.vendor.build.svn=17 - -# ZRAM writeback -PRODUCT_PROPERTY_OVERRIDES += \ - ro.zram.mark_idle_delay_mins=60 \ - ro.zram.first_wb_delay_mins=180 \ - ro.zram.periodic_wb_delay_hours=24 + ro.vendor.build.svn=22 PRODUCT_COPY_FILES += \ $(LOCAL_PATH)/powerhint.json:$(TARGET_COPY_OUT_VENDOR)/etc/powerhint.json diff --git a/device_framework_matrix.xml b/device_framework_matrix.xml index 0a7c32c6caac..bf1ae8014ee8 100644 --- a/device_framework_matrix.xml +++ b/device_framework_matrix.xml @@ -15,6 +15,19 @@ com.qualcomm.qti.uceservice + + vendor.lineage.livedisplay + hwbinder + 2.0 + + IPictureAdjustment + default + + + IAdaptiveBacklight + default + + vendor.qti.data.factory hwbinder @@ -65,7 +78,7 @@ vendor.google.google_battery - 1.0 + 1.1 IGoogleBattery default diff --git a/dumpstate/DumpstateDevice.cpp b/dumpstate/DumpstateDevice.cpp index 86ea922656df..93154a034ba6 100755 --- a/dumpstate/DumpstateDevice.cpp +++ b/dumpstate/DumpstateDevice.cpp @@ -573,6 +573,9 @@ Return DumpstateDevice::dumpstateBoard_1_1(const hidl_handle& h DumpFileToFd(fd, "TCPM logs", "/d/tcpm/usbpd0"); DumpFileToFd(fd, "PD Engine", "/d/logbuffer/usbpd"); DumpFileToFd(fd, "ipc-local-ports", "/d/msm_ipc_router/dump_local_ports"); + RunCommandToFd(fd, "TRICKLE-DEFEND Config", {"/vendor/bin/sh", "-c", " cd /sys/devices/platform/soc/soc:google,battery/power_supply/battery/; echo \"bd_trickle_enable: `cat bd_trickle_enable`\"; echo \"bd_trickle_cnt: `cat bd_trickle_cnt`\"; echo \"bd_trickle_recharge_soc: `cat bd_trickle_recharge_soc`\"; echo \"bd_trickle_dry_run: `cat bd_trickle_dry_run`\"; echo \"bd_trickle_reset_sec: `cat bd_trickle_reset_sec`\""}); + RunCommandToFd(fd, "DWELL-DEFEND Config", {"/vendor/bin/sh", "-c", " cd /sys/devices/platform/soc/soc:google,charger/; for f in `ls charge_s*` ; do echo \"$f: `cat $f`\" ; done"}); + RunCommandToFd(fd, "TEMP-DEFEND Config", {"/vendor/bin/sh", "-c", " cd /sys/devices/platform/soc/soc:google,charger/; for f in `ls bd_*` ; do echo \"$f: `cat $f`\" ; done"}); RunCommandToFd(fd, "USB Device Descriptors", {"/vendor/bin/sh", "-c", "cd /sys/bus/usb/devices/1-1 && cat product && cat bcdDevice; cat descriptors | od -t x1 -w16 -N96"}); RunCommandToFd(fd, "Power supply properties", {"/vendor/bin/sh", "-c", "for f in `ls /sys/class/power_supply/*/uevent` ; do echo \"------ $f\\n`cat $f`\\n\" ; done"}); RunCommandToFd(fd, "PMIC Votables", {"/vendor/bin/sh", "-c", "cat /sys/kernel/debug/pmic-votable/*/status"}); diff --git a/gpt-utils/gpt-utils.cpp b/gpt-utils/gpt-utils.cpp index 3b18cd5305a4..21c105513ce9 100644 --- a/gpt-utils/gpt-utils.cpp +++ b/gpt-utils/gpt-utils.cpp @@ -156,11 +156,18 @@ static int blk_rw(int fd, int rw, int64_t offset, uint8_t *buf, unsigned len) else r = read(fd, buf, len); - if (r < 0) + if (r < 0) { fprintf(stderr, "block dev %s failed: %s\n", rw ? "write" : "read", strerror(errno)); - else - r = 0; + } else { + if (rw) { + r = fsync(fd); + if (r < 0) + fprintf(stderr, "fsync failed: %s\n", strerror(errno)); + } else { + r = 0; + } + } return r; } diff --git a/health/Health.cpp b/health/Health.cpp index 7c5a135f1168..cc332a57a442 100644 --- a/health/Health.cpp +++ b/health/Health.cpp @@ -103,14 +103,13 @@ void fill_ufs_storage_attribute(StorageAttribute *attr) { void private_healthd_board_init(struct healthd_config *hc) { hc->ignorePowerSupplyNames.push_back(android::String8(kTCPMPSYName)); - battDefender.update(); } int private_healthd_board_battery_update(struct android::BatteryProperties *props) { deviceHealth.update(props); battMetricsLogger.logBatteryProperties(props); shutdownMetrics.logShutdownVoltage(props); - battDefender.update(); + battDefender.update(props); return 0; } diff --git a/init.diagdebug.rc.userdebug b/init.diagdebug.rc.userdebug new file mode 100644 index 000000000000..29d7ec9bd415 --- /dev/null +++ b/init.diagdebug.rc.userdebug @@ -0,0 +1,20 @@ +# +# Copyright (C) 2020 The Android Open-Source 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. +# + +# Trigger ramdump when property on +on property:vendor.radio.diag_debug=true + write /dev/kmsg "RIL Diag Issue Detected!" + write /proc/sysrq-trigger "c" diff --git a/init.hardware.rc b/init.hardware.rc index 6f471ab8e044..20885c5fe29d 100644 --- a/init.hardware.rc +++ b/init.hardware.rc @@ -121,6 +121,23 @@ on init && property:vendor.skip.init=0 # Battery Defender chown system system /sys/devices/platform/soc/soc:google,charger/charge_stop_level chown system system /sys/devices/platform/soc/soc:google,charger/charge_start_level + chown system system /sys/devices/platform/soc/soc:google,charger/bd_drainto_soc + chown system system /sys/devices/platform/soc/soc:google,charger/bd_recharge_soc + chown system system /sys/devices/platform/soc/soc:google,charger/bd_recharge_voltage + chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_abs_temp + chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_soc + chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_temp + chown system system /sys/devices/platform/soc/soc:google,charger/bd_resume_time + chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_temp + chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_time + chown system system /sys/devices/platform/soc/soc:google,charger/bd_trigger_voltage + chown system system /sys/devices/platform/soc/soc:google,charger/bd_temp_enable + chown system system /sys/devices/platform/soc/soc:google,charger/bd_temp_dry_run + chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_enable + chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_recharge_soc + chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_cnt + chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_dry_run + chown system system /sys/devices/platform/soc/soc:google,battery/power_supply/battery/bd_trickle_reset_sec # Charge stats (write 0) chown system system /sys/class/power_supply/battery/charge_stats @@ -129,6 +146,9 @@ on init && property:vendor.skip.init=0 write /proc/sys/kernel/sched_lib_name "UnityMain,libunity.so" write /proc/sys/kernel/sched_lib_mask_force 255 + # Nfc streset tool name + setprop persist.vendor.nfc.streset libstreset + on late-init chown system system /sys/devices/virtual/thermal/tz-by-name/skin-therm-monitor/trip_point_0_temp chown system system /sys/devices/virtual/thermal/tz-by-name/skin-therm-monitor/trip_point_0_hyst @@ -387,6 +407,8 @@ on early-boot # Permission for battery eeprom chown system system /sys/devices/platform/soc/a8c000.i2c/i2c-2/2-0050/2-00500/nvmem chmod 0640 /sys/devices/platform/soc/a8c000.i2c/i2c-2/2-0050/2-00500/nvmem + chown system system /dev/battery_history + chmod 0644 /dev/battery_history # Permission for Pixelstats chown system system /sys/class/misc/msm_cirrus_playback/resistance_left_right diff --git a/manifest.xml b/manifest.xml index 0875fff3da4b..425e8857f7b9 100644 --- a/manifest.xml +++ b/manifest.xml @@ -219,7 +219,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. vendor.google.google_battery hwbinder - 1.0 + 1.1 IGoogleBattery default @@ -281,6 +281,16 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @1.1::IGnss/default @2.0::IGnss/default + + + vendor.lineage.livedisplay + hwbinder + 2.0 + + IPictureAdjustment + default + + vendor.qti.hardware.radio.qcrilhook diff --git a/pixelstats/service.cpp b/pixelstats/service.cpp index befe89122fa5..de375fa21f85 100644 --- a/pixelstats/service.cpp +++ b/pixelstats/service.cpp @@ -43,6 +43,7 @@ const struct SysfsCollector::SysfsPaths sysfs_paths = { .UFSLifetimeB = UFSHC_PATH(health/lifetimeB), .UFSLifetimeC = UFSHC_PATH(health/lifetimeC), .F2fsStatsPath = "/sys/fs/f2fs/", + .EEPROMPath = "/dev/battery_history", }; const char *const kAudioUevent = "/kernel/q6audio/q6voice_uevent"; diff --git a/product.prop b/product.prop index 21196e7490a5..fc41a4799429 100644 --- a/product.prop +++ b/product.prop @@ -42,7 +42,6 @@ persist.timed.enable=true # system props for perfetto persist.traced.enable=1 -persist.heapprofd.enable=1 # System prop to turn on CdmaLTEPhone always telephony.lteOnCdmaDevice=1 diff --git a/sepolicy-descendant/dynamic/hal_lineage_livedisplay_qti.te b/sepolicy-descendant/dynamic/hal_lineage_livedisplay_qti.te new file mode 100644 index 000000000000..92b2a93a6713 --- /dev/null +++ b/sepolicy-descendant/dynamic/hal_lineage_livedisplay_qti.te @@ -0,0 +1,10 @@ +# Do not use add_service() as hal_graphics_composer_default may be the provider as well +allow hal_lineage_livedisplay_qti qdisplay_service:service_manager find; + +binder_call(hal_lineage_livedisplay_qti, hal_graphics_composer_default) + +# Allow LiveDisplay to access vendor display property +get_prop(hal_lineage_livedisplay_qti, vendor_display_prop) + +allow hal_lineage_livedisplay_qti pps_socket:sock_file rw_file_perms; +allow hal_lineage_livedisplay_qti hal_graphics_composer_default:unix_stream_socket { connectto }; diff --git a/sepolicy-descendant/vendor/file_contexts b/sepolicy-descendant/vendor/file_contexts new file mode 100644 index 000000000000..88151924c494 --- /dev/null +++ b/sepolicy-descendant/vendor/file_contexts @@ -0,0 +1,2 @@ +# LiveDisplay HAL +/(vendor|system/vendor)/bin/hw/vendor\.lineage\.livedisplay@2\.0-service-sdm u:object_r:hal_lineage_livedisplay_qti_exec:s0 diff --git a/sepolicy-descendant/vendor/hal_lineage_livedisplay.te b/sepolicy-descendant/vendor/hal_lineage_livedisplay.te new file mode 100644 index 000000000000..83cfd26344ed --- /dev/null +++ b/sepolicy-descendant/vendor/hal_lineage_livedisplay.te @@ -0,0 +1,12 @@ +type hal_lineage_livedisplay_qti, domain; +hal_server_domain(hal_lineage_livedisplay_qti, hal_lineage_livedisplay) + +type hal_lineage_livedisplay_qti_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(hal_lineage_livedisplay_qti) + +# Allow LiveDisplay HAL's default implementation to use vendor-binder service +vndbinder_use(hal_lineage_livedisplay_qti) + +# Allow LiveDisplay to store files under /data/vendor/display and access them +allow hal_lineage_livedisplay_qti display_vendor_data_file:dir rw_dir_perms; +allow hal_lineage_livedisplay_qti display_vendor_data_file:file create_file_perms; diff --git a/sunfish/overlay/frameworks/base/core/res/res/values-land/config.xml b/sunfish/overlay/frameworks/base/core/res/res/values-land/config.xml index 0c268221c3b0..8fe053b31205 100755 --- a/sunfish/overlay/frameworks/base/core/res/res/values-land/config.xml +++ b/sunfish/overlay/frameworks/base/core/res/res/values-land/config.xml @@ -19,9 +19,4 @@ - - 28dp - - 156dp - diff --git a/sunfish/overlay/frameworks/base/core/res/res/values/config.xml b/sunfish/overlay/frameworks/base/core/res/res/values/config.xml index 658c925c6c69..0845db2d3771 100755 --- a/sunfish/overlay/frameworks/base/core/res/res/values/config.xml +++ b/sunfish/overlay/frameworks/base/core/res/res/values/config.xml @@ -196,11 +196,7 @@ - 136px + 141px 28dp - - 136px - - 488px diff --git a/sunfish/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/sunfish/overlay/frameworks/base/packages/SystemUI/res/values/config.xml index 56dbb18fb1dc..86d64527b32c 100644 --- a/sunfish/overlay/frameworks/base/packages/SystemUI/res/values/config.xml +++ b/sunfish/overlay/frameworks/base/packages/SystemUI/res/values/config.xml @@ -20,6 +20,8 @@ + true + true @@ -31,6 +33,13 @@ always-on display) --> com.google.sensor.binned_brightness + + com.google.sensor.binned_brightness + + + 1 + true @@ -66,7 +75,7 @@ @*android:dimen/status_bar_height_portrait - 11dp + 6dp + true + diff --git a/sunfish/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml b/sunfish/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml index 83a65bc3f635..e866dd98ee2b 100644 --- a/sunfish/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml +++ b/sunfish/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml @@ -21,4 +21,6 @@ 146px 146px + + 34dp diff --git a/superior.dependencies b/superior.dependencies deleted file mode 100644 index 27224c307eaa..000000000000 --- a/superior.dependencies +++ /dev/null @@ -1,20 +0,0 @@ -[ - { - "repository": "device_google_sunfish-sepolicy", - "target_path": "device/google/sunfish-sepolicy" - }, - { - "repository": "kernel_google_sunfish", - "target_path": "kernel/google/sunfish" - }, - { - "repository": "vendor_google", - "target_path": "vendor/google" - }, - { - "repository": "kdrag0n/proton-clang", - "target_path": "prebuilts/clang/host/linux-x86/clang-proton", - "branch": "master", - "remote": "github" - } -] diff --git a/ueventd.rc b/ueventd.rc index dba58c0b5245..733603ab88b3 100644 --- a/ueventd.rc +++ b/ueventd.rc @@ -43,6 +43,7 @@ firmware_directories /vendor/firmware_mnt/image/ /dev/media* 0660 system camera /dev/v4l-subdev* 0660 system camera +/dev/qce 0660 system drmrpc /dev/qseecom 0660 system drmrpc /dev/qsee_ipc_irq_spss 0660 system drmrpc /dev/seemplog 0660 system system