g12-common: Run systemcontrol_static in recovery mode
authorBruno Martins <bgcngm@gmail.com>
Tue, 31 Oct 2023 12:53:22 +0000 (12:53 +0000)
committerBruno Martins <bgcngm@gmail.com>
Tue, 31 Oct 2023 14:31:25 +0000 (14:31 +0000)
This is done to ensure that proper display resolution is set while
device is in recovery mode. Meson config file is required, so import
it into the device tree in order to avoid uncommon copy rules.

Change-Id: I3a14e02f8b857a8007a34fbbe902949ead3373a2

configs/mesondisplay.cfg [new file with mode: 0644]
g12.mk
init-files/init.recovery.amlogic.rc
proprietary-files.txt

diff --git a/configs/mesondisplay.cfg b/configs/mesondisplay.cfg
new file mode 100644 (file)
index 0000000..9e5f7d9
--- /dev/null
@@ -0,0 +1,11 @@
+# 1.device type [MID | MBOX | TV]
+# 2.soc type [meson3 | meson6 | meson8 | meson8b | meson8m2]
+#
+# 3.if the device is MID, need set fb0 & fb1 width height fbbits triplebuffer
+# example: MID meson8b 768 1024 32 1 1280 720 32 1
+# busybox fbset -fb /dev/graphics/fb0 -g 768 1024 768 3072 32
+# busybox fbset -fb /dev/graphics/fb1 -g 1280 720 1280 2160 32
+#
+#   if the device is MBOX, need set default ui [720p | 1080p]
+
+MBOX g12a 1080p
diff --git a/g12.mk b/g12.mk
index 0a4c84f6c4b4a2d6d31ed7b16e6a998f56c2b093..a9cd7f324fc15cceea4656fca0da15a97376e47a 100644 (file)
--- a/g12.mk
+++ b/g12.mk
@@ -75,6 +75,10 @@ PRODUCT_COPY_FILES += \
     frameworks/native/data/etc/android.software.opengles.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml \
     frameworks/native/data/etc/android.software.vulkan.deqp.level-2021-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.vulkan.deqp.level.xml
 
+PRODUCT_COPY_FILES += \
+    $(LOCAL_PATH)/configs/mesondisplay.cfg:$(TARGET_COPY_OUT_RECOVERY)/root/system/etc/mesondisplay.cfg \
+    $(LOCAL_PATH)/configs/mesondisplay.cfg:$(TARGET_COPY_OUT_VENDOR)/etc/mesondisplay.cfg
+
 ## Health
 PRODUCT_PACKAGES += \
     android.hardware.health@2.1.vendor
index 951821b206db8598e282cdf40fa4bce8d82d30f8..167abf4da8b5096d8871fd848ffc61d4df81c9cf 100644 (file)
@@ -20,6 +20,10 @@ on boot
     write /config/usb_gadget/g1/strings/0x409/product ${ro.product.board}
     write /config/usb_gadget/g1/configs/b.1/MaxPower 500
 
+service systemcontrol /system/bin/systemcontrol_static /system/etc/mesondisplay.cfg
+    oneshot
+    seclabel u:r:recovery:s0
+
 # USB accessory configuration
 on property:sys.usb.config=accessory && property:sys.usb.configfs=0
     write /sys/class/android_usb/android0/enable 0
index 30c6717dcc401bd13618c8483ffab95003b197db..702bb3311b16b618bc876834f04982ebc213db05 100644 (file)
@@ -83,7 +83,6 @@ vendor/lib/libam_adp.so
 # Graphics
 vendor/bin/hw/android.hardware.graphics.allocator@4.0-service
 vendor/etc/init/android.hardware.graphics.allocator@4.0-service.rc
-vendor/etc/mesondisplay.cfg
 vendor/lib/arm.graphics-V1-ndk_platform.so
 vendor/lib/egl/libGLES_mali.so
 vendor/lib/hw/android.hardware.graphics.allocator@4.0-impl-arm.so
@@ -208,6 +207,7 @@ vendor/lib/libge2d.so
 odm/etc/firmware/firmware.le
 odm/etc/tvconfig/pq/pq.db
 odm/etc/tvconfig/pq/pq_default.ini
+recovery/root/system/bin/systemcontrol_static|f4ad06b9486cbe9d4a67fa3c2b55a1e821183f8e
 vendor/bin/hdcp_tx22
 vendor/bin/systemcontrol
 vendor/etc/init/systemcontrol.rc