Loading packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModel.kt +2 −2 Original line number Diff line number Diff line Loading @@ -200,8 +200,8 @@ constructor( colors, startTimeMs = this.promotedContent.time.elapsedRealtimeMillis, isEventInFuture = this.promotedContent.time.isCountDown, onClickListenerLegacy, clickBehavior, onClickListenerLegacy = onClickListenerLegacy, clickBehavior = clickBehavior, ) } } Loading packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/compose/ChipContent.kt +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ fun ChipContent(viewModel: OngoingActivityChipModel.Active, modifier: Modifier = rememberChronometerState( eventTimeMillis = viewModel.startTimeMs, isCountDown = viewModel.isEventInFuture, timeSource = viewModel.timeSource, ) timerState.currentTimeText?.let { text -> Text( Loading packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt +9 −0 Original line number Diff line number Diff line Loading @@ -18,12 +18,14 @@ package com.android.systemui.statusbar.chips.ui.model import android.annotation.CurrentTimeMillisLong import android.annotation.ElapsedRealtimeLong import android.os.SystemClock import android.view.View import com.android.systemui.animation.Expandable import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.statusbar.StatusBarIconView import com.android.systemui.statusbar.chips.notification.shared.StatusBarNotifChips import com.android.systemui.statusbar.chips.ui.viewmodel.TimeSource import com.android.systemui.statusbar.core.StatusBarConnectedDisplays /** Model representing the display of an ongoing activity as a chip in the status bar. */ Loading Loading @@ -105,6 +107,13 @@ sealed class OngoingActivityChipModel { * [android.widget.Chronometer.setBase]. */ @ElapsedRealtimeLong val startTimeMs: Long, /** * The [TimeSource] that should be used to track the current time for this timer. Should * be compatible with [startTimeMs]. */ val timeSource: TimeSource = TimeSource { SystemClock.elapsedRealtime() }, /** * True if this chip represents an event starting in the future and false if this chip * represents an event that has already started. If true, [startTimeMs] should be in the Loading packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/ChronometerState.kt +1 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.chips.ui.viewmodel import android.annotation.ElapsedRealtimeLong import android.os.SystemClock import android.text.format.DateUtils.formatElapsedTime import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect Loading Loading @@ -90,7 +89,7 @@ class ChronometerState( fun rememberChronometerState( eventTimeMillis: Long, isCountDown: Boolean, timeSource: TimeSource = remember { TimeSource { SystemClock.elapsedRealtime() } }, timeSource: TimeSource, ): ChronometerState { val state = remember(timeSource, eventTimeMillis, isCountDown) { Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/chips/notification/ui/viewmodel/NotifChipsViewModel.kt +2 −2 Original line number Diff line number Diff line Loading @@ -200,8 +200,8 @@ constructor( colors, startTimeMs = this.promotedContent.time.elapsedRealtimeMillis, isEventInFuture = this.promotedContent.time.isCountDown, onClickListenerLegacy, clickBehavior, onClickListenerLegacy = onClickListenerLegacy, clickBehavior = clickBehavior, ) } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/compose/ChipContent.kt +1 −0 Original line number Diff line number Diff line Loading @@ -78,6 +78,7 @@ fun ChipContent(viewModel: OngoingActivityChipModel.Active, modifier: Modifier = rememberChronometerState( eventTimeMillis = viewModel.startTimeMs, isCountDown = viewModel.isEventInFuture, timeSource = viewModel.timeSource, ) timerState.currentTimeText?.let { text -> Text( Loading
packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/model/OngoingActivityChipModel.kt +9 −0 Original line number Diff line number Diff line Loading @@ -18,12 +18,14 @@ package com.android.systemui.statusbar.chips.ui.model import android.annotation.CurrentTimeMillisLong import android.annotation.ElapsedRealtimeLong import android.os.SystemClock import android.view.View import com.android.systemui.animation.Expandable import com.android.systemui.common.shared.model.ContentDescription import com.android.systemui.common.shared.model.Icon import com.android.systemui.statusbar.StatusBarIconView import com.android.systemui.statusbar.chips.notification.shared.StatusBarNotifChips import com.android.systemui.statusbar.chips.ui.viewmodel.TimeSource import com.android.systemui.statusbar.core.StatusBarConnectedDisplays /** Model representing the display of an ongoing activity as a chip in the status bar. */ Loading Loading @@ -105,6 +107,13 @@ sealed class OngoingActivityChipModel { * [android.widget.Chronometer.setBase]. */ @ElapsedRealtimeLong val startTimeMs: Long, /** * The [TimeSource] that should be used to track the current time for this timer. Should * be compatible with [startTimeMs]. */ val timeSource: TimeSource = TimeSource { SystemClock.elapsedRealtime() }, /** * True if this chip represents an event starting in the future and false if this chip * represents an event that has already started. If true, [startTimeMs] should be in the Loading
packages/SystemUI/src/com/android/systemui/statusbar/chips/ui/viewmodel/ChronometerState.kt +1 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.systemui.statusbar.chips.ui.viewmodel import android.annotation.ElapsedRealtimeLong import android.os.SystemClock import android.text.format.DateUtils.formatElapsedTime import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect Loading Loading @@ -90,7 +89,7 @@ class ChronometerState( fun rememberChronometerState( eventTimeMillis: Long, isCountDown: Boolean, timeSource: TimeSource = remember { TimeSource { SystemClock.elapsedRealtime() } }, timeSource: TimeSource, ): ChronometerState { val state = remember(timeSource, eventTimeMillis, isCountDown) { Loading