介绍
客户反馈不需要快速打开相机的功能,之前的文章我们是默认关闭了该功能,但是客户后面觉得不需要该功能的开启,要删除对应的菜单、
效果展示
分析
首先我们在Mtksettings中搜索对应字符串找到UI界面
路径:vendor/mediatek/proprietary/packages/apps/MtkSettings
res/values-zh-rCN/strings.xml:4921: <string name="double_tap_power_for_camera_title" msgid="7982364144330923683">"快速打开相机"</string>
我们通过上面字符串的名字检索 找到了如下两个xml文件,其中res/xml/gestures.xml就是快速打开相机页面的入口项
res/xml/gestures.xml:38: android:title="@string/double_tap_power_for_camera_title"
res/xml/double_tap_power_settings.xml:22: android:title="@string/double_tap_power_for_camera_title">
res/xml/double_tap_power_settings.xml:30: android:title="@string/double_tap_power_for_camera_title"
修改
注释掉下面的Preference
路径:vendor/mediatek/proprietary/packages/apps/MtkSettings/res/xml/gestures.xml
<!--soda water.20240103 Remove the gesture and quickly open the camera
<Preference
android:key="gesture_double_tap_power_input_summary"
android:title="@string/double_tap_power_for_camera_title"
android:fragment="com.android.settings.gestures.DoubleTapPowerSettings"
settings:searchable="false"
settings:controller="com.android.settings.gestures.DoubleTapPowerPreferenceController" />-->
然后我们还要屏蔽通过搜索框搜索进入快速打开相机的UI界面,这里通过检索double_tap_power_settings发现下面的文件加载了该xml,注释掉@SearchIndexable即可
路径:vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/gestures/DoubleTapPowerSettings.java
/*soda water.20240103 Remove the gesture and quickly open the camera
@SearchIndexable
*/