Android 9.0 屏蔽设备的定位功能
最近收到客户需求想要屏蔽设备的定位功能,具体修改参照如下:
/vendor/mediatek/proprietary/packages/apps/MtkSettings/res/xml/security_dashboard_settings.xml
- - <Preference
- + <!--Preference
- android:key="location"
- android:title="@string/location_settings_title"
- android:summary="@string/summary_placeholder"
- - android:fragment="com.android.settings.location.LocationSettings" />
- + android:fragment="com.android.settings.location.LocationSettings" /-->
同时下拉状态栏中对应定位功能的quick setting图标也要屏蔽掉:
/vendor/mediatek/proprietary/packages/apps/SystemUI/res/values/config.xml
- <string name="quick_settings_tiles_default" translatable="false">
- - wifi,bt,dnd,flashlight,rotation,cell,airplane,cast,location,screenrecord
- + wifi,bt,dnd,flashlight,rotation,cell,airplane,cast,screenrecord
- </string>
-
- <string name="quick_settings_tiles_stock" translatable="false">
- - wifi,cell,dnd,flashlight,rotation,bt,airplane,location,screenrecord,hotspot,inversion,saver,work,cast,night
- + wifi,cell,dnd,flashlight,rotation,bt,airplane,screenrecord,hotspot,inversion,saver,work,cast,night
- </string>
重新编译验证,修改生效,设备的定位功能已被屏蔽