Android 10 Settings应用如何去掉一级菜单应用和通知

代码路径:
packages/apps/Settingssrc/com/android/settings/core/gateway/SettingsGateway.java
packages/apps/Settingsres/xml/top_level_settings.xml
1、在/top_level_settings.xml布局文件中去掉已连接的设备选项

<Preference
     android:key="top_level_apps_and_notifs"
     android:title="@string/app_and_notification_dashboard_title"
     android:summary="@string/app_and_notification_dashboard_summary"
     android:icon="@drawable/ic_homepage_apps"
     android:order="-100"
     android:fragment="com.android.settings.applications.AppAndNotificationDashboardFragment"/>

2、在SettingsGateway.java文件中SETTINGS_FOR_RESTRICTED数组中屏蔽掉AppAndNotificationDashboardActivity

public static final String[] SETTINGS_FOR_RESTRICTED = {
  Settings.AppAndNotificationDashboardActivity.class.getName()
}
上一篇:maven settings配置


下一篇:python应用篇之外星人入侵项目——外星人(完结)