//SystemUI中的获取状态项
frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\policy\ BatteryController.java
/// M: Support "battery percentage". @{
private boolean mShouldShowBatteryPercentage = true;//the default value false
public BatteryController(Context context) {
mContext = context;
/// M: Support "battery percentage".
//modify support battery percentage lhw start
//mShouldShowBatteryPercentage = (Settings.Secure.getInt(context.getContentResolver(), Settings.Secure.BATTERY_PERCENTAGE, 0) != 0);
private void refreshBatteryPercentage() {
if (mLabelViews.size() > 0) {
TextView v = mLabelViews.get(0);
if (v != null) {
//modify show BatteryPercentage lhw start
if (mShouldShowBatteryPercentage) {
v.setVisibility(View.GONE);
} else {
Android MTK 修改默认显示电池百分比
最新推荐文章于 2022-06-09 17:08:35 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)