Skip to content

Commit

Permalink
realme_trinket: init: add permissions for devicesettings nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshit Jain authored and dodyirawan85 committed Nov 9, 2020
1 parent 1b57d7c commit b5220f4
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
3 changes: 2 additions & 1 deletion device.mk
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ PRODUCT_COPY_FILES += \
# Init
PRODUCT_PACKAGES += \
init.oppo.fingerprint.rc \
init.qcom.rc
init.qcom.rc \
init.devicesetting.rc

# Input
PRODUCT_COPY_FILES += \
Expand Down
8 changes: 8 additions & 0 deletions rootdir/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,11 @@ LOCAL_MODULE_CLASS := EXECUTABLES
LOCAL_SRC_FILES := etc/set_zram.sh
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init
include $(BUILD_PREBUILT)

include $(CLEAR_VARS)
LOCAL_MODULE := init.devicesetting.rc
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_SRC_FILES := etc/init.devicesetting.rc
LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/init
include $(BUILD_PREBUILT)
20 changes: 20 additions & 0 deletions rootdir/etc/init.devicesetting.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
on boot
chown system system /sys/kernel/oppo_display/dimlayer_bl_en
chown system system /sys/kernel/oppo_display/hbm
chown system system /sys/kernel/oppo_display/seed
chown system system /sys/class/power_supply/usb/otg_switch
chown system system /proc/touchpanel/game_switch_enable
chown system system /proc/touchpanel/oppo_tp_direction
chown system system /proc/touchpanel/oppo_tp_limit_enable

chmod 0666 /sys/kernel/oppo_display/dimlayer_bl_en
chmod 0666 /sys/kernel/oppo_display/hbm
chmod 0666 /sys/kernel/oppo_display/seed
chmod 0666 /sys/class/power_supply/usb/otg_switch
chmod 0666 /proc/touchpanel/game_switch_enable
chmod 0666 /proc/touchpanel/oppo_tp_direction
chmod 0666 /proc/touchpanel/oppo_tp_limit_enable

#Preset touchpanel tuner nodes
write /proc/touchpanel/oppo_tp_limit_enable 0
write /proc/touchpanel/oppo_tp_direction 1
4 changes: 1 addition & 3 deletions rootdir/etc/init.qcom.rc
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import /system/etc/init/init.oppo.fingerprint.rc
import /system/etc/init/init.devicesetting.rc

on init
chown system system /proc/touchpanel/double_tap_enable
chmod 0666 /proc/touchpanel/double_tap_enable

on boot
# OTG
write /sys/class/power_supply/usb/otg_switch 1

# Add for limit_enable
chown system system /proc/touchpanel/oppo_tp_direction
chown system system /proc/touchpanel/tp_fw_update
Expand Down

0 comments on commit b5220f4

Please sign in to comment.