Skip to content
Snippets Groups Projects
user avatar
Kolya Opahle authored
* initial commit of Analytics upload code (lots of missing pieces)
kind of working: Definition of backends and endpoints, donor data collection (no donors implemented here)
probably broken: SafetyNet attestation, actual server communication

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* added checks for analytics submission abortion

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* added analytics submission periodic worker definition

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* lint fixes

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Fixed kotlin support for IntoSet injection
Added AnalyticsModule to DataDonationModule
Added WorkerBinder definition for DataDonationAnalyticsPeriodicWorker
Added DataDonationAnalyticsPeriodicWorker scheduling to CoronaWarnApplication
Added missing mocks to WorkerBinderTest

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Fixed injectData call in ExposureRiskMetadataDonor
Added more logging to Analytics
Implemented first AnalyticsTests
Fixed auto formatted removal of io.kotest.matchers.collections.shouldContainAll in WorkerBinderTest (curse you Optimize imports)

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Implemented Test for ExposureRiskMetadataDonor

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added check for isEnabled during Analytics submission
Added DataDonationAnalyticsOneTimeWorker to allow for random distribution of Analytics submission events

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Moved contribution collection to own function to help with test menu features

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added analytics testing features

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* small fixes to the WorkerBinderTest
added missing worker binding to WorkerBinder

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Put Analytics test options into an extra card.

* in my defense, it was quite late

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Moved AnalyticsSettings to own package
Updated the @IntoSet providers in AnalyticsModule to match the actual DonorModules

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added analyticsEnabled preference to AnalyticsSettings

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added a deleteData function to the DonorModule interface which can be used to remove persisted data if a user revokes analytics consent

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added skeleton to persist last analytics submission on tester devices
Currently the tester version also does not store the data

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Fixed borked unit tests

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Implemented File based storage of Last submitted analytics file on tester devices

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added calls to enable and disable analytics to the OnboardingAnalyticsViewModel

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Fixed OnboardingAnalyticsFragmentTest

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Turns out AnalyticsConfigMapping was not implemented yet, fixed that

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added a timestamp to the stored Analytics Submission

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Fixed unit tests in AnalyticsTest

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Updated AnalyticsConfigMapper to throw an exception if app config is invalid

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Implemented most of the comments from @d4rken

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* if -> when magic

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Moved analytics enable/disable to the Analytics class to allow for deletion on disable

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Made the AnalyticsTest a bit more concise and improved the abort checks

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Changed Api provider to reusable

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Aligned DataDonationAnalyticsApiV1 response with Survery format

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Fixed OnboardingAnalyticsFragmentTest

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Merge with ppa-main exploded this for some reason, fixed now

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Added analytics deactivation if no config is present on remote

Signed-off-by: default avatarKolya Opahle <k.opahle@sap.com>

* Fix error message if there is no last analytics data.
We only need to check the values if the object itself is non-null.

* Refactor upload response code check. Use a single `return when` to let the compiler enforce correct case handling.

* Use a specific time object, as Long and just `getDelay` could be confusing.
Android mostly uses long=miliseconds and not hours.

* Only get the config once for the whole analytics submission process.
Prevent unnecessary config checks, and if the config cache expires, don't let the config change in the middle of submisison.

* LINTER ¯\_(ツ)_/¯

Co-authored-by: default avatarMatthias Urhahn <matthias.urhahn@sap.com>
b0800290
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Name Last commit Last update
..