Android 8.1 隐藏设置中定位功能
最近接到客户反馈,需要隐藏设备设置中的定位功能,具体修改参照如下:
/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/SecuritySettings.java
mLocationcontroller.displayPreference(root);
mManageDeviceAdminPreferenceController.updateState(
root.findPreference(KEY_MANAGE_DEVICE_ADMIN));
mEnterprisePrivacyPreferenceController.displayPreference(root);
mEnterprisePrivacyPreferenceController.onResume();
/// M: Add plugin items
PreferenceGroup deviceAdminCategory = (PreferenceGroup) root
.findPreference(KEY_DEVICE_ADMIN_CATEGORY);
addPluginEntrance(deviceAdminCategory);
+ root.findPreference(KEY_LOCATION).setVisible(false);
return root;
到这里,在设置的搜索框中输入定位关键字仍能搜索到相关功能选项,想要屏蔽掉的话具体修改参照如下:
/vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/search/SearchIndexableResources.java文章来源:https://www.toymoban.com/news/detail-816234.html
addIndex(LanguageAndInputSettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_language);
- addIndex(LocationSettings.class, R.xml.location_settings, R.drawable.ic_settings_location);
- addIndex(ScanningSettings.class, R.xml.location_scanning, R.drawable.ic_settings_location);
addIndex(SecuritySettings.class, NO_DATA_RES_ID, R.drawable.ic_settings_security);
addIndex(EncryptionAndCredential.class, NO_DATA_RES_ID, R.drawable.ic_settings_security);
重新编译验证,修改生效,设置中的定位功能已屏蔽文章来源地址https://www.toymoban.com/news/detail-816234.html
到了这里,关于Android 8.1 隐藏设置中定位功能的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!