question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Product flavor for using mock exposure notification API

See original GitHub issue

In the code you mention a plan to add a product flavor that should use a mock exposure notification API: https://github.com/corona-warn-app/cwa-app-android/blob/a326bb4bfc2661b3e5ff8e53a1951b5ad351a395/Corona-Warn-App/build.gradle#L67-L77

Is this something that could be done as a contribution? Looking at InternalExposureNotificationClient it seems like one option could be to inject a different/mock ExposureNotificationClient implementation that returns some dummy values. This at least would allow launching the app without any API support on the device. Did you have more elaborate plans? (e.g. controlling the mocked API via an activity or test app?).

Would be interested in contributing this if possible.


Internal Tracking ID: EXPOSUREAPP-1967

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

5reactions
pocmocommented, Jun 18, 2020

Added a first iteration to my repository: https://github.com/pocmo/cwa-app-android/commit/7043609ea79b8ee062c2e1e6542d4c7391350424

In that patch I changed InternalExposureNotificationClient to delegate the creation of ExposureNotificationClient to a factory object. There are different versions of the factory for the device and deviceForTesters flavors. The device flavor continues to use Nearby.getExposureNotificationClient while the deviceForTesters returns a mock implementation that for now just returns hardcoded values for the API calls.

In further iterations I would like to (only in the deviceForTesters flavor):

  • Introduce a test fragment (like you already have for testing the API and the risk level) that allows configuring what the API should return (e.g. values in ExposureSummary)
  • Persist the values (e.g. SharedPreferences) to make them stable across app restarts and for background tasks.
  • Provide a toggle in the test fragment to switch between using the actual API and the mock API.
4reactions
pocmocommented, Jun 10, 2020

Alright, I’ll work in my fork for now and will report back once something interesting comes out of it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

API for Exposure Notifications - Google Developers
This guide shows you how to use the Exposure Notifications API to build Android apps that notify users of possible exposure to confirmed ......
Read more >
The Case For Contact Tracing Apps Built On Apple ... - Techdirt.
The exposure notification API developed by Google and Apple is a genuine achievement: it will enable the most privacy-respecting approach to ...
Read more >
Privacy-Preserving Automated Exposure Notification
We provide formal definitions for automated exposure notification and its security, and we prove the security of our constructions with ...
Read more >
Exposure Notification | Apple Developer Documentation
Use the Exposure Notification framework to inform people of potential exposure to COVID-19, the disease caused by the SARS-CoV-2 virus. You can build...
Read more >
SAFETY DATA SHEET - PolySpec
Toxic to aquatic life with long lasting effects. ... when using this product. ... or the American Petroleum Institute (API) Recommended Practice.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found