Update adaptive preference summary
Bug: 195627250 Test: make RunSettingsRoboTests Change-Id: I50ed736bbba7ac8d3d6fcf026e9e17e2116f86a7
This commit is contained in:
@@ -6283,6 +6283,8 @@
|
||||
|
||||
<!-- Summary for battery manager when it is on -->
|
||||
<string name="battery_manager_summary">Detecting when apps drain battery</string>
|
||||
<!-- Summary for battery manager when it is on. [CHAR LIMIT=NONE] -->
|
||||
<string name="battery_manager_summary_unsupported">Detecting when apps drain battery</string>
|
||||
|
||||
<!-- Summary for battery manager when it is off -->
|
||||
<string name="battery_manager_off">Off</string>
|
||||
|
@@ -139,6 +139,11 @@ public interface PowerUsageFeatureProvider {
|
||||
*/
|
||||
boolean isChartGraphSlotsEnabled(Context context);
|
||||
|
||||
/**
|
||||
* Checks whether adaptive charging feature is supported in this device
|
||||
*/
|
||||
boolean isAdaptiveChargingSupported();
|
||||
|
||||
/**
|
||||
* Gets a intent for one time bypass charge limited to resume charging.
|
||||
*/
|
||||
|
@@ -166,6 +166,11 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAdaptiveChargingSupported() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Intent getResumeChargeIntent() {
|
||||
return null;
|
||||
|
@@ -64,7 +64,10 @@ public class BatteryManagerPreferenceController extends BasePreferenceController
|
||||
preference.setSummary(mContext.getResources().getQuantityString(
|
||||
R.plurals.battery_manager_app_restricted, num, num));
|
||||
} else {
|
||||
preference.setSummary(R.string.battery_manager_summary);
|
||||
preference.setSummary(
|
||||
mPowerUsageFeatureProvider.isAdaptiveChargingSupported()
|
||||
? R.string.battery_manager_summary
|
||||
: R.string.battery_manager_summary_unsupported);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -156,6 +156,11 @@ public class PowerUsageFeatureProviderImplTest {
|
||||
assertThat(mPowerFeatureProvider.isSmartBatterySupported()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIsAdaptiveChargingSupported_returnFalse() {
|
||||
assertThat(mPowerFeatureProvider.isAdaptiveChargingSupported()).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetResumeChargeIntent_returnNull() {
|
||||
assertThat(mPowerFeatureProvider.getResumeChargeIntent()).isNull();
|
||||
|
Reference in New Issue
Block a user