Loading packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +13 −4 Original line number Diff line number Diff line Loading @@ -89,8 +89,10 @@ public class BatteryMeterView extends View implements DemoMode { setContentDescription( context.getString(R.string.accessibility_battery_level, level)); if (mBatteryMeterDrawable != null) { setVisibility(View.VISIBLE); invalidateIfVisible(); } } else if (action.equals(ACTION_LEVEL_TEST)) { testmode = true; post(new Runnable() { Loading Loading @@ -245,9 +247,11 @@ public class BatteryMeterView extends View implements DemoMode { mHeight = h; mWidth = w; synchronized (mLock) { if (mBatteryMeterDrawable != null) { mBatteryMeterDrawable.onSizeChanged(w, h, oldw, oldh); } } } protected void invalidateIfVisible() { if (getVisibility() == View.VISIBLE && mAttached) { Loading Loading @@ -284,6 +288,9 @@ public class BatteryMeterView extends View implements DemoMode { mMeterMode = mode; if (mode == BatteryMeterMode.BATTERY_METER_GONE) { setVisibility(View.GONE); synchronized (mLock) { mBatteryMeterDrawable = null; } } else { synchronized (mLock) { if (mBatteryMeterDrawable != null) { Loading @@ -305,9 +312,11 @@ public class BatteryMeterView extends View implements DemoMode { @Override public void draw(Canvas c) { synchronized (mLock) { if (mBatteryMeterDrawable != null) { mBatteryMeterDrawable.onDraw(c); } } } @Override public void dispatchDemoCommand(String command, Bundle args) { Loading Loading
packages/SystemUI/src/com/android/systemui/BatteryMeterView.java +13 −4 Original line number Diff line number Diff line Loading @@ -89,8 +89,10 @@ public class BatteryMeterView extends View implements DemoMode { setContentDescription( context.getString(R.string.accessibility_battery_level, level)); if (mBatteryMeterDrawable != null) { setVisibility(View.VISIBLE); invalidateIfVisible(); } } else if (action.equals(ACTION_LEVEL_TEST)) { testmode = true; post(new Runnable() { Loading Loading @@ -245,9 +247,11 @@ public class BatteryMeterView extends View implements DemoMode { mHeight = h; mWidth = w; synchronized (mLock) { if (mBatteryMeterDrawable != null) { mBatteryMeterDrawable.onSizeChanged(w, h, oldw, oldh); } } } protected void invalidateIfVisible() { if (getVisibility() == View.VISIBLE && mAttached) { Loading Loading @@ -284,6 +288,9 @@ public class BatteryMeterView extends View implements DemoMode { mMeterMode = mode; if (mode == BatteryMeterMode.BATTERY_METER_GONE) { setVisibility(View.GONE); synchronized (mLock) { mBatteryMeterDrawable = null; } } else { synchronized (mLock) { if (mBatteryMeterDrawable != null) { Loading @@ -305,9 +312,11 @@ public class BatteryMeterView extends View implements DemoMode { @Override public void draw(Canvas c) { synchronized (mLock) { if (mBatteryMeterDrawable != null) { mBatteryMeterDrawable.onDraw(c); } } } @Override public void dispatchDemoCommand(String command, Bundle args) { Loading