diff --git a/color-check-baseline.xml b/color-check-baseline.xml
index 410acade269..3ba943b8e90 100644
--- a/color-check-baseline.xml
+++ b/color-check-baseline.xml
@@ -13,6 +13,198 @@
file="."/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -40,8 +232,8 @@
errorLine1=" <item android:offset="0" android:color="#001A73E8"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -56,8 +248,8 @@
errorLine1=" <item android:offset="0.69" android:color="#FF669DF6"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -72,8 +264,8 @@
errorLine1=" <item android:offset="0.69" android:color="#FF1A73E8"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -88,8 +280,8 @@
errorLine1=" <item android:offset="0" android:color="#00669DF6"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -104,8 +296,8 @@
errorLine1=" <item android:offset="0" android:color="#001A73E8"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -120,8 +312,8 @@
errorLine1=" <item android:offset="0.69" android:color="#FF669DF6"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -136,8 +328,8 @@
errorLine1=" <item android:offset="0.69" android:color="#FF1A73E8"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -152,8 +344,8 @@
errorLine1=" <item android:offset="0" android:color="#00669DF6"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -168,8 +360,8 @@
errorLine1=" <item android:offset="0" android:color="#001A73E8"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -184,8 +376,8 @@
errorLine1=" <item android:offset="0.69" android:color="#FF669DF6"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -200,8 +392,200 @@
errorLine1=" <item android:offset="0.69" android:color="#FF1A73E8"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -216,8 +600,8 @@
errorLine1=" <item android:offset="0" android:color="#00669DF6"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -232,8 +616,8 @@
errorLine1=" <item android:offset="0" android:color="#001A73E8"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -248,8 +632,8 @@
errorLine1=" <item android:offset="0.69" android:color="#FF669DF6"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
@@ -264,72 +648,8 @@
errorLine1=" <item android:offset="0.69" android:color="#FF1A73E8"/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -4157,326 +4477,6 @@
column="13"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -5817,7 +5817,7 @@
errorLine2=" ^">
@@ -5833,7 +5833,7 @@
errorLine2=" ^">
@@ -5849,7 +5849,7 @@
errorLine2=" ^">
@@ -5865,7 +5865,7 @@
errorLine2=" ^">
@@ -5881,7 +5881,7 @@
errorLine2=" ^">
@@ -5897,7 +5897,7 @@
errorLine2=" ^">
@@ -5913,7 +5913,7 @@
errorLine2=" ^">
@@ -5929,7 +5929,7 @@
errorLine2=" ^">
@@ -5945,7 +5945,7 @@
errorLine2=" ^">
@@ -5961,7 +5961,7 @@
errorLine2=" ^">
@@ -5977,7 +5977,7 @@
errorLine2=" ^">
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 28543148e14..cb5546a1e4f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5123,9 +5123,9 @@
Charge to full
- Incompatible charging setup
+ Issue with charging accessory
- Your battery is not charging or is charging very slowly
+ Battery charging slowly or won\'t charge. Check if the cable and power adapter work with your phone
Learn more about incompatible charging
@@ -5275,6 +5275,9 @@
Turn off when charged
+
+ Turn off at %1$s
+
Battery Saver turns off when battery reaches %1$s
diff --git a/res/xml/configure_notification_settings.xml b/res/xml/configure_notification_settings.xml
index 0f0aeff7aa5..f80fe571d82 100644
--- a/res/xml/configure_notification_settings.xml
+++ b/res/xml/configure_notification_settings.xml
@@ -131,14 +131,14 @@
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverStickyPreferenceController.java b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverStickyPreferenceController.java
index d11fe8a3b88..f06083abfae 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverStickyPreferenceController.java
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverStickyPreferenceController.java
@@ -14,6 +14,7 @@ import com.android.settings.core.TogglePreferenceController;
public class BatterySaverStickyPreferenceController extends TogglePreferenceController implements
PreferenceControllerMixin, Preference.OnPreferenceChangeListener {
+ private static final int DEFAULT_STICKY_SHUTOFF_LEVEL = 90;
private Context mContext;
@@ -39,10 +40,13 @@ public class BatterySaverStickyPreferenceController extends TogglePreferenceCont
@Override
protected void refreshSummary(Preference preference) {
super.refreshSummary(preference);
- final int stickyShutoffLevel = Settings.Global.getInt(
- mContext.getContentResolver(), Global.LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL, 90);
+ final int stickyShutoffLevel = Settings.Global.getInt(mContext.getContentResolver(),
+ Global.LOW_POWER_MODE_STICKY_AUTO_DISABLE_LEVEL, DEFAULT_STICKY_SHUTOFF_LEVEL);
+ final String formatPercentage = Utils.formatPercentage(stickyShutoffLevel);
+ preference.setTitle(mContext.getString(R.string.battery_saver_sticky_title_percentage,
+ formatPercentage));
preference.setSummary(mContext.getString(R.string.battery_saver_sticky_description_new,
- Utils.formatPercentage(stickyShutoffLevel)));
+ formatPercentage));
}
@Override
diff --git a/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceController.java b/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceController.java
index 1c4c67c8781..ff747e36791 100644
--- a/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceController.java
+++ b/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceController.java
@@ -51,6 +51,7 @@ public class BatteryManagerPreferenceController extends BasePreferenceController
@Override
public int getAvailabilityStatus() {
return mPowerUsageFeatureProvider.isBatteryManagerSupported()
+ && mPowerUsageFeatureProvider.isAdaptiveChargingSupported()
? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE;
}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/TopLevelBatteryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/TopLevelBatteryPreferenceControllerTest.java
index da0002c50a4..f9cac5640a5 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/TopLevelBatteryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/TopLevelBatteryPreferenceControllerTest.java
@@ -61,12 +61,6 @@ public class TopLevelBatteryPreferenceControllerTest {
assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
}
- @Test
- @Config(qualifiers = "mcc999")
- public void getAvailabilityStatus_unsupportedWhenSet() {
- assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
- }
-
@Test
public void convertClassPathToComponentName_nullInput_returnsNull() {
assertThat(mController.convertClassPathToComponentName(null)).isNull();
@@ -118,4 +112,4 @@ public class TopLevelBatteryPreferenceControllerTest {
assertThat(mController.getSummary())
.isEqualTo(mContext.getString(R.string.battery_missing_message));
}
-}
\ No newline at end of file
+}
diff --git a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceControllerTest.java
index 36f891edb1a..218fa9e5a51 100644
--- a/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/fuelgauge/batterytip/BatteryManagerPreferenceControllerTest.java
@@ -86,6 +86,7 @@ public class BatteryManagerPreferenceControllerTest {
@Test
public void getAvailabilityStatus_supportBatteryManager_showPrefPage() {
when(mPowerUsageFeatureProvider.isBatteryManagerSupported()).thenReturn(true);
+ when(mPowerUsageFeatureProvider.isAdaptiveChargingSupported()).thenReturn(true);
assertThat(mController.getAvailabilityStatus()).isEqualTo(
BatteryManagerPreferenceController.AVAILABLE_UNSEARCHABLE);
@@ -98,4 +99,13 @@ public class BatteryManagerPreferenceControllerTest {
assertThat(mController.getAvailabilityStatus()).isEqualTo(
BatteryManagerPreferenceController.UNSUPPORTED_ON_DEVICE);
}
+
+ @Test
+ public void getAvailabilityStatus_supportBatteryManagerWithoutAC_notShowPrefPage() {
+ when(mPowerUsageFeatureProvider.isBatteryManagerSupported()).thenReturn(true);
+ when(mPowerUsageFeatureProvider.isAdaptiveChargingSupported()).thenReturn(false);
+
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(
+ BatteryManagerPreferenceController.UNSUPPORTED_ON_DEVICE);
+ }
}