Merge "Update adaptive preference summary" into sc-v2-dev am: 6ff60d7771
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15981706 Change-Id: I33990898878a7f3a451667827936503f707f09f7
This commit is contained in:
@@ -6288,6 +6288,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