Skip to content
Snippets Groups Projects
  1. Jan 25, 2021
  2. Jan 11, 2021
  3. Dec 23, 2020
    • Matthias Urhahn's avatar
      Improve risklevel result data access performance (DEV) #1953 · 665b6f21
      Matthias Urhahn authored
      
      * Don't log all exposure windows on `RiskLevelTaskResult.toString()` due to performance impact when logging.
      
      * Add RiskLevelResult flow optimized for just getting the latest two results.
      
      * Share risk level result subscriptions.
      The delay when switching from Home to RiskDetails fragment will be bridged and no re-loading necessary.
      
      * Fix test regressions
      
      * Remove test code.
      
      * Introduce specific query for "latestAndLastSuccessful".
      Add unit tests for SQL queries.
      
      * Fix test regressions due to missing mocking.
      
      * Address merge conflicts.
      
      * Fix instrumentation tests not building.
      
      Co-authored-by: default avatarRalf Gehrer <ralfgehrer@users.noreply.github.com>
      665b6f21
  4. Dec 08, 2020
  5. Dec 07, 2020
    • chris-cwa's avatar
      Fixed: fields without values are visible (EXPOSUREAPP-3988) (#1808) · 20baacc9
      chris-cwa authored
      
      * fixed: fields without values are visible; + logs
      
      * detect version update, force recalc on 1.7 -> 1.8
      
      * detect version update in diagnosis keys task only
      
      * no connection type ignoring
      
      * Add test to ensure that parsing old configs from 1.7.x fails and the default fallback for 1.8.x is used.
      
      * Fix logging typo.
      
      * no wasLastDetectionPerformedRecently abort on app update
      
      * Fix lint issues
      
      * fixed condition
      
      * used shared settings
      
      * get last encounter at from enf v1 to display second line after app update while risk level calc is not finished
      
      * fixed di
      
      * fixed tests
      
      * fixed tests
      
      * fixed tests
      
      * Add unit tests for DownloadDiagnosisKeysTask.kt
      
      * fixed tests
      
      * Add tests for DownloadDiagnosisKeysSettingsTest
      
      Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
      20baacc9
  6. Dec 03, 2020
    • Matthias Urhahn's avatar
      Submission upload (EXPOSUREAPP-3748) (#1794) · 950653c1
      Matthias Urhahn authored
      * Submission upload, first draft.
      Storing Symptoms and TEKs.
      
      TODO:
      * Change upload task to use stored data.
      * Blocking upload task
      * Tests
      
      * Update symptoms on each screen.
      Integrate permission request and automatic TEK history update.
      
      TODO:
      * Cancel dialog
      * Blocking upload task
      * Tests
      
      * Add submission on cancel behavior.
      
      * LINTs and unit tests.
      
      * Hooking up navigation and first break through on TAN based submission.
      
      * Hook up navigation for QR Code to test result without consent.
      
      * Fix positive result consent given submission: Abort to Main Screen
      
      * Restore default environment.
      
      * Adjust notification target fragment.
      
      * Address LINTs
      
      * Clean up symptoms introduction nav actions.
      
      * Fix tests
  7. Nov 25, 2020
    • Alex Paulescu's avatar
      Removed traces of grey risk card (EXPOSUREAPP-3051) (#1699) · 86b29f73
      Alex Paulescu authored
      
      * Removed traces of grey risk card.
      
      * Removed UNKNOWN_RISK_INITIAL constant.
      
      * Removed unused method.
      
      * Removed old comments.
      
      * Introduce risklevel calculation failure state to get consistent card states.
      
      * Cleaned up the risk card states.
      Refactored "RiskLevel" to be calculated based on either result or failure reasons.
      Added the new "no internet" error card.
      
      * Updated color states.
      
      * Fixed card color issues.
      
      * Fixed detekt issues.
      
      * Remove test for deleted file.
      
      * Fix test regressions.
      
      * Fixed tests and LINTs.
      
      Co-authored-by: default avatarharambasicluka <64483219+harambasicluka@users.noreply.github.com>
      Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
    • Matthias Urhahn's avatar
      Persist ExposureWindow based risk level calculation results and update the UI... · 2547e10a
      Matthias Urhahn authored
      Persist ExposureWindow based risk level calculation results and update the UI (EXPOSUREAPP-3910,EXPOSUREAPP-3855) (#1705)
      
      * First draft to refactor `RiskRepository` away and persist risk level results produced by ExposureWindow calculations.
      
      TODO: Tests, Legacy data migration, Persist ExposureWindow's in tester builds.
      
      * Unit tests for refactored classes.
      
      * LINTs
      
      * First draft for legacy risk data migration.
      
      TODO: Tests.
      
      * Store exposure windows on device for tester builds and perform clean on them too after risk result deletions.
      Split RiskResultStorage such that the exposure window storage code is only available in deviceForTesters flavor builds.
      
      * simplification
      
      * no preference should return no value
      
      * Remove TODOs, singletons are refactored away ;)
      
      * Simplify RiskLevelTask interface
      
      * Split risk level storage implementations to let production (device flavor) have a NOOP for storing/deleting exposure windows.
      
      * Remove unused storage function.
      Add test skeletons.
      
      * unit test
      
      * unit test
      
      * Update risk card to show new window mode based information.
      
      * Fix test regressions.
      
      * Address PR comments.
      
      * LINTs
      
      * Everybody get's LINT for XMAS.
      
      * Finish unit tests and remove unused classes.
      
      Co-authored-by: default avatarchris-cwa <chris.cwa.sap@gmail.com>
      2547e10a
  8. Nov 24, 2020
  9. Nov 19, 2020
  10. Nov 16, 2020
  11. Nov 06, 2020
  12. Nov 05, 2020
    • Matthias Urhahn's avatar
      Improved AppConfig logic for 1.7.x and 1.8.x (EXPOSUREAPP-3455) (#1520) · 647848d6
      Matthias Urhahn authored
      
      * Split and hide the protobuf config behind interfaces with individual mappers responsible for creating the desired formats.
      
      * Merge branch 'release/1.7.x' into feature/3455-more-frequent-riskscore-updates-configs
      
      # Conflicts:
      #	Corona-Warn-App/src/deviceForTesters/java/de/rki/coronawarnapp/test/risklevel/ui/TestRiskLevelCalculationFragmentCWAViewModel.kt
      #	Corona-Warn-App/src/main/java/de/rki/coronawarnapp/transaction/RiskLevelTransaction.kt
      #	Corona-Warn-App/src/test/java/de/rki/coronawarnapp/transaction/RiskLevelTransactionTest.kt
      
      * Make the AppConfig observable.
      Provide the server time offset.
      Offer a lastUpdatedAt timestamp.
      Add an app config specific test screen.
      Clean up test screens a bit and move debug options out of API test options.
      
      * Fix test regression due to refactoring (moved code around).
      
      * Store the server timestamp and offset at retrieval.
      Switch to config storage via json to be able to store additional meta data fields (i.e. time).
      
      * KLint and Me have a hate relationship based on both mutual admiration.
      
      * Fix time offset parsing being locale dependent.
      
      * Fix broken unit tests.
      
      * Improve offset accuracy, move before unzipping.
      
      * Fix overly long livedata subscription to results (viewmodel scope vs observer scope)
      
      * Add mapping for the new protobuf configs + tests.
      
      * For cached (retrofit) response, we need to check the cacheResponse and its timestamps
      to determine an accurate time offset.
      
      * Exposure a boolean property to tell us when a fallback config is being used.
      
      * Hide the observable flow<ConfigData> behind a method that can automatically triggers refreshes.
      
      * Use a common mapper interface.
      
      * Address PR comments and KLints.
      
      * Fix refactoring regression.
      
      * Improve config unzipping code.
      
      * Add flag to forward exception thrown during HotDataFlow.kt initialization.
      
      * Don't specify a default context via singleton.
      
      * Move download and fallback logic into it's own class just responsible for sourcing the config: "AppConfigSource".
      "AppConfigProvider" is now only responsible for making it available.
      
      * Simplify current concepts for making the app config observable until we have a default configuration.
      
      * Improve app config test screen, delete options, better feedback.
      Show toast instead of crash on errors.
      
      * Fixed GSON serialization not encoding/decoding the byte array correctly.
      Added specific type adapters for instant and duration to get cleaner json.
      
      * Remove type adapters from base gson due to conflict with CalculationTrackerStorage.
      
      * We want to default to forced serialization of instant by our converters, instead of using the default serialization which will differ
      between Java8.Instant and JodaTime.Instant, to prevent future headaches there, register explicit converters by default,
      and overwrite them if necessary (currently only needed for CalculationTrackerStorage.kt).
      
      * Improve AppConfigServer code readability by moving code into extensions.
      
      * Fix merge conflicts
      
      * Throw a more specific exception if gson type decoding fails due to malformed base64 encoding.
      
      * Add unit test for Gson ByteArrayAdapter.
      
      Co-authored-by: default avatarharambasicluka <64483219+harambasicluka@users.noreply.github.com>
      647848d6
  13. Nov 02, 2020
  14. Oct 21, 2020
  15. Oct 19, 2020
    • Matthias Urhahn's avatar
      Refactor missused ViewModels, support automated UI tests and screenshots (EXPOSUREAPP-2946) (#1415) · cec56fdb
      Matthias Urhahn authored
      
      * Introduced `TracingCardState` and `TracingDetailsState`.
      Removed all direct viewmodel/livedata access from all nested layouts for `TracingViewModel`.
      Removed `FormatterRiskHelper`.
      Introduced logic to reactively update the UI state if bluetooth, location or tracing state changes.
      
      TODO:
      * Finish tests in TracingCardStateTest.kt and TracingDetailsStateTest.kt
      * Finish TracingDetailsViewModel.kt and TracingCardViewModel.kt
      * Remove obsolete dependencies on TracingViewModel.kt and singletons RiskLevelRepository.kt, TracingRepository.kt
      
      * Breakthrough, cards update again.
      
      * Further cleanup of TracingViewModel.kt, TracingRepository.kt
      Still not quite there yet, too many calls going into every direction, back and forth, instead of just top->down, but we are getting there.
      We want data flow from business logic code to the UI, keep the UI KISS.
      
      * Update TracingCardState tests to account for changes
      
      * More refactoring, TracingViewModel.kt is now finally gone.
      
      * Fix risk details card, we reuse the cardviewmodel but need to overwrite the `showDetails` flag depending from where it's used.
      
      * Refactored several properties (notification related) out of SettingsViewModel/Repository
      
      * Fix injection
      
      * Refactoring submission related databinding code on the home fragment
      
      * Make TracingRepository.kt injectable and change viewmodel scoping for refresh calls to app scope.
      
      * Remove additional formatter calls from submission cards on home screen.
      
      * Refactored additional SubmissionViewModel logic into SubmissionRepository on the Homescreen.
      First UI Test is now passing.
      
      Simplified ViewModel instantiation related code.
      Prepared HomeFragment for smoother UI state changes, less reloading.
      
      * Improved home,tracing-details and tracing-settings loading behavior, less flickering.
      Fixed LiveData value assignment on background-thread.
      
      * New reactive provider for Bluetooth and Location status.
      Cleaned up ConnectivityHelper.kt partially.
      
      * Implement remaining tests, batch 1.
      
      * Implement remaining tests, batch 2.
      
      * Fix lint issues.
      
      * Removed a few codesmells and code duplication.
      Introduced Flow.shareLatest(...)
      
      * Removed unused parameters.
      
      * LINT fixes.
      
      * Fix unit test failing due to missing mocks.
      
      * Address PR comments.
      
      * Improve UI loading states, remove flickering.
      
      * Remove log spam due to polling values, add extra abort condition that checks for cancellation.
      
      Co-authored-by: default avatarralfgehrer <mail@ralfgehrer.com>
      cec56fdb
  16. Oct 15, 2020
  17. Oct 02, 2020
    • Matthias Urhahn's avatar
      Improve API test fragment and environment switching (DEV) (#1269) · a9ae4ad8
      Matthias Urhahn authored
      
      * Define environment for each flavor and build type.
      
      * Add smart LiveData class that does async initialization (not on the main thread).
      
      * View extensions setGone/setInvisible
      
      * Refactor test for api fragment.
      
      * Replace ALT environment with a list to select from.
      
      * klint
      
      * Fix tests
      
      * Fix tests
      
      * Further flaky test fixes.
      
      * Move the debug check for isLast3HourModeEnabled to the settings.
      The KeyFileDownloader.kt shouldn't be aware of that detail.
      The settings are what is affected by the build flavors/modes.
      
      * Code cleanup and UI improvement of fragment_test_for_a_p_i.xml
      
      * Code that retries flaky tests until we found a better solution.
      Not great, Not terrible...
      
      Co-authored-by: default avatarMert Safter <mert.safter@sap.com>
      a9ae4ad8
  18. Sep 29, 2020
    • Matthias Urhahn's avatar
      Alternative environment setup (#1246) · b6815dc6
      Matthias Urhahn authored
      
      * Move AppConfig related code into it's own package.
      * Use "files" instead of "cache" for storing our AppConfigApiTest.
      * Add "files" to "cache" migration.
      * Refactor CDN related code into an independent "environment module".
      
      TODO: UnitTests, Fallback behavior even if cached AppConfig is stale.
      
      * Further structure refactoring and unit test for app config cache migration.
      
      * Added config fallback behavior for all cases + additional tests.
      
      * Improve code readability.
      
      * First POC for multi-environment support.
      
      * logic for ACME test Countries toggle button in Dev menu
      
      * ACME Test Countries dev menu
      
      * Additional clean up and refactoring on build constants.
      
      * Cleaned up the test fragment a bit.
      
      * Fixed detekt issue
      
      * Fix flaky test that depends on build variant.
      
      * Let the test fragment show us the actual environment we toggled to.
      
      * Changes upon review
      
      * Address PR comments.
      
      Co-authored-by: default avatarRituraj Sambherao <git.rituraj.sambherao@gmail.com>
      b6815dc6
  19. Sep 18, 2020
    • Matthias Urhahn's avatar
      Revert "Interoperability to 1.5.X (#1173)" · c419ae66
      Matthias Urhahn authored
      This reverts commit 6054bf57.
      c419ae66
    • Jakob Möller's avatar
      Interoperability to 1.5.X (#1173) · 6054bf57
      Jakob Möller authored
      
      * Added first set of country flags
      
      Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>
      
      * Added first implementation of Submission Country Selection Screen. (Currently not part of nav graph).
      Moved stuff inside of submission package into subpackages
      
      Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>
      
      * Added missing changes to nav_graph file
      
      * Test Menu options for Country selection and Measurement (EXPOSUREAPP-2229) (#1086)
      
      * Implement country filter (#2229)
      
      * Implement measure for Risk calculation and Key Retrieval (#2229)
      
      * Some code cleanup for measureRiskLevelAndKeyRetrieval
      
      * Some code cleanup (#2229)
      
      * Implement usage of AppConfig usage for country codes (#2229)
      
      * change CURRENT_COUNTRY val to var
      
      * Suppress "LongMethod" warning (#2229)
      
      * Adjust unit tests to respect new country filter
      
      * Align with backend for app config country property name
      
      * Display total file size of keys in results (#2229)
      
      * Fix linting issue
      
      * Update strings.xml files
      
      * Do refactoring and some code clean up
      
      * Move RiskLevel and Key retrieval measurement in own class
      
      * Move code in logical classes. Remove translation in test fragment
      
      * Fix linting and Unit tests
      
      * Remove 3hour boolean check from debug class.
      
      * Refactor CountryWrapper and missing dates check.
      
      * Fix linting and Unit tests
      
      * Add Unit test for getMissingDates
      
      * Code cleanup
      
      * Hide keyboard on action
      
      * Extend statistics for api submission
      
      * Set callback to null after invoked
      
      Co-authored-by: default avatarMert Safter <mert.safter@sap.com>
      Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
      
      * Overhaul of DiagnosisKey related Download and Caching Mechanisms (EXPOSUREAPP-2469) (#1136)
      
      * Rework of keyfile download and caching.
      * Supports interop
      * More modular for better testing and build flavour based behavior adjustments
      * More resilient handling of failed downloads
      * Preperations for future hourly download and serverside checksums
      
      TODO: Finish unit tests, keycache migration and cache health check
      
      * First batch of unit tests and some fixes for incorrect behavior that the tests surfaced.
      
      * Added unit tests for the KeyCacheRepository
      
      TODO: Tests for downloader and migration.
      
      * Implemented POC for migration old key files.
      
      * Fixed legacy file migration and cleanup, improved logging.
      
      * Added unit tests for legacy key file migration.
      
      * Add fallback for different file hashes in the header.
      
      * Yes kLint, we know it's a long method,
      but for this it's better to read it in one block vs jumping to extra methods.
      
      * More linting issues, adjusting project code style prevent a few of these in the future.
      
      * Added missing unit tests for `KeyFileDownloader` and fixed faulty behavior that was noticed during testing.
      
      * CRUD (instrumentation) test for `KeyCacheDatabase`
      
      * Remove unused `FileStorageHelper` and related constants+tests.
      
      * Fix last3Hours unit test in deviceRelease mode, we need to explicitly enable debug for these tests.
      
      * Until we have more information about the hashsum's format in the header, default to `ETag
      
      * Split app config server API from diagnosis key download API,
      and reintroduce caching for the app config download.
      
      * Add test to check that the cache is used on flaky connections.
      
      * Code changes based on PR comment, part #1.
      
      * Code fluff, formatting.
      
      * Handle download errors correctly.
      
      * Refactoring:
      * Remove unnecessary `currentDate` we always start with the newest date from the servers index.
      * Make a specialised class for header validation
      
      * Let legacy cache migration abort early, depending on whether the key dir exists.
      
      * If we can't create the base directory for the key repo, throw an exception.
      
      * Delete cache entry if a download fails.
      
      * Fixed test regression due to refactoring.
      
      * Consolidate staleness check into `getStale`
      
      * Consolidate clean up for failed downloads into the download method.
      Added tests to check that we delete the keycache entry if the download fails (which we didn't for hours :O!)
      
      * Because the hour-mode uses caching too, we add an explicit button to the test menu that clears the cache.
      
      * Add comment with reference to ticket regarding follow up on the other headers.
      
      * Move expected storage size per country into a named constant.
      
      Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
      
      * Implementation of tests for the interoperability countries selection screen (EXPOSUREAPP-2439) (#1140)
      
      * Added initial set of viewModel tests
      
      Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>
      
      * Fail tests on unexpected null.
      
      Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
      
      Co-authored-by: default avatarKolya Opahle <k.opahle@sap.com>
      Co-authored-by: default avatarapopovsap <66370584+apopovsap@users.noreply.github.com>
      Co-authored-by: default avatarMert Safter <69803294+MertSafter@users.noreply.github.com>
      Co-authored-by: default avatarMert Safter <mert.safter@sap.com>
      Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
      Co-authored-by: default avatarMatthias Urhahn <darken@darken.eu>
      6054bf57
  20. Sep 17, 2020
    • Matthias Urhahn's avatar
      Introduce ViewModel Injection (#1151) · e8320fdf
      Matthias Urhahn authored
      
      * DI: ViewModel (VDC) injection wiring + example in TestRiskLevelCalculation.kt
      
      * Refactoring the TestRiskLevel fragment to demo our new viewmodel approach. Part1
      
      * Refactoring the TestRiskLevel fragment to demo our new viewmodel approach. Part2
      
      * Fix `Unexpected indentation (expected 4, actual 8)`
      
      * Code fluff
      
      * klint
      
      * Remove empty test + klint
      
      * Rename VDC to CWAViewModel
      
      * Add example unit tests for the TestFragment's ViewModel.
      
      * Revert AppInjector renaming.
      
      * Comments explaining the code.
      
      * Rename class to make it's purpose less confusing.
      
      * Revert "Rename class to make it's purpose less confusing."
      
      This reverts commit c80298bb
      
      * Rename class to make it's purpose less confusing.
      
      * Simpler ViewModel Injection example.
      
      * klint <3
      
      Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
      e8320fdf
Loading