基于RK3568 官方SDK验证
-
移除首页状态栏电池图标
frameworks/base/packages/SystemUI/res/values/config.xml diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 83e09ec2ceec..1d34b8319a84 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -537,6 +537,7 @@ <string-array name="config_statusBarIconBlackList" translatable="false"> <item>@*android:string/status_bar_rotate</item> <item>@*android:string/status_bar_headset</item> + <item>@*android:string/status_bar_battery</item> </string-array> -
移除下拉菜单电池图标(带电量百分比的图标)(无效)
frameworks/base/packages/SystemUI/res/layout/quick_qs_status_icons.xml diff --git a/packages/SystemUI/res/layout/quick_qs_status_icons.xml b/packages/SystemUI/res/layout/quick_qs_status_icons.xml index 44f52efd175e..cb21ad680772 100644 --- a/packages/SystemUI/res/layout/quick_qs_status_icons.xml +++ b/packages/SystemUI/res/layout/quick_qs_status_icons.xml @@ -49,6 +51,7 @@ <com.android.systemui.BatteryMeterView android:id="@+id/batteryRemainingIcon" android:layout_height="match_parent" android:layout_width="wrap_content" systemui:textAppearance="@style/TextAppearance.QS.Status" + android:visibility="gone" android:paddingEnd="2dp" />原因frameworks\base\packages\SystemUI\src\com\android\systemui\battery\BatteryMeterView.java 设置了view的宽高及可见性
public BatteryMeterView(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); setOrientation(LinearLayout.HORIZONTAL); setGravity(Gravity.CENTER_VERTICAL | Gravity.START); TypedArray atts = context.obtainStyledAttributes(attrs, R.styleable.BatteryMeterView, defStyle, 0); final int frameColor = atts.getColor(R.styleable.BatteryMeterView_frameColor, context.getColor(R.color.meter_background_color)); mPercentageStyleId = atts.getResourceId(R.styleable.BatteryMeterView_textAppearance, 0); mDrawable = new AccessorizedBatteryDrawable(context, frameColor); atts.recycle(); mShowPercentAvailable = context.getResources().getBoolean( com.android.internal.R.bool.config_battery_percentage_setting_available); setupLayoutTransition(); mBatteryIconView = new ImageView(context); mBatteryIconView.setImageDrawable(mDrawable); final MarginLayoutParams mlp = new MarginLayoutParams( getResources().getDimensionPixelSize(R.dimen.status_bar_battery_icon_width), getResources().getDimensionPixelSize(R.dimen.status_bar_battery_icon_height)); mlp.setMargins(0, 0, 0, getResources().getDimensionPixelOffset(R.dimen.battery_margin_bottom)); //addView(mBatteryIconView, mlp); updateShowPercent(); mDualToneHandler = new DualToneHandler(context); // Init to not dark at all. onDarkChanged(new ArrayList<Rect>(), 0, DarkIconDispatcher.DEFAULT_ICON_TINT); setClipChildren(false); setClipToPadding(false); }
frameworks\base\packages\SystemUI\res\values\config.xml
```
<!-- Defines system icons to be excluded from the display. That is to say, the icons in the
status bar that are part of this list are never displayed. Each item in the list must be a
string defined in core/res/res/config.xml to properly exclude the icon.
-->
<string-array name="config_statusBarIconsToExclude" translatable="false">
<item>@*android:string/status_bar_rotate</item>
<item>@*android:string/status_bar_battery</item>
</string-array>
```
-
移除快捷菜单省电模式图标
frameworks/base/packages/SystemUI/res/values/config.xml diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml index 83e09ec2ceec..1d34b8319a84 100644 --- a/packages/SystemUI/res/values/config.xml +++ b/packages/SystemUI/res/values/config.xml @@ -106,7 +106,7 @@ <!-- The default tiles to display in QuickSettings --> <string name="quick_settings_tiles_default" translatable="false"> - wifi,bt,dnd,flashlight,rotation,battery,cell,airplane,cast,screenrecord + wifi,bt,dnd,flashlight,rotation,cell,airplane,cast,screenrecord </string> <!-- The minimum number of tiles to display in QuickSettings --> @@ -114,7 +114,7 @@ <!-- Tiles native to System UI. Order should match "quick_settings_tiles_default" --> <string name="quick_settings_tiles_stock" translatable="false"> - wifi,cell,battery,dnd,flashlight,rotation,bt,airplane,location,hotspot,inversion,saver,dark,work,cast,night,screenrecord,reverse + wifi,cell,dnd,flashlight,rotation,bt,airplane,location,hotspot,inversion,saver,dark,work,cast,night,screenrecord,reverse </string> -
移除设置—电池
packages/apps/Settings/res/values/config.xml diff --git a/res/values/config.xml b/res/values/config.xml index de0dcfbcb6..b928d4ae5e 100755 --- a/res/values/config.xml +++ b/res/values/config.xml @@ -403,7 +403,7 @@ <bool name="config_show_top_level_accessibility">true</bool> <!-- Whether top_level_battery should be shown or not. --> - <bool name="config_show_top_level_battery">true</bool> + <bool name="config_show_top_level_battery">false</bool> <!-- Whether top_level_connected_devices should be shown or not. --> <bool name="config_show_top_level_connected_devices">true</bool>