-
Notifications
You must be signed in to change notification settings - Fork 499
Adjust deadman notification scheduler (EXPOSUREAPP-6600) #2993
Adjust deadman notification scheduler (EXPOSUREAPP-6600) #2993
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tested on Pixel 4 (Android 11)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love it, removing all that code from different places 👌.
Small question? 👇
coronaTestRepository.coronaTests, | ||
enfClient.isTracingEnabled | ||
) { isOnboarded, coronaTests, isTracingEnabled -> | ||
val noPositiveTestRegistered = coronaTests.none { it.isSubmissionAllowed } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use isPositive
? Because isSubmissionAllowed will be false again after submission.
override val isSubmissionAllowed: Boolean
get() = isPositive && !isSubmitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Thanks! Changed it to use isPositive
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
tested on oneplus 8
2302ba8
Kudos, SonarCloud Quality Gate passed! |
Refactor the Deadman Notification scheduler to our new way of how workers work. This way, we don't schedule work from several places within the app, but only from
DeadmanNotificationScheduler
Basically,
deadmanNotificationScheduler.setup()
is called at app start and then the scheduler observes if=> We schedule the Deadman Notification if onBoarding was done, enf tracing is activated and no positive test result is registered.
=> I didn't change the worker itself, so it should behave as before.