Merge "Merge "Use content type specified on the command line" into oc-dev am: f89bf30312" into oc-dr1-dev
diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java b/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java
index 924a82f..426dc7c 100755
--- a/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java
+++ b/packages/SettingsLib/src/com/android/settingslib/graph/BatteryMeterDrawableBase.java
@@ -281,6 +281,7 @@
mIconTint = fillColor;
mFramePaint.setColor(backgroundColor);
mBoltPaint.setColor(fillColor);
+ mPlusPaint.setColor(fillColor);
mChargeColor = fillColor;
invalidateSelf();
}
diff --git a/packages/SettingsLib/tests/integ/src/com/android/settingslib/graph/BatteryMeterDrawableBaseTest.java b/packages/SettingsLib/tests/integ/src/com/android/settingslib/graph/BatteryMeterDrawableBaseTest.java
index aa92fa4..01df0ec 100644
--- a/packages/SettingsLib/tests/integ/src/com/android/settingslib/graph/BatteryMeterDrawableBaseTest.java
+++ b/packages/SettingsLib/tests/integ/src/com/android/settingslib/graph/BatteryMeterDrawableBaseTest.java
@@ -13,6 +13,7 @@
import org.junit.runner.RunWith;
import static com.google.common.truth.Truth.assertThat;
+import static junit.framework.Assert.assertTrue;
import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyFloat;
import static org.mockito.Matchers.anyString;
@@ -101,4 +102,17 @@
private boolean isRectZero(Rect r) {
return r.left == 0 && r.top == 0 && r.right == 0 && r.bottom == 0;
}
+
+ @Test
+ public void testPlusPaint_isEqualToBoltPaint() {
+ // Before setting color
+ assertTrue(mBatteryDrawable.mPlusPaint.hasEqualAttributes(mBatteryDrawable.mBoltPaint));
+
+ final int fakeFillColor = 123;
+ final int fakeBackgrundColor = 456;
+
+ // After
+ mBatteryDrawable.setColors(fakeFillColor, fakeBackgrundColor);
+ assertTrue(mBatteryDrawable.mPlusPaint.hasEqualAttributes(mBatteryDrawable.mBoltPaint));
+ }
}