Use the androidx Room package for offline storage. This is a drop-in replacement
for the OfflineStorage_SQLite implementation. This includes unit tests (used as
pinning tests) for the three implementations of IOfflineStorage. Using androidx
Room reduces file size for AAR and APK files.
* Keep reference to ILogConfiguration rather than doing deep-copy.
* If stats timer has already scheduled, re-check the timer again when it's the time to send.
* Adjust the tests to account for the fact that RuntimeConfig object now requires a ref to ILogConfiguration.
* Remove dynamic_cast
* Re-enable stats acquiring common Part A props (device id,etc.) but not the custom Part C contexts
* Make sure the ILogger detached from parent LogManager context can still acquire common Part A props
Related work items: #1696789
Adding a SAL annotation so that any automated tools looking at the "int recv(void* buffer, unsigned size)" function definition know that size is the capacity of buffer.
Reducing / disabling non-essential features and setting various build flags to optimize for small size.
x5 times size reduction.
Functional changes to common core SDK:
* Had to rename IStorage to IDataStorage, as IStorage is a macro defined in Windows SDK.
* Had to refactor user analytics feature storage (SDK UUID / install id) to utilize plain text file rather than FIFO ..
FIFO storage is a legacy structure, bloatware, had to be deprecated and removed going forward anyways.
It wasn't even present in v1 Aria SDK, but somehow slipped thru into v3..
Features excluded from lightweight SDK:
* JSON
* ZLIB
* ECS client
* SQLite DB (only ram queue, no offline storage)
* Transmit Profiles
Related work items: #1550785
Added FunctTests to check KillSwitch feature:
- killSwitchWorks checks that a token is banned and events are dropped
- killIsTemporary checks that a token is banned for an amount of time and no events are dropped after that
Related work items: #1608758
Kill-switch feature:
* collector may decide to kill all events associated with a token
* basic functional test(s) for the feature
Offline storage clean-up:
* if device experiences connectivity issues, then its offline storage may grow too big.
* DB may also contain old records from v1 that we are not processing. Delete those.
Related work items: #1403105, #1403106, #1445871, #1608757
Implementation of M365a Commercial Id (Enrolled Tenant Id) field:
* new bond schema definition
* reading reg key at SDK initialization on Win32 Desktop only (value is empty on Win 10 UWP and Mac OS X)
* other platforms may manually populate the field value using semantic context API
Verified manually:
* reg key show in Aria event inspector matches the reg key on my machine.
* the value is not populated if reg key is missing.
* semantic context can be used to override the value.
Related work items: #1292874
Fixes:
* implement HTTP stack passing of request body to callback for DDV tool
* add Microsoft googletest nupkg to enable visualization of test results in Visual Studio
* fix stats and stats session IDs
* MS Edge: fix telemetry not working if RO context is already inited
* Fix SetType API not working that breaks ODIN annotation processor
* BVT test fixes
Related work items: #1403111, #1403119, #1459042
* address an issue with FlushAndTeardown taking too long: check for DB record count and pending uploads
* address an issue with possible duplication on shutdown (in-flight records successfully uploaded have not been unmarked)
* make API test with respect to logging and upload more strict
* remove Mincore.lib from the build, use Version.lib instead (needed for Win 7 compat)
* downgrade several printouts from INFO to TRACE to reduce the noise at INFO level
* send ram records first and respect their latency: critical goes to in-flight first prior to normal
* respect the "wantMore" flag. We were getting a situation where some records were "stuck" in marked state without being uploaded if these didn't fit into HTTP request
Related work items: #1400900
* must respect DB record count rather than DB size (issue reported by Walter)
* ensure that while we have pending requests - we wait for request completion before canceling them on timeout
* fix for duplicate events saved to disk on shutdown
* records were indefinitely marked as 'reserved' (in-flight) until shutdown in case if ram queue grows larger than max. HTTP request size
* respect latency (priority) of in-ram records: push critical events first prior to pushing lower pri
* push ram first: Why? Because if we have too much in ram, and try to push disk first, in a stress ram goes to disk, we churn extra cycles by going to write and read from disk
* push ram first and in a separate HTTP request: another reason is that when consumer for in-ram records is full, we have no API to indicate that further disk-read shouldn't be done..
So we push ram and disk in a separate request, as it was done in v1. There's no overhead since we use persistent keep-alive connection, reusing SSL socket.
- implementation of Flush method - to move records from in-ram sqlite to on-disk sqlite db
- ability to forward debug callbacks to outside shim (needed for templated LogManager impl). No API changes, but internal impl!
- DebugSource.cpp : forward events to outside shim located at LogManager impl templated surface
- RuntimeConfig_Default.hpp : no longer need to set the path here, as it's done in LogManagerImpl
- ESCConfigCache.cpp : format changes and moved GetAppLocalTempDirectory to MAT as common cross-plat routine
- HttpResponseDecoder.cpp : temporary debug-only change to catch references to deallocated ptrs and assert on that
- IOfflineStorage.hpp : add Flush method (move ram to disk) and a callback for records saved to disk
- DebugEvents.hpp : proxy-forward callbacks to another "cascaded" listener
- ILogManager.hpp : AttachEventSource / DetachEventSource - attach "cascaded" proxy source (as there could be many templ ref to one instance)
- LogManagerBase.hpp : save primary tenant token back to configuration and attach "local" Debug event source proxy on a template
- NullObjects.hpp : add stubs to NULL-object pattern implementation
- Variant.hpp / VariantType.hpp : add draft implementation of thread-safe variants and fix vs201x memory corruption in destructor
- ISqlite3Proxy.hpp : expose v3 close method
- OfflineStorage_SQLite.cpp : move lock to outside of m_db check (race condition fix)
- OfflineStorageHandler.cpp : implementation of async flush copy from ram to disk + callback for records saved to disk
- Move local temp dir detection from UTC helpers to common MAT code
- Statistics.cpp : fix stats record decoration
- TelemetrySystem.cpp : reenable stats and move storage stop after telemetry system stop (otherwise there is a race condition)
- TPM : proper atomic check for uploads scheduled
- Added couple common utils from v1 codebase
Provide an example of how to use LogManager singleton in Guest mode (guest.cpp)
Rename EVTStatus to SDK name-neutral status_t as described in design doc.