Migrate Tips Card in battery uasge to Settings Card.

before:
[Dark-settings]:https://screenshot.googleplex.com/56EiS3PbtRsh5RR
[Light-app]:https://screenshot.googleplex.com/8UDuFEkkrLUt53D

after:
[Dark-settings]:https://screenshot.googleplex.com/3zKxxGi2Awa6s72
[Light-settings]:https://screenshot.googleplex.com/rsgVh9P62x7itUa
[Dark-app]:https://screenshot.googleplex.com/56EiS3PbtRsh5RR
[Light-app]:https://screenshot.googleplex.com/6bfs2u43nZpHL8y

Bug: 357603119
Test: atest BatteryTipsControllerTest
Flag: EXEMPT bug fix
Change-Id: I25e3b407378b01ef9868326a005554ceb6e94181
This commit is contained in:
mxyyiyi
2024-08-08 13:35:43 +08:00
committed by Wesley Wang
parent 377939483c
commit 427c9c3187
13 changed files with 178 additions and 724 deletions

View File

@@ -264,18 +264,28 @@ public class BatteryTestUtils {
/** Create a power anomaly event proto of screen timeout. */
public static PowerAnomalyEvent createScreenTimeoutAnomalyEvent() {
return createScreenTimeoutAnomalyEvent(false);
}
/** Create a power anomaly event proto of screen timeout. */
public static PowerAnomalyEvent createScreenTimeoutAnomalyEvent(boolean changeSettings) {
WarningBannerInfo.Builder warningBannerInfoBuilder =
WarningBannerInfo.newBuilder()
.setMainButtonDestination(ScreenTimeoutSettings.class.getName())
.setMainButtonSourceMetricsCategory(SettingsEnums.SCREEN_TIMEOUT)
.setMainButtonSourceHighlightKey("60000");
if (changeSettings) {
warningBannerInfoBuilder
.setMainButtonConfigSettingsName(Settings.System.SCREEN_OFF_TIMEOUT)
.setMainButtonConfigSettingsValue(60000);
}
return PowerAnomalyEvent.newBuilder()
.setEventId("ScreenTimeoutAnomaly")
.setType(PowerAnomalyType.TYPE_SETTINGS_BANNER)
.setKey(PowerAnomalyKey.KEY_SCREEN_TIMEOUT)
.setDismissRecordKey(PowerAnomalyKey.KEY_SCREEN_TIMEOUT.name())
.setScore(1.1f)
.setWarningBannerInfo(
WarningBannerInfo.newBuilder()
.setMainButtonDestination(ScreenTimeoutSettings.class.getName())
.setMainButtonSourceMetricsCategory(SettingsEnums.SCREEN_TIMEOUT)
.setMainButtonSourceHighlightKey("60000")
.build())
.setWarningBannerInfo(warningBannerInfoBuilder.build())
.build();
}