Add ability to see both battery estimates on long press

If the enhanced estimate is being used in battery settings
it is now possible to long press on the text to have it display
both instead of the string that is normally used.

Adds another loader to enable this since it needs both the old
and the new estimates simultaneously.

Feature is hidden behind a feature flag that only googlers will
have enabled.

Test: robotests
Bug: 38399275
Change-Id: I5caf26513baada27efd50ddb0e72d3868da47150
This commit is contained in:
Salvador Martinez
2017-05-22 17:26:39 -07:00
parent fe23da579d
commit f4727ea07f
10 changed files with 229 additions and 24 deletions

View File

@@ -91,4 +91,25 @@ public interface PowerUsageFeatureProvider {
* Check whether a specific anomaly detector is enabled
*/
boolean isAnomalyDetectorEnabled(@Anomaly.AnomalyType int type);
/**
* Checks whether debugging should be enabled for battery estimates.
* @return
*/
boolean isEstimateDebugEnabled();
/**
* Converts the provided string containing the remaining time into a debug string for enhanced
* estimates.
* @param timeRemaining
* @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.
* @param timeRemaining
* @return A string containing the estimate and a label indicating it is a normal estimate
*/
String getOldEstimateDebugString(String timeRemaining);
}