summaryrefslogtreecommitdiff
path: root/libs/androidfw/AttributeResolution.cpp
diff options
context:
space:
mode:
author Caitlin Shkuratov <caitlinshk@google.com> 2025-03-05 18:53:57 +0000
committer Caitlin Shkuratov <caitlinshk@google.com> 2025-03-07 08:30:49 -0800
commitd88a2b3301a33217459480d6f12a6fc3504defa4 (patch)
tree14f9d4d2247bc5553f630c01e172adb292884e59 /libs/androidfw/AttributeResolution.cpp
parent91a4647e4f1048c00e93e9b3a0c85de5d81ec107 (diff)
[SB][Chips] Allow timer chips to count down to a time in the future.
The current timer chip implementation only counts up from a time in the past, and it shows 00:00 if the time is in the future. But apps could also set their notification time to be in the future and set `isCountDown=true`, meaning that they want the notification UI to count down to that future time. This CL implements that behavior for both non-Compose chips and Compose chips. I don't expect a lot of apps to use this feature, but we should have it in case. The Compose implementation is slightly better (if the duration would be negative, we hide it), but the non-Compose implementation works just like normal notifications so I think it's okay since we plan to launch the Compose chips at the same time as the notification chips. Fixes: 400786236 Fixes: 401464026 Bug: 364653005 Flag: com.android.systemui.status_bar_notification_chips Test: Post notif with `when` 15 seconds in the future, showsChronomter=true, isCountDown=true -> - ChipMod on: chip counts down from 00:15, 00:14, ... 00:00, then hides the text. - ChipMod off: chip counts down from 00:15, 00:14, ... 00:00 -> -00:01, -00:02, ... Test: Post notif with `when` 15 seconds in the future, showsChronometer=true, isCountDown=false -> - ChipMod on: chip shows nothing for 15 seconds, then starts showing 00:00, 00:01, etc. - ChipMod off: chip show -00:15, -00:14, ... 00:00, 00:01 ... Test: Post notif with `when` 15 seconds in the past, showChronometer=true, isCountDown=true -> - ChipMod on: chip never shows any text - ChipMod off: chip shows -00:15, -00:16, ... Test: Post notif with `when` 15 seconds in the past, showChronometer=true, isCountDown=false -> - ChipMod on: chip starts at 00:15 and counts up with 00:16, 00:17... - ChipMod off: chip starts at 00:15 and counts up with 00:16, 00:17... Test: atest ChronometerStateTest NotifChipsViewModelTest Test: Test the above with ChipsModernization both off and on Change-Id: I20d1cf44e5ae2937ac64ceacb7ea045b9fe9989d
Diffstat (limited to 'libs/androidfw/AttributeResolution.cpp')
0 files changed, 0 insertions, 0 deletions