Commit 3c8d658e authored by Max Weffers's avatar Max Weffers Committed by prady

jasmine: Treewide: Cleanup and Reorder

* Remove Double Definition
* Reordeder Alphabetic
* Move Audio and Media Files to Configs
* Move sensor files to configs
* Reorder Properties
* Fix whitespaces
* Remove Twrp leftovers
parent aba0961c
......@@ -20,8 +20,6 @@
# included in a build is to use PRODUCT_PACKAGES in a product
# definition file).
#
#TWRP
BUILD_TWRP := true
# Inherit device configuration
$(call inherit-product, device/xiaomi/jasmine_sprout/device.mk)
......@@ -37,7 +35,7 @@ DERP_BUILDTYPE := Official
# Build Fingerprint
PRODUCT_BUILD_PROP_OVERRIDES += \
PRIVATE_BUILD_DESC="jasmine-user 9 PKQ1.180904.001 V10.0.9.0.PDIMIXM release-keys"
PRIVATE_BUILD_DESC="jasmine-user 9 PKQ1.180904.001 V10.0.9.0.PDIMIXM release-keys"
# Device identifier
PRODUCT_BRAND := xiaomi
......
......@@ -39,105 +39,107 @@ GAPPS_FORCE_DIALER_OVERRIDES := true
IS_PHONE := true
TARGET_BOOT_ANIMATION_RES := 1080
# Soong
PRODUCT_SOONG_NAMESPACES += \
$(DEVICE_PATH)
# Overlays
DEVICE_PACKAGE_OVERLAYS += \
$(DEVICE_PATH)/overlay
# A/B
AB_OTA_UPDATER := true
AB_OTA_PARTITIONS += \
boot \
system \
vendor
boot \
system \
vendor
AB_OTA_POSTINSTALL_CONFIG += \
RUN_POSTINSTALL_system=true \
POSTINSTALL_PATH_system=system/bin/otapreopt_script \
FILESYSTEM_TYPE_system=ext4 \
POSTINSTALL_OPTIONAL_system=true
RUN_POSTINSTALL_system=true \
POSTINSTALL_PATH_system=system/bin/otapreopt_script \
FILESYSTEM_TYPE_system=ext4 \
POSTINSTALL_OPTIONAL_system=true
PRODUCT_PACKAGES += \
otapreopt_script
otapreopt_script
# Audio
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/audio/audio_platform_info_intcodec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_intcodec.xml \
$(DEVICE_PATH)/audio/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml
$(DEVICE_PATH)/configs/audio/audio_platform_info_intcodec.xml:$(TARGET_COPY_OUT_VENDOR)/etc/audio_platform_info_intcodec.xml \
$(DEVICE_PATH)/configs/audio/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml
# Boot animation
TARGET_SCREEN_HEIGHT := 2160
TARGET_SCREEN_WIDTH := 1080
PRODUCT_CHARACTERISTICS := nosdcard
# Boot control
PRODUCT_PACKAGES += \
android.hardware.boot@1.0-impl \
android.hardware.boot@1.0-service \
bootctrl.sdm660 \
android.hardware.boot@1.0-impl.recovery \
bootctrl.sdm660.recovery
android.hardware.boot@1.0-impl \
android.hardware.boot@1.0-service \
bootctrl.sdm660 \
android.hardware.boot@1.0-impl.recovery \
bootctrl.sdm660.recovery
# Boot control debug
PRODUCT_PACKAGES_DEBUG += \
bootctl
bootctl
# Consumerir
PRODUCT_PACKAGES += \
android.hardware.ir@1.0-impl \
android.hardware.ir@1.0-service
android.hardware.ir@1.0-impl \
android.hardware.ir@1.0-service
# Device properties
$(call inherit-product, $(DEVICE_PATH)/device_prop.mk)
# Media
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/media/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml
$(DEVICE_PATH)/configs/media/media_profiles_V1_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles_V1_0.xml
# Overlays
DEVICE_PACKAGE_OVERLAYS += \
$(DEVICE_PATH)/overlay
# Permissions
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml
frameworks/native/data/etc/android.hardware.camera.flash-autofocus.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.camera.flash-autofocus.xml \
frameworks/native/data/etc/android.hardware.consumerir.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.consumerir.xml
# Keylayout
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/configs/keylayout/sdm660-snd-card_Button_Jack.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/sdm660-snd-card_Button_Jack.kl
$(DEVICE_PATH)/configs/keylayout/sdm660-snd-card_Button_Jack.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/sdm660-snd-card_Button_Jack.kl
# Ramdisk
PRODUCT_PACKAGES += \
init.device.rc
init.device.rc
# Screen density
PRODUCT_AAPT_CONFIG := normal
PRODUCT_AAPT_PREF_CONFIG := xxhdpi
# SD Card
PRODUCT_CHARACTERISTICS := nosdcard
# Sensors
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/sensors/sensor_def_qcomdev.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/sensor_def_qcomdev.conf
$(DEVICE_PATH)/configs/sensors/sensor_def_qcomdev.conf:$(TARGET_COPY_OUT_VENDOR)/etc/sensors/sensor_def_qcomdev.conf
# Soong
PRODUCT_SOONG_NAMESPACES += \
$(DEVICE_PATH)
# Update engine
PRODUCT_PACKAGES += \
update_engine \
update_engine_sideload \
update_verifier
update_engine \
update_engine_sideload \
update_verifier
PRODUCT_HOST_PACKAGES += \
brillo_update_payload
PRODUCT_PACKAGES_DEBUG += \
update_engine_client
update_engine_client
# Vibrator
PRODUCT_PACKAGES += \
android.hardware.vibrator@1.0-impl \
android.hardware.vibrator@1.0-service
android.hardware.vibrator@1.0-impl \
android.hardware.vibrator@1.0-service
# Watermark
PRODUCT_COPY_FILES += \
$(DEVICE_PATH)/media/MIUI_DualCamera_watermark_A2.png:$(TARGET_COPY_OUT_VENDOR)/etc/MIUI_DualCamera_watermark.png
$(DEVICE_PATH)/configs/media/MIUI_DualCamera_watermark_A2.png:$(TARGET_COPY_OUT_VENDOR)/etc/MIUI_DualCamera_watermark.png
# Verity
PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/platform/soc/c0c4000.sdhci/by-name/system
......
......@@ -23,94 +23,73 @@
# Adaptive Display
PRODUCT_PROPERTY_OVERRIDES += \
ro.qcom.ad=1 \
ro.qcom.ad.calib.data=/system/etc/calib.cfg \
ro.qcom.ad.sensortype=2
# Audio
PRODUCT_PROPERTY_OVERRIDES += \
persist.vendor.audio.fluence.voicecall=true \
persist.vendor.audio.fluence.voicerec=false \
persist.vendor.audio.fluence.speaker=true \
vendor.audio.adm.buffering.ms=6 \
vendor.audio.offload.track.enable=false
ro.qcom.ad=1 \
ro.qcom.ad.sensortype=2
# Camera
PRODUCT_PROPERTY_OVERRIDES += \
persist.bokeh.switch.lux=290 \
persist.camera.auxswitch.threshold=330 \
persist.camera.imglib.usefdlite=1 \
persist.camera.depth.focus.cb=0 \
persist.camera.expose.aux=1 \
persist.camera.isp.clock.optmz=0 \
persist.camera.isp.turbo=1 \
persist.camera.linkpreview=0 \
persist.camera.mainswitch.threshold=419 \
persist.camera.set.afd=4 \
persist.camera.stats.test=0 \
persist.flash.low.lux=390 \
persist.flash.light.lux=340 \
persist.imx376_sunny.low.lux=310 \
persist.imx376_sunny.light.lux=280 \
persist.imx376_ofilm.low.lux=310 \
persist.imx376_ofilm.light.lux=280 \
persist.sys.exif.make=Xiaomi \
persist.radio.VT_CAM_INTERFACE=2 \
ro.eyecare.brightness.threshold=3 \
ro.eyecare.brightness.level=8 \
ro.hist.brightness.threshold=5 \
persist.vendor.camera.multicam.hwsync=TRUE \
persist.vendor.camera.multicam.fpsmatch=TRUE \
persist.vendor.camera.enableAdvanceFeatures=0x347 \
persist.vendor.camera.display.umax=1920x1080 \
persist.vendor.camera.display.lmax=1280x720 \
vidc.enc.dcvs.extra-buff-count=2 \
persist.vendor.camera.eis.enable=0 \
persist.camera.eis.enable=0 \
persist.vendor.camera.expose.aux=1 \
persist.vendor.camera.preview.ubwc=0 \
persist.vendor.camera.stats.test=0 \
persist.vendor.camera.isp.clock.optmz=0 \
persist.vendor.camera.linkpreview=0 \
persist.vendor.camera.isp.turbo=1 \
persist.vendor.camera.awb.sync=2 \
persist.vendor.camera.fdvideo=1 \
persist.vendor.camera.mfnrframenum=8 \
persist.vendor.camera.multicam=TRUE \
persist.vendor.camera.multicam.framesync=1 \
persist.vendor.camera.auxswitch.threshold=330 \
persist.vendor.camera.mainswitch.threshold=419 \
persist.vendor.ov13855_sunny.low.lux=385 \
persist.vendor.ov13855_sunny.light.lux=370 \
persist.vendor.s5k3l8_ofilm.low.lux=379 \
persist.vendor.s5k3l8_ofilm.light.lux=367 \
persist.vendor.camera.stats.test=5 \
persist.vendor.camera.depth.focus.cb=0 \
persist.vendor.camera.imglib.usefdlite=1 \
persist.vendor.imx376_sunny.low.lux=290 \
persist.vendor.imx376_sunny.light.lux=275 \
persist.vendor.imx376_ofilm.low.lux=290 \
persist.vendor.imx376_ofilm.light.lux=275 \
persist.vendor.bokeh.switch.lux=290 \
persist.vendor.camera.exif.make=Xiaomi
persist.bokeh.switch.lux=290 \
persist.camera.auxswitch.threshold=330 \
persist.camera.imglib.usefdlite=1 \
persist.camera.depth.focus.cb=0 \
persist.camera.expose.aux=1 \
persist.camera.isp.clock.optmz=0 \
persist.camera.isp.turbo=1 \
persist.camera.linkpreview=0 \
persist.camera.mainswitch.threshold=419 \
persist.camera.set.afd=4 \
persist.camera.stats.test=0 \
persist.flash.low.lux=390 \
persist.flash.light.lux=340 \
persist.imx376_sunny.low.lux=310 \
persist.imx376_sunny.light.lux=280 \
persist.imx376_ofilm.low.lux=310 \
persist.imx376_ofilm.light.lux=280 \
persist.sys.exif.make=Xiaomi \
persist.vendor.bokeh.switch.lux=290 \
persist.vendor.camera.auxswitch.threshold=330 \
persist.vendor.camera.awb.sync=2 \
persist.vendor.camera.depth.focus.cb=0 \
persist.vendor.camera.display.lmax=1280x720 \
persist.vendor.camera.display.umax=1920x1080 \
persist.vendor.camera.enableAdvanceFeatures=0x347 \
persist.vendor.camera.exif.make=Xiaomi \
persist.vendor.camera.expose.aux=1 \
persist.vendor.camera.fdvideo=1 \
persist.vendor.camera.imglib.usefdlite=1 \
persist.vendor.camera.isp.clock.optmz=0 \
persist.vendor.camera.isp.turbo=1 \
persist.vendor.camera.linkpreview=0 \
persist.vendor.camera.mfnrframenum=8 \
persist.vendor.camera.mainswitch.threshold=419 \
persist.vendor.camera.multicam=TRUE \
persist.vendor.camera.multicam.hwsync=TRUE \
persist.vendor.camera.multicam.fpsmatch=TRUE \
persist.vendor.camera.multicam.framesync=1 \
persist.vendor.camera.preview.ubwc=0 \
persist.vendor.camera.stats.test=0 \
persist.vendor.imx376_sunny.low.lux=290 \
persist.vendor.imx376_sunny.light.lux= 275 \
persist.vendor.imx376_ofilm.low.lux=290 \
persist.vendor.imx376_ofilm.light.lux=275 \
persist.vendor.ov13855_sunny.low.lux=385 \
persist.vendor.ov13855_sunny.light.lux=370 \
persist.vendor.s5k3l8_ofilm.low.lux=379 \
persist.vendor.s5k3l8_ofilm.light.lux=367 \
ro.eyecare.brightness.threshold=3 \
ro.eyecare.brightness.level=8 \
ro.hist.brightness.threshold=5 \
vidc.enc.dcvs.extra-buff-count=2 \
# Dual SIM
PRODUCT_PROPERTY_OVERRIDES += \
persist.radio.multisim.config=dsds
persist.radio.multisim.config=dsds
# DPI
PRODUCT_PROPERTY_OVERRIDES += \
vendor.display.lcd_density=480
# Paper mode
PRODUCT_PROPERTY_OVERRIDES += \
sys.jdi_nt36672_offset=9 \
sys.jdi_nt36672_length=45 \
sys.paper_mode_max_level=32 \
sys.tianma_nt36672_offset=12 \
sys.tianma_nt36672_length=46
vendor.display.lcd_density=480
# Radio
PRODUCT_PROPERTY_OVERRIDES += \
persist.vendor.iwlan.enable=true \
persist.vendor.radio.data_con_rprt=1
persist.vendor.iwlan.enable=true \
persist.vendor.radio.data_con_rprt=1
ifeq ($(BUILD_TWRP),true)
# Recovery
BOARD_HAS_LARGE_FILESYSTEM := true
TARGET_RECOVERY_PIXEL_FORMAT := "RGBX_8888"
TARGET_RECOVERY_DEVICE_DIRS += $(DEVICE_PATH)/twrp
# TWRP specific build flags
TW_THEME := portrait_hdpi
BOARD_HAS_NO_REAL_SDCARD := true
TW_MAX_BRIGHTNESS := 100
TW_BRIGHTNESS_PATH := "/sys/class/leds/lcd-backlight/brightness"
TW_EXTRA_LANGUAGES := true
TW_NO_SCREEN_BLANK := true
TW_INPUT_BLACKLIST := "hbtp_vm"
TARGET_RECOVERY_QCOM_RTC_FIX := true
TW_INCLUDE_NTFS_3G := true
RECOVERY_SDCARD_ON_DATA := true
TW_EXCLUDE_DEFAULT_USB_INIT := true
RECOVERY_GRAPHICS_USE_LINELENGTH := true
TARGET_RECOVERY_DEVICE_MODULES += android.hardware.boot@1.0 bootctrl.sdm660 ligptutils
TW_RECOVERY_ADDITIONAL_RELINK_FILES := ${OUT_DIR}/target/product/jasmine_sprout/system/lib64/android.hardware.boot@1.0.so
TW_RECOVERY_ADDITIONAL_RELINK_FILES += ${OUT_DIR}/target/product/jasmine_sprout/vendor/lib64/libgptutils.so
TW_RECOVERY_ADDITIONAL_RELINK_FILES += ${OUT_DIR}/target/product/jasmine_sprout/vendor/lib64/hw/bootctrl.sdm660.so
TW_SCREEN_BLANK_ON_BOOT := true
# Security Patch Hack to prevent Anti Rollback
BOARD_SUPPRESS_SECURE_ERASE := true
ALLOW_MISSING_DEPENDENCIES := true
# exFAT FS Support
TW_INCLUDE_FUSE_EXFAT := true
# NTFS Support
TW_INCLUDE_FUSE_NTFS := true
# Crypto
TW_INCLUDE_CRYPTO := false
# A/B partition device flags
#TARGET_NO_KERNEL := false
#TARGET_NO_RECOVERY := true
#BOARD_USES_RECOVERY_AS_BOOT := true
AB_OTA_UPDATER := true
TW_USE_TOOLBOX := true
TW_INCLUDE_REPACKTOOLS := true
TW_HAS_EDL_MODE := true
endif
# Android fstab file.
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
# mount point fstype device device2 flags
/boot emmc /dev/block/bootdevice/by-name/boot flags=slotselect;backup=1;flashimg=1
/system ext4 /dev/block/bootdevice/by-name/system flags=slotselect;backup=1;flashimg=1
/system_image emmc /dev/block/bootdevice/by-name/system flags=slotselect;backup=1
/splash emmc /dev/block/bootdevice/by-name/splash flags=display="Boot Logo";backup=1;flashimg=1
/vendor ext4 /dev/block/bootdevice/by-name/vendor flags=slotselect;display="Vendor";backup=1;flashimg=1;wipeingui
/vendor_image emmc /dev/block/bootdevice/by-name/vendor flags=slotselect;backup=1
/data f2fs /dev/block/bootdevice/by-name/userdata flags=encryptable=footer;backup=1;
/persist ext4 /dev/block/bootdevice/by-name/persist flags=display="Persist";backup=1;flashimg=1
/bt_firmware vfat /dev/block/bootdevice/by-name/bluetooth flags=display="Bluetooth";backup=1;slotselect;flashimg=1
/misc emmc /dev/block/bootdevice/by-name/misc
/modem emmc /dev/block/bootdevice/by-name/modem flags=slotselect;backup=1;display="Modem";flashimg=1
/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";slotselect;backup=1;mounttodecrypt;fsflags=context=u:object_r:firmware_file:s0
/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=backup=1;display=EFS;flashimg=1
/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=backup=1;subpartitionof=/efs1
/efsc emmc /dev/block/bootdevice/by-name/fsc flags=backup=1;subpartitionof=/efs1
/efsg emmc /dev/block/bootdevice/by-name/fsg flags=backup=1;subpartitionof=/efs1
# Removable storage
/usb-otg auto /dev/block/sda1 /dev/block/sda flags=removable;storage;display="USB OTG"
# Copyright (c) 2009-2012, 2014-2015, 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 fs
wait /dev/block/platform/soc/${ro.boot.bootdevice}
symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice
chmod 0660 /dev/qseecom
chown system drmrpc /dev/qseecom
chmod 0664 /dev/ion
chown system system /dev/ion
install_keyring
# Separate copy needed to use /sbin/linker64 instead of /system/bin/linker64
service sbinqseecomd /sbin/qseecomd
user root
group root
disabled
seclabel u:r:recovery:s0
service prepdecrypt /sbin/prepdecrypt.sh
oneshot
disabled
user root
group root
seclabel u:r:recovery:s0
service hwservicemanager /sbin/hwservicemanager
user root
group root
disabled
onrestart setprop hwservicemanager.ready false
seclabel u:r:recovery:s0
service boot-1-0 /sbin/android.hardware.boot@1.0-service
user root
group root
disabled
seclabel u:r:recovery:s0
service servicemanager /sbin/servicemanager
user root
group root readproc
disabled
seclabel u:r:recovery:s0
service keystore_auth /sbin/keystore_auth
oneshot
user system
group root
disabled
seclabel u:r:recovery:s0
# keystore is started and stopped on demand by TWRP
service keystore /sbin/keystore /tmp/misc/keystore
user root
group root drmrpc readproc
disabled
seclabel u:r:recovery:s0
service gatekeeper-1-0 /sbin/android.hardware.gatekeeper@1.0-service-qti
user root
group root
disabled
seclabel u:r:recovery:s0
service keymaster-3-0 /sbin/android.hardware.keymaster@3.0-service-qti
user root
group root
disabled
seclabel u:r:recovery:s0
service logd /sbin/logd
user root
group root
disabled
seclabel u:r:recovery:s0
service time_daemon /sbin/time_daemon
user root
group root
disabled
seclabel u:r:recovery:s0
on boot
setprop sys.usb.config adb
on boot
export LD_CONFIG_FILE /sbin/ld.config.txt
service recovery /sbin/recovery
seclabel u:r:recovery:s0
service ldconfigtxt /sbin/touch /sbin/ld.config.txt
oneshot
seclabel u:r:recovery:s0
on init
start logd
start hwservicemanager
start boot-1-0
start prepdecrypt
start time_daemon
on property:crypto.ready=0
stop sbinqseecomd
stop keymaster-3-0
stop gatekeeper-1-0
stop servicemanager
on property:crypto.ready=1
start sbinqseecomd
on property:vendor.sys.listeners.registered=true
start keymaster-3-0
start gatekeeper-1-0
start servicemanager
restart time_daemon
on property:sys.usb.config=mtp,adb
restart time_daemon
mkdir /config
mount configfs none /config
mkdir /config/usb_gadget/g1 0770 shell shell
write /config/usb_gadget/g1/bcdUSB 0x0200
write /config/usb_gadget/g1/idVendor 0x18d1
write /config/usb_gadget/g1/idProduct 0xd001
mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
mkdir /config/usb_gadget/g1/functions/ffs.adb
write /config/usb_gadget/g1/os_desc/use 1
write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
setprop sys.usb.configfs 1
on property:ro.boot.usbcontroller=*
setprop sys.usb.controller ${ro.boot.usbcontroller}
on property:sys.usb.ffs.ready=1
mkdir /config/usb_gadget/g1/configs/b.1 0777 shell shell
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
on init
write /sys/class/backlight/panel0-backlight/brightness 200
# Copyright (c) 2011-2016, 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 BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 boot
write /sys/class/android_usb/android0/iSerial ${ro.serialno}
mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount configfs none /config
mkdir /config/usb_gadget/g1 0770 shell shell
mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/bcdUSB 0x0200
write /config/usb_gadget/g1/os_desc/use 1
write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno}
write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
mkdir /config/usb_gadget/g1/functions/mass_storage.0
mkdir /config/usb_gadget/g1/functions/mtp.gs0
mkdir /config/usb_gadget/g1/functions/ptp.gs1
mkdir /config/usb_gadget/g1/functions/accessory.gs2
mkdir /config/usb_gadget/g1/functions/audio_source.gs3
mkdir /config/usb_gadget/g1/functions/midi.gs5
mkdir /config/usb_gadget/g1/functions/ffs.adb
mkdir /config/usb_gadget/g1/functions/diag.diag
mkdir /config/usb_gadget/g1/functions/diag.diag_mdm
mkdir /config/usb_gadget/g1/functions/cser.dun.0
mkdir /config/usb_gadget/g1/functions/cser.nmea.1
mkdir /config/usb_gadget/g1/functions/cser.dun.2
mkdir /config/usb_gadget/g1/functions/gsi.rmnet
mkdir /config/usb_gadget/g1/functions/gsi.rndis
mkdir /config/usb_gadget/g1/functions/gsi.dpl
mkdir /config/usb_gadget/g1/functions/qdss.qdss
mkdir /config/usb_gadget/g1/functions/qdss.qdss_mdm
mkdir /config/usb_gadget/g1/functions/rndis_bam.rndis
mkdir /config/usb_gadget/g1/functions/rmnet_bam.rmnet
mkdir /config/usb_gadget/g1/functions/rmnet_bam.dpl
mkdir /config/usb_gadget/g1/functions/ncm.0
mkdir /config/usb_gadget/g1/functions/ccid.ccid
mkdir /config/usb_gadget/g1/functions/uac2.0
mkdir /config/usb_gadget/g1/functions/uvc.0
mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell
mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell
write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1
write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100"
symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
write /sys/class/android_usb/android0/f_ffs/aliases adb
on property:sys.usb.config=none
write /config/usb_gadget/g1/UDC "none"
stop adbd
setprop sys.usb.ffs.ready 0
setprop sys.usb.ffs.mtp.ready 0
write /config/usb_gadget/g1/bDeviceClass 0
write /config/usb_gadget/g1/bDeviceSubClass 0
write /config/usb_gadget/g1/bDeviceProtocol 0
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
rmdir /config/usb_gadget/g1/functions/rndis.gs4
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=adb
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=adb
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x2A70
write /config/usb_gadget/g1/idProduct 0x4ee7
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x2A70
write /config/usb_gadget/g1/idProduct 0XF003
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:sys.usb.config=mtp,adb
start adbd
on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb
write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_adb"
rm /config/usb_gadget/g1/configs/b.1/f1
rm /config/usb_gadget/g1/configs/b.1/f2
rm /config/usb_gadget/g1/configs/b.1/f3
rm /config/usb_gadget/g1/configs/b.1/f4
rm /config/usb_gadget/g1/configs/b.1/f5
write /config/usb_gadget/g1/idVendor 0x2A70
write /config/usb_gadget/g1/idProduct 0x9011
symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1
symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2
write /config/usb_gadget/g1/UDC ${sys.usb.controller}
setprop sys.usb.state ${sys.usb.config}
on property:ro.boot.usbcontroller=*
setprop sys.usb.controller ${ro.boot.usbcontroller}
This diff is collapsed.
mkdir -p /vendor/lib64/hw
cp -p /sbin/libgptutils.so /vendor/lib64/
cp -p /sbin/bootctrl.sdm660.so /vendor/lib64/hw/
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment