Android 7.1 删除设置里的一级菜单

Android 7.1 删除设置里的一级菜单

收到客户邮件想要去掉设置里的蓝牙及WIFI选项,具体修改参照如下:

/packages/apps/Settings/src/com/android/settings/SettingsActivity.java

private void doUpdateTilesList() {
        PackageManager pm = getPackageManager();
        final UserManager um = UserManager.get(this);
        final boolean isAdmin = um.isAdminUser();

        String packageName = getPackageName();
        setTileEnabled(new ComponentName(packageName, WifiSettingsActivity.class.getName()),
-                pm.hasSystemFeature(PackageManager.FEATURE_WIFI), isAdmin, pm);
+                /*pm.hasSystemFeature(PackageManager.FEATURE_WIFI)*/false, isAdmin, pm);

        setTileEnabled(new ComponentName(packageName,
                Settings.BluetoothSettingsActivity.class.getName()),
-                pm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH), isAdmin, pm);
+                /*pm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)*/false, isAdmin, pm);

重新编译验证,修改生效,设置里的蓝牙及WIF一级菜单已删除

你可能感兴趣的:(Android,android)