Skip to content

Commit

Permalink
Disable broken led:torch_2 trigger on Mi A2 / Mi 6X
Browse files Browse the repository at this point in the history
At the moment, both led:switch_1 and led:torch_2 are both linked to the
front facing camera torch. Xiaomi's stock Pie vendor for devices jasmine
and wayne (Mi A2 and Mi 6X, respectively) mistakingly hooks these nodes
incorrectly, causing the front facing camera torch to default to a
brightness level of 90. However, after a single photo is taken, the
torch turns off temporarily until either A) the camera is closed and
reopened or B) the camera app requests the flash to trigger.

To circumvent the issue with Xiaomi's stock pie vendor blobs, we can
disable the led:torch_2 trigger, and allow led:switch_1 to handle it.

Test: Run the desired command on boot and observe the default front
facing camera torch state.

Test: Ensure Snapchat and Open Camera default to flash being disabled
for the front facing camera torch.

Signed-off-by: Tyler Nijmeh <[email protected]>
  • Loading branch information
tytydraco committed Apr 22, 2019
1 parent 4f40b50 commit c1c1e86
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rw-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ if getprop ro.vendor.build.fingerprint | grep -q -i -e xiaomi/wayne -e xiaomi/ja
setprop persist.imx376_sunny.light.lux 280
setprop persist.imx376_ofilm.low.lux 310
setprop persist.imx376_ofilm.light.lux 280
echo "none" > /sys/class/leds/led:torch_2/trigger
fi

for f in /vendor/lib/mtk-ril.so /vendor/lib64/mtk-ril.so /vendor/lib/libmtk-ril.so /vendor/lib64/libmtk-ril.so; do
Expand Down

0 comments on commit c1c1e86

Please sign in to comment.