-
Notifications
You must be signed in to change notification settings - Fork 494
Removed traces of grey risk card (EXPOSUREAPP-3051) #1699
Conversation
@@ -58,7 +56,6 @@ enum class RiskLevel(val raw: Int) { | |||
) | |||
private val HIGH_RISK_LEVELS = arrayOf(INCREASED_RISK) | |||
private val LOW_RISK_LEVELS = arrayOf( | |||
UNKNOWN_RISK_INITIAL, | |||
NO_CALCULATION_POSSIBLE_TRACING_OFF, | |||
LOW_LEVEL_RISK, | |||
UNKNOWN_RISK_OUTDATED_RESULTS, |
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.
What do we need this for?
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.
We were using it for displaying the grey risk cards. Basically before the risk calculation could take place after the onboarding, the initial risk score was attributed this constant value. By removing the grey card, I don't see a need for this constant anymore as the initial risk value is attributed to the LOW_RISK constant now.
RiskLevelConstants.UNKNOWN_RISK_OUTDATED_RESULTS, | ||
RiskLevelConstants.UNKNOWN_RISK_OUTDATED_RESULTS_MANUAL -> |
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.
What do we need this for?
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.
While these two are also used in relation to the grey risk card, they are also needed for displaying the "Risiko-Ermittlung
nicht möglich" card which is a white card from what I can see in the Android Figma file. AFAIK there are instances where the risk calculation can fail after it's been calculated at least once, so these constants should be relevant for the cards with the white background (at least for now).
RiskLevelConstants.LOW_LEVEL_RISK -> R.color.colorSemanticLowRisk | ||
else -> R.color.colorSemanticNeutralRisk | ||
else -> R.color.colorSemanticUnknownRisk |
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.
What do we need this for?
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.
Opposite to what the names suggest, the colorSemanticNeutralRisk is the grey color used for the grey card, and colorSemanticUnknownRisk is white. The fallback color was grey before and I've now changed it to white since there won't be a grey card anymore.
Maybe these color names should be interchanged but I didn't want to introduce more unnecessary modifications for now.
...Warn-App/src/test/java/de/rki/coronawarnapp/ui/riskdetails/DefaultRiskDetailPresenterTest.kt
Show resolved
Hide resolved
@mlenkeit should all grey cards be removed or only the initial one? |
Agreed with @mlenkeit that this is fine, but @SamuraiKek could you verify when |
I'm not sure when it would be visible. I think the values are assigned in RiskLevelTask, when the calculationNotPossibleBecauseOfOutdatedResults() method is called. Now whether this method is ever called, or if the values are overwritten someplace else, I'm not really sure right now. I'll try and look more into it when working on #1615 but for now, I don't see why keeping them in would cause any issue. |
# Conflicts: # Corona-Warn-App/src/main/java/de/rki/coronawarnapp/risk/RiskLevel.kt # Corona-Warn-App/src/main/java/de/rki/coronawarnapp/risk/RiskLevelTask.kt # Corona-Warn-App/src/main/java/de/rki/coronawarnapp/storage/RiskLevelRepository.kt # Corona-Warn-App/src/main/java/de/rki/coronawarnapp/ui/tracing/card/TracingCardState.kt # Corona-Warn-App/src/main/res/values-bg/strings.xml # Corona-Warn-App/src/main/res/values-de/strings.xml # Corona-Warn-App/src/main/res/values-en/strings.xml # Corona-Warn-App/src/main/res/values-pl/strings.xml # Corona-Warn-App/src/main/res/values-ro/strings.xml # Corona-Warn-App/src/main/res/values-tr/strings.xml # Corona-Warn-App/src/main/res/values/strings.xml # Corona-Warn-App/src/test/java/de/rki/coronawarnapp/risk/RiskLevelTest.kt # Corona-Warn-App/src/test/java/de/rki/coronawarnapp/ui/tracing/card/TracingCardStateTest.kt
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.
To resolve the merge conflicts it should be fine if you just add the removed strings again and only remove them in german.
Refactored "RiskLevel" to be calculated based on either result or failure reasons. Added the new "no internet" error card.
# Conflicts: # Corona-Warn-App/src/main/res/values-bg/strings.xml # Corona-Warn-App/src/main/res/values-en/strings.xml # Corona-Warn-App/src/main/res/values-pl/strings.xml # Corona-Warn-App/src/main/res/values-ro/strings.xml # Corona-Warn-App/src/main/res/values-tr/strings.xml # Corona-Warn-App/src/main/res/values/strings.xml
…into feature/remove_grey_risk_cards
If we remove the UNKNOWN state then this PR becomes obsolete: |
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.
Looks really good! I just got one question, will go to device testing now.
...a-Warn-App/src/main/java/de/rki/coronawarnapp/risk/storage/legacy/RiskLevelResultMigrator.kt
Show resolved
Hide resolved
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.
I tested the following states, please correct me if I missed one:
- INCREASED_RISK -> via test menu
- LOW_LEVEL_RISK -> initially at the start
- UNKNOWN_RISK_OUTDATED_RESULTS -> disabled tracing
- UNKNOWN_RISK_OUTDATED_RESULTS_MANUAL -> not able to get into this state, but I'm also not sure when I've seen it the last time, should be investigated in a follow up ticket
- UNKNOWN_RISK_NO_INTERNET -> turned wifi off, time traveled, forced risk calculation via tester menu
…orona-warn-app/cwa-app-android into feature/remove_grey_risk_cards
Kudos, SonarCloud Quality Gate passed! |
Iirc it's also visible in the current version when there is a failure with exposure checking for more than 24 hrs (API 39508, API 10 no public key, BackgroundWorker does not start...), but tracing is on - see also #1081 (EXPOSUREAPP-2796). For now, failure and tracing off will result in the same risk card. But I understood
like this will be addressed elsewhere? |
FailureReason
s are enums stored in a database. More robust than the previous plain numbers.Testing
Try to produce all different card states 😉