Add isBatteryManagerSupported() to control adaptive preferences page

Add isBatteryManagerSupported() in the PowerUsageFeatureProvider to
support controlling the adaptive preferences page dynamically

Bug: 229558366
Test: presubmit
Change-Id: Iffb552feb9e08ca72f2970eb778cd3fcd18f0b7e
This commit is contained in:
ykhung
2022-12-27 14:34:12 +08:00
parent fec083b2cd
commit b875752307
5 changed files with 34 additions and 46 deletions

View File

@@ -75,26 +75,11 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
return false;
}
@Override
public boolean isAdditionalBatteryInfoEnabled() {
return false;
}
@Override
public Intent getAdditionalBatteryInfoIntent() {
return null;
}
@Override
public boolean isAdvancedUiEnabled() {
return true;
}
@Override
public boolean isPowerAccountingToggleEnabled() {
return true;
}
@Override
public Estimate getEnhancedBatteryPrediction(Context context) {
return null;
@@ -146,6 +131,11 @@ public class PowerUsageFeatureProviderImpl implements PowerUsageFeatureProvider
return false;
}
@Override
public boolean isBatteryManagerSupported() {
return true;
}
@Override
public Intent getResumeChargeIntent(boolean isDockDefender) {
return null;