root@adw-All-Series:/home/share/work/lhf/industry-3399-7.1/frameworks/base/packages/SystemUI# git diff src/com/android/systemui/BatteryMeterView.java
diff --git a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
index 459ba44..d8b95cc 100644
--- a/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
+++ b/packages/SystemUI/src/com/android/systemui/BatteryMeterView.java
@@ -54,7 +54,7 @@ public class BatteryMeterView extends ImageView implements
mSlotBattery = context.getString(
com.android.internal.R.string.status_bar_battery);
- setImageDrawable(null); // 电池图标隐藏
+ setImageDrawable(mDrawable); // 电池图标显示
}
@Override
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QSTileHost.java
@@ -416,6 +416,7 @@ public class QSTileHost implements QSTile.Host, Tunable {
}
public QSTile<?> createTile(String tileSpec) {
+ Log.d(TAG,"tileSpec: " + tileSpec);
if (tileSpec.equals("wifi")) return new WifiTile(this);
else if (tileSpec.equals("bt")) return new BluetoothTile(this);
else if (tileSpec.equals("cell")) return new CellularTile(this);
@@ -429,7 +430,7 @@ public class QSTileHost implements QSTile.Host, Tunable {
else if (tileSpec.equals("cast")) return new CastTile(this);
else if (tileSpec.equals("hotspot")) return new HotspotTile(this);
else if (tileSpec.equals("user")) return new UserTile(this);
- // else if (tileSpec.equals("battery")) return new BatteryTile(this); // 电池图标隐藏
+ else if (tileSpec.equals("battery")) return new BatteryTile(this); // 电池图标显示
else if (tileSpec.equals("saver")) return new DataSaverTile(this);
else if (tileSpec.equals("night")) return new NightDisplayTile(this);
// Intent tiles.
想要把状态栏上的电池图标隐藏起来,把setImageDrawable(null); 注释 // else if (tileSpec.equals("battery")) return new BatteryTile(this);这一行代码。
相反想要把状态栏上的电池图标显示出来,把 setImageDrawable(mDrawable); 放开else if (tileSpec.equals("battery")) return new BatteryTile(this); 这一行代码。