[Battery usage U] [UI] Add a threshold to filter out very small battery usage items in the app list

Bug: 264840285
Fix: 264840285
Test: manual
Change-Id: I36a6c0dc284d09efcf82316db1541d289c37b16f
This commit is contained in:
Zaiyue Xue
2023-01-10 15:21:50 +08:00
parent 6b47dd97dd
commit 4ecf42f1bb
4 changed files with 39 additions and 20 deletions

View File

@@ -35,6 +35,11 @@ public interface PowerUsageFeatureProvider {
*/
boolean isBatteryUsageEnabled();
/**
* Returns a threshold (mA) for the minimal comsume power in battery usage list
*/
double getBatteryUsageListConsumePowerThreshold();
/**
* Returns an allowlist of app names combined into the system-apps item
*/
@@ -46,7 +51,7 @@ public interface PowerUsageFeatureProvider {
boolean isLocationSettingEnabled(String[] packages);
/**
* Gets an {@link Intent} to show additional battery info.
* Gets an {@link Intent} to show additional battery info
*/
Intent getAdditionalBatteryInfoIntent();
@@ -61,37 +66,37 @@ public interface PowerUsageFeatureProvider {
boolean isTypeSystem(int uid, String[] packages);
/**
* Returns an improved prediction for battery time remaining.
* Returns an improved prediction for battery time remaining
*/
Estimate getEnhancedBatteryPrediction(Context context);
/**
* Returns an improved projection curve for future battery level.
* Returns an improved projection curve for future battery level
*
* @param zeroTime timestamps (array keys) are shifted by this amount
*/
SparseIntArray getEnhancedBatteryPredictionCurve(Context context, long zeroTime);
/**
* Checks whether the toggle for enhanced battery predictions is enabled.
* Checks whether the toggle for enhanced battery predictions is enabled
*/
boolean isEnhancedBatteryPredictionEnabled(Context context);
/**
* Checks whether debugging should be enabled for battery estimates.
* Checks whether debugging should be enabled for battery estimates
*/
boolean isEstimateDebugEnabled();
/**
* Converts the provided string containing the remaining time into a debug string for enhanced
* estimates.
* estimates
*
* @return A string containing the estimate and a label indicating it is an enhanced estimate
*/
String getEnhancedEstimateDebugString(String timeRemaining);
/**
* Converts the provided string containing the remaining time into a debug string.
* Converts the provided string containing the remaining time into a debug string
*
* @return A string containing the estimate and a label indicating it is a normal estimate
*/
@@ -103,7 +108,7 @@ public interface PowerUsageFeatureProvider {
boolean isSmartBatterySupported();
/**
* Checks whether we should show usage information by slots or not.
* Checks whether we should show usage information by slots or not
*/
boolean isChartGraphSlotsEnabled(Context context);
@@ -123,7 +128,7 @@ public interface PowerUsageFeatureProvider {
boolean isExtraDefend();
/**
* Returns {@code true} if delay the hourly job when device is booting.
* Returns {@code true} if delay the hourly job when device is booting
*/
boolean delayHourlyJobWhenBooting();
@@ -133,27 +138,27 @@ public interface PowerUsageFeatureProvider {
Intent getResumeChargeIntent(boolean isDockDefender);
/**
* Returns {@link Set} for the system component ids which are combined into others.
* Returns {@link Set} for the system component ids which are combined into others
*/
Set<Integer> getOthersSystemComponentSet();
/**
* Returns {@link Set} for hiding system component ids in the usage screen.
* Returns {@link Set} for hiding system component ids in the usage screen
*/
Set<Integer> getHideSystemComponentSet();
/**
* Returns {@link Set} for hiding application package names in the usage screen.
* Returns {@link Set} for hiding application package names in the usage screen
*/
Set<String> getHideApplicationSet();
/**
* Returns {@link Set} for hiding applications background usage time.
* Returns {@link Set} for hiding applications background usage time
*/
Set<String> getHideBackgroundUsageTimeSet();
/**
* Returns {@link Set} for ignoring task root class names for screen on time.
* Returns {@link Set} for ignoring task root class names for screen on time
*/
Set<String> getIgnoreScreenOnTimeTaskRootSet();
}