背景

  • Platform: RK3399
  • OS: Android7.1.2
  • Kernel: v4.4.103

某些特殊需求,需要去掉设置里面关于WIFI、BT等无线的设置

系统设置

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

setTileEnabled(new ComponentName(packageName, 					WifiSettingsActivity.class.getName()),
                pm.hasSystemFeature(PackageManager.FEATURE_WIFI) &&false, isAdmin, pm);

setTileEnabled(new ComponentName(packageName,
		Settings.BluetoothSettingsActivity.class.getName()),
		pm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH) &&false, isAdmin, pm);
				
setTileEnabled(new ComponentName(packageName,
	Settings.WirelessSettingsActivity.class.getName()),
	!UserManager.isDeviceInDemoMode(this) &&false, isAdmin, pm);		

在需要去掉的选项代码中添加 &&false
同理可以去掉其他选项

状态栏下拉快捷设置

rameworks/base/packages/SystemUI/res/values/config.xml

<!-- The default tiles to display in QuickSettings zdd-->
    <string name="quick_settings_tiles_default" translatable="false">
        <!-- wifi, -->cell,battery,dnd,flashlight,rotation<!-- ,bt-->,airplane
    </string>

    <!-- Tiles native to System UI. Order should match "quick_settings_tiles_default" zdd-->
    <string name="quick_settings_tiles_stock" translatable="false">
        <!-- wifi, -->cell,battery,dnd,flashlight,rotation,<!-- bt, -->airplane,location,hotspot,inversion,saver,work,cast,night
    </string>

屏蔽掉其中需要去掉的选项

隐藏状态栏

修改资源文件:
frameworks/base/core/res/res/values/dimens.xml

<!-- Height of the status bar 24dp-->
<dimen name="status_bar_height">24dp</dimen>

24dp改为->0dp