Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b64d6c60 authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Screen chips] Don't change recording start time once it's started.

If the user is screen recording a single app,
`ScreenRecordChipInteractor` emits two models very close together (~7ms
apart):
1) Recording(taskPackage=null)
2) Recording(taskPackage="some.package")

This is because the recording state comes from ScreenRecordRepository,
but the taskPackage comes from MediaProjectionRepository, so the
taskPackage comes in slightly later.

Previously, ScreenRecordChipViewModel would change the start time when
the second `Recording` event came in. Changing the start time on the
Chronometer makes it skip a second, due to some of the internal workings
of the Chronometer class.

This CL updates the ScreenRecordChipViewModel to not change the start
time once the recording has started.

Fixes: 349620526
Bug: 332662551
Flag:  com.android.systemui.status_bar_screen_sharing_chips

Test: Screen record a single app -> verify chip timer doesn't skip from
00: 00 to 00:02
Test: atest ScreenRecordChipViewModelTest

Change-Id: Ia6fb78ee050bad835403b781862b53028eacbb51
parent 5fa182d8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment