Use LogEvent::getAttributionChainIndex() to check presence of
attribution chains
Bug: 150414252
Test: bit statsd_test:*
Change-Id: Ic798d3b182c2b5aaf73444f2796d539cd3f7bf40
Use shouldTruncateTimestamp flag in LogEvent instead of the blacklist
to determine whether timestamp should be truncated.
Bug: 150414373
Test: bit statsd_test:*
Change-Id: I4e21ae4909484dd898b9fcd3ce7a018f5e9d982f
Use the annotation information in LogEvent/FieldValue instead.
- Initialize nested to true in FieldValue.mAnnotations
- Add filterPrimaryKey function to HashableDimensionKey for populating a
HashableDimensionKey with all FieldValues that have the primary key
annotation set.
- Create StateTrackers without checking if atom is a state atom. (We
can't do this check anymore)
- Remove mAtomId, mStateField, mNested, mPrimaryFields, mDefaultState,
mResetState members from StateTracker. Use the information passed in
LogEvent in onLogEvent instead.
- Update tests to log annotations when logging events.
- Remote kStateAtomsFieldOptions from atoms_info.
- Make MetricProducer::mStateGroupMap const
- Rename handlePartialReset to clearStateForPrimaryKey
- Store "default" states in mStateMap. An entry in mStateMap means the
state is not kStateUnknown. Before, an entry in mStateMap meant the
state is not the "default" state.
- Consolidate all state change logic in updateStateForPrimaryKey()
- remote StateTracker::updateState
- handleReset and clearStateForPrimaryKey call
updateStateForPrimaryKey for resetting and clearing of states
respectively.
- Create a helper method for notifying StateTracker listeners
- Make StateManager::registerListener void
Bug: 151110842
Test: bit statsd_test:*
Change-Id: Ifb8371b213a178fcccaa484086fbdd283dbaec49
Instead of using the map from atoms_info, we now receive uid information
in the form of StatsEvent annotations. The isUid annotation is exposed
from both LogEvent and FieldValue.
Test: bit statsd_test:*
Test: atest GtsStatsdHostTestCases
Bug: 150414601
Change-Id: Iebbe4ce5668de1ab91485daa1be9197cde6e8309
- Add AnnotationId enum stats-log-api-gen
- Rename RESET_STATE annotation to TRIGGER_STATE_RESET. Also rename the proto annotation.
Bug: 152412767
Test: stats-log-api-gen-test
Test: m statslog-framework-java-gen
Change-Id: I2c12ea0b9222ef28b8cc11ea36b272e518a96259
Group annotations for the same atom id inside one if-block in generated
code.
Use shared_ptr to store AtomDecls in multiple data structures.
Store a mapping of field numbers to atoms that have annotations at
corresponding field numbers in Collation.h
Bug: 151744250
Test: stats-log-api-gen-test
Test: m stats-log-api-gen
Test: m libstatsmetadata
Test: m statslog-framework-java-gen
Test: m libstatslog
Change-Id: I874696cfb5c27141017b4293bec809ab510ceb98
Mark privacy-sensitive atoms with truncate_timestamp annotation.
Factor out annotation collation to a helper method.
Add truncate_timestamp annotation support in stats-log-api-gen.
Add writeAnnotation* calls in Java and native generated code for
atom id annotations.
TODO: remove kTruncatingTimestampAtoms from atoms_info.
TODO: use truncate_timestamp annotation inside statsd.
Bug: 151111680
Test: stats-log-api-gen-test
Test: m statslog-framework-java-gen
Test: m libstatsmetadata
Change-Id: I3db5f4ffbf959bd36c62f890cc88606912798d40
Autogenerate annotations for atoms logged in java.
generated FrameworkStatsLog.java:
https://paste.googleplex.com/4789132691767296
Bug: 151102209
Test: m stats-log-api-gen
Test: m statslog-framework-java-gen
Change-Id: I50b01feaacfcb8ad5d0236432ceb0e97c8c907ab
- Only collate atoms in the specified module.
- Replace signature_to_modules with signatureInfoMap. This maps each
signature to another map keyed by field number and whose values are vector of
annotations.
Bug: 151102006
Test: stats-log-api-gen-test
Change-Id: I25bbe4883c8f7f86a06d04d27cd425367b6d65a0
Instead of relying on the constants in libstatslog, hardcode them in
atoms_info to get rid of the dependency on libstatslog
New generated atoms_info.cpp:
https://paste.googleplex.com/5779947622760448
Bug: 150417465
Test: m libstatsmetadata
Change-Id: I954c963f1883f889053b63d308c648548de71e56
Repeated fields arent allowed outside of attribution node and key value
pairs, so we should fail to build if someone attempts to add one.
Bug: 149956370
Test: atest stats-log-api-gen-test
Change-Id: I0caa6fcf74dabe8e962360ecccfd3a87fcaa4909
Merged-In: I0caa6fcf74dabe8e962360ecccfd3a87fcaa4909
Also make private versions of the libraries available to link statically
for tests. We should try to figure out a better long term solution.
Test: m
Test: bit statsd_test:*
Test: atest LibStatsPullTests
Test: bit libstatssocket_test:*
Test: atest GtsStatsdHostTestCases
Bug: 149340100
Change-Id: I05b91efab2a657aec75d436575aff4373f86ed3f
There was an extra level of lists caused by
FrameworkStatsLog.java. This fixes that.
Test: statsd_testdrive 83
Change-Id: I2afe6c739c786f886210f658c8ae8840774f8092
This switches stats-log-api-gen to use StatsEvent.java and
stats_event.c/StatsLogCompat.cpp in generated StatsLog write methods.
Bug: 143979391
Test: m
Test: fastboot flashall
Test: atest CtsStatsdHostTestCases
Change-Id: I56f58d5545e51a0d7a34ec835110f5bc1b069d57
As part of getting rid of StatsLogInternal and moving every atom to be
logged from a module, this CL addresses 2 issues:
1. Add WorkSource logging to modules.
2. Gate WorkSource logging via a CLI flag to prevent WorkSource methods
from being included in modules that are Mainline modules and can't have
@hide calls.
Bug: 147541828
Test: m
Test: atest android.cts.statsd.atom.UidAtomTests
Change-Id: Icce2f6ed7298be5e5ceebfb05d87e6fa7cd6bdbb
Merged-In: Icce2f6ed7298be5e5ceebfb05d87e6fa7cd6bdbb
API Review requested to remove unneeded allocations so pass null for
arguments that are empty when writing KeyValuePairs
Bug: 146383532
Test: m
Change-Id: Ic1788f65e8c7f837d6800d59c186519a82882bf7
Merged-In: Ic1788f65e8c7f837d6800d59c186519a82882bf7
(cherry picked from commit 996afa633c)
Don't use Build.VERSION.CODENAME to check for R.
Use Build.VERSION.SDK_INT > Q || (Build.VERSION.SDK_INT == Q &&
Build.VERSION.PREVIEW_SDK_INT > 0)
Bug: 146235828
Test: m DocumentsUIGoogle
Change-Id: I59e327d4e92d41a93b6bea145b8497fd4f85108c
Merged-In: I59e327d4e92d41a93b6bea145b8497fd4f85108c
(cherry picked from commit b6f32d9fe2)
As part of getting rid of StatsLogInternal and moving every atom to be
logged from a module, this CL addresses 2 issues:
1. Add WorkSource logging to modules.
2. Gate WorkSource logging via a CLI flag to prevent WorkSource methods
from being included in modules that are Mainline modules and can't have
@hide calls.
Bug: 147541828
Test: m
Test: atest android.cts.statsd.atom.UidAtomTests
Change-Id: Icce2f6ed7298be5e5ceebfb05d87e6fa7cd6bdbb