Commit Graph

5746 Commits

Author SHA1 Message Date
TreeHugger Robot
c9cf67bcc5 Merge changes from topic "tej-uid" into rvc-dev am: 0ac1c345a4 am: d4b44af54d am: 49e4d9ce2a am: 65954f6ba9
Change-Id: I2ed3a98ef22556cbd823ac79d7bcb304553d5712
2020-03-28 05:27:57 +00:00
TreeHugger Robot
f2f1314906 Merge "Add atom of TvSettings to Westworld and its enum" 2020-03-28 05:01:24 +00:00
TreeHugger Robot
49e4d9ce2a Merge changes from topic "tej-uid" into rvc-dev am: 0ac1c345a4 am: d4b44af54d
Change-Id: I75321a8cf5ad8409dc98385a8e249924fd54babc
2020-03-28 04:57:26 +00:00
Tej Singh
f4e17e6639 LibstatsPullTest, Testdrive updates for sandboxing
Test: atest LibStatsPullTests
Test: statsd_testdrive 10051 10004 10055
Test: adb shell cmd stats pull-source 10051 AID_STATSD
Test: adb shell cmd stats pull-source 10055 AID_GPU_SERVICE
Test: adb shell cmd stats pull-source 10004
Bug: 151642352
Change-Id: I3b104cb2f2427b4558d5175dfeb3bb2c80012d0e
2020-03-27 19:02:10 -07:00
Chen Chen
0d532ce78c Merge "Bluetooth Metrics: Add metric_id field for Bluetooth metrics to proto. The incremental id is neither a device id nor a pseudo name and therefore PII free." into rvc-dev am: 0941d63aee am: 458070932b am: aa4190a42c am: 41913b653a
Change-Id: I1b0c73878a91a20cd33dfbc99e6eecf32319939e
2020-03-28 01:31:07 +00:00
Chen Chen
aa4190a42c Merge "Bluetooth Metrics: Add metric_id field for Bluetooth metrics to proto. The incremental id is neither a device id nor a pseudo name and therefore PII free." into rvc-dev am: 0941d63aee am: 458070932b
Change-Id: I8fb736f3d636c7ccc981b720b5ccb9708bc09abf
2020-03-28 01:08:07 +00:00
Tej Singh
3be093b518 Uid Sandboxing of Pullers
Overall flow of implementation:
1. parsing the config in MetricsManager to store the uids per atom. It
follows the mAllowedLogSources logic very closely
2. MetricsManager register itself as a PullUidProvider with the
PullerManager.
3. Metrics pass the config key when pulling (for both registering
receivers and normal pulls) , and the puller manager gets
the allowed uids from the PullUidProvider for that config.
4. PullerManager keys receivers by <atomId, configKey> so that it can
look up the uids for that atom using the PullUidProvider as well.
5. Added shell subscriber support. Hardcode a default of AID_SYSTEM for
them and also allow packages per atom. This involved adding a second
interface to Pull that simply accepts the uids, since I didnt want to
make the ShellSubscriber a PullUidProvider as well.
6. Change adb shell cmd stats pull-source to allow users to specify a
package. Default to AID_SYSTEM as well.

Notes:
The feature is flagged off right now, since configs do not pass in the
desired package. Another approach could be to hardcode in the current
mapping, but that doesn't work for OEM pulled atoms.

Test: m statsd
Test: bit statsd_test:* with useUids = false
Test: bit statsd_test:* with useUids = true
Bug: 144099783
Bug: 151978258

Change-Id: I4a7481d7402a52b9beb4ea28b102803f9e50e79f
2020-03-27 18:07:24 -07:00
Chen Chen
0941d63aee Merge "Bluetooth Metrics: Add metric_id field for Bluetooth metrics to proto. The incremental id is neither a device id nor a pseudo name and therefore PII free." into rvc-dev 2020-03-28 00:54:26 +00:00
TreeHugger Robot
00cec87cff Merge "Fix atom id annotation parsing" into rvc-dev am: 4efa78539d am: 1c23c38939 am: d171e043c5 am: cceea4ac0b
Change-Id: I92131e8cd2365d0b478fb6b76bec104a1155dc85
2020-03-27 23:26:57 +00:00
Zhen Sun
a8b2beb5f2 Add atom of TvSettings to Westworld and its enum
The enums correspond to pages and entries of TvSettings. Some enums that
are related to unreleased features are not included in this CL but will
be added when this CL is cherrypicked into upstream non-public
TV-specific branches.

The atom definition is reviewed and approved by Metrics council.

Metrics council review bug: 151768952
Bug: 150979527
Test: the Android tree still builds normally

Change-Id: I4258312c19aa4f2f0cd178bc5b5dc53e52c6c737
2020-03-27 15:59:57 -07:00
TreeHugger Robot
d171e043c5 Merge "Fix atom id annotation parsing" into rvc-dev am: 4efa78539d am: 1c23c38939
Change-Id: I4786ddc81e3e3c48070334b00d43af3305538623
2020-03-27 22:44:32 +00:00
TreeHugger Robot
4efa78539d Merge "Fix atom id annotation parsing" into rvc-dev 2020-03-27 22:02:38 +00:00
Muhammad Qureshi
f2012da846 Fix atom id annotation parsing
Bug: 152633444
Test: m -j cts && m -j CtsStatsdHostTestCases && cts-tradefed run
cts-dev -m CtsStatsdHostTestCases -t
android.cts.statsd.atom.UidAtomTests#testAudioState
Test: bit statsd_test:*

Change-Id: I167012330e431b38b86f190ca6b5d4f90995172f
2020-03-27 12:38:00 -07:00
Maryam Karimzadehgan
d890b208d8 Proto changes and binary for adding more logs to the Back am: 4f9ab82c08 am: 4f8c046291 am: 31aaad4a7e am: bb3f1c2a1f
Change-Id: I454f27f121f6e519f5673eb43d1e80a9998f4c8e
2020-03-26 18:05:36 +00:00
Christine Tsai
8124172fa2 Merge "Update unit tests to use new socket schema" into rvc-dev am: 0810d57f95 am: 67faaa9229 am: b567ffe4b2 am: bc46e5cff2
Change-Id: I8d96a95e13a257127c5767c7e247cd1c7054e90b
2020-03-26 18:04:34 +00:00
Maryam Karimzadehgan
31aaad4a7e Proto changes and binary for adding more logs to the Back am: 4f9ab82c08 am: 4f8c046291
Change-Id: I04e237b8a4ce958d890d281c7c426519a9be27b5
2020-03-26 17:14:35 +00:00
Christine Tsai
b567ffe4b2 Merge "Update unit tests to use new socket schema" into rvc-dev am: 0810d57f95 am: 67faaa9229
Change-Id: I18689cc6b5eb540d7599597b1f9982e2344ba67a
2020-03-26 17:14:13 +00:00
Maryam Karimzadehgan
4f9ab82c08 Proto changes and binary for adding more logs to the Back
Gesture. Design document:
go/logging-back-gesture.

Test: manual
Bug: 148104018
Change-Id: I63b745f30b7581306150d2d7ab1fe3cccfe5147f
2020-03-26 17:01:22 +00:00
Christine Tsai
0810d57f95 Merge "Update unit tests to use new socket schema" into rvc-dev 2020-03-26 16:42:44 +00:00
TreeHugger Robot
f8fe2a7995 Merge "Expand "extras" support in content tool." into rvc-dev am: cfeb0d8323 am: 8afffa8dcc am: cc4632a963 am: 3a257dd350
Change-Id: I765429d96c8e4386e0debe2c6dddeaaf4633105e
2020-03-26 07:32:00 +00:00
TreeHugger Robot
cc4632a963 Merge "Expand "extras" support in content tool." into rvc-dev am: cfeb0d8323 am: 8afffa8dcc
Change-Id: Ia33e90c5718c7d5dad006e6feca8bc47ec580cc6
2020-03-26 06:57:27 +00:00
TreeHugger Robot
cfeb0d8323 Merge "Expand "extras" support in content tool." into rvc-dev 2020-03-26 06:29:59 +00:00
Jeff Sharkey
547bf5487d Expand "extras" support in content tool.
We recently added a new "Bundle extras" argument to insert(),
update(), delete(), and query(), so we should ensure that developers
working from the shell can populate these extras.

Uses binding logic that was already used for call() extras.  Fixes
parsing logic to support keys or values that have escaped colons,
and fix bug to always parse as requested data type.

Bug: 150982673
Test: adb shell content query
    --uri content://media/external/images/media/
    --extra android\\\\:query-arg-match-trashed:i:3
Change-Id: I40a9a94e85e175e298b01688d3b075a89b2e3954
2020-03-25 18:35:10 -06:00
Jeffrey Huang
d69695c055 Merge changes I7127dd7d,I84da0cd9 into rvc-dev am: 1bd7fe106a am: 1692eca8b8 am: ffe5ca6455 am: 3c9466e751 am: afb8d6fd43
Change-Id: I347d95c1e085819a5fa70e889f83917cb1f1f445
2020-03-25 23:36:23 +00:00
tsaichristine
d5800b208e Update unit tests to use new socket schema
I forgot to update Gauge and EventMetricProducer unit test files to use
the new socket schema.

The EventMetric tests were also incomplete so I added test code to
output the dump report and check its contents.

Test: bit statsd_test:*
Bug: 149590301 && 110561136

Change-Id: I685688285d9890cf7c5bd3ffc43f13cbbb8f93de
2020-03-25 16:36:18 -07:00
Jeffrey Huang
afb8d6fd43 Merge changes I7127dd7d,I84da0cd9 into rvc-dev am: 1bd7fe106a am: 1692eca8b8 am: ffe5ca6455 am: 3c9466e751
Change-Id: Ib2cae3b311a6b8a2851f4ac729eab6b4d3b8137e
2020-03-25 23:14:54 +00:00
Jeffrey Huang
9779899ccf Merge changes I7127dd7d,I84da0cd9 into rvc-dev am: 1bd7fe106a am: 716b3149f7
Change-Id: Ic36dfbb08718a07f8f40ed57dd25b66b396d9283
2020-03-25 22:43:41 +00:00
Jeffrey Huang
716b3149f7 Merge changes I7127dd7d,I84da0cd9 into rvc-dev am: 1bd7fe106a
Change-Id: Ia1959d487784f0e30de71e77e8ee4a7a80010db0
2020-03-25 22:34:43 +00:00
Jeffrey Huang
1bd7fe106a Merge changes I7127dd7d,I84da0cd9 into rvc-dev
* changes:
  Add mAlertToAnomalyTrackerMap to MetricsManager
  Add StatsMetadataList proto
2020-03-25 22:31:02 +00:00
Raff Tsai
f55de01d04 Merge "Add SettingSnapshot atom" into rvc-dev am: 9a54e23d8e am: 4244a87d19 am: 67fcec9c29 am: 3b375bf472
Change-Id: Iecd146600359748aced76104a69f06bd3250dd5d
2020-03-25 21:16:01 +00:00
Raff Tsai
67fcec9c29 Merge "Add SettingSnapshot atom" into rvc-dev am: 9a54e23d8e am: 4244a87d19
Change-Id: I5200e3e6d63d754c3c9573bea03cba4420927669
2020-03-25 20:52:13 +00:00
Raff Tsai
4244a87d19 Merge "Add SettingSnapshot atom" into rvc-dev am: 9a54e23d8e
Change-Id: I1aa30249ae99c6c27af1679927845ef12fec80dc
2020-03-25 20:45:38 +00:00
Raff Tsai
9a54e23d8e Merge "Add SettingSnapshot atom" into rvc-dev 2020-03-25 20:42:07 +00:00
Muhammad Qureshi
5bf6251d1b Merge changes Iad76baea,I3db5f4ff into rvc-dev am: 6fe5fd6e2e am: e440df36bb am: 6604c0361c am: a5b148b95f
Change-Id: I0613879248c753dd1af216ed6b9d605dfc3da29d
2020-03-25 18:20:20 +00:00
TreeHugger Robot
f1512705a9 Merge "Fix ValueMetricProducer_test on hwasan" into rvc-dev am: 8910bf95c6 am: 2783274cbe am: 1beaab1399 am: b5cd565796
Change-Id: I1d8a15348951d862a5fa00f56dcd8281a2ad92a0
2020-03-25 18:19:37 +00:00
Muhammad Qureshi
6604c0361c Merge changes Iad76baea,I3db5f4ff into rvc-dev am: 6fe5fd6e2e am: e440df36bb
Change-Id: I0df36e8f3ac037134fa5eee02655680add0258a6
2020-03-25 17:48:18 +00:00
Christine Tsai
ad6b4c25d2 Merge "Update the cc_benchmark to use the new socket schema" into rvc-dev am: be88f7df21 am: 819aa0f9f0 am: 7563df3f4d am: e3b0037e92
Change-Id: Iedcc20a48b8be159539492b276f3e709da903360
2020-03-25 17:41:00 +00:00
Muhammad Qureshi
e440df36bb Merge changes Iad76baea,I3db5f4ff into rvc-dev am: 6fe5fd6e2e
Change-Id: Ibd751ce32cc1ed3bec08712bf019af81fc595985
2020-03-25 17:40:28 +00:00
TreeHugger Robot
1beaab1399 Merge "Fix ValueMetricProducer_test on hwasan" into rvc-dev am: 8910bf95c6 am: 2783274cbe
Change-Id: I286adeca0c258a8e6557a4125e15a903d3c1c5db
2020-03-25 17:40:02 +00:00
TreeHugger Robot
2783274cbe Merge "Fix ValueMetricProducer_test on hwasan" into rvc-dev am: 8910bf95c6
Change-Id: Ic47b08af8e5db157372684542050a0d83a60812a
2020-03-25 17:38:39 +00:00
Muhammad Qureshi
6fe5fd6e2e Merge changes Iad76baea,I3db5f4ff into rvc-dev
* changes:
  Run clang-format in stats_log_api_gen
  Add truncate_timestamp annotation
2020-03-25 17:38:05 +00:00
TreeHugger Robot
8910bf95c6 Merge "Fix ValueMetricProducer_test on hwasan" into rvc-dev 2020-03-25 17:32:55 +00:00
Christine Tsai
7563df3f4d Merge "Update the cc_benchmark to use the new socket schema" into rvc-dev am: be88f7df21 am: 819aa0f9f0
Change-Id: I1bc44318bbf2ad11a29d1964b91ab1de01650667
2020-03-25 16:49:28 +00:00
Christine Tsai
819aa0f9f0 Merge "Update the cc_benchmark to use the new socket schema" into rvc-dev am: be88f7df21
Change-Id: I72ee6099c39454d5cc601fa337249aad4ba2972f
2020-03-25 16:43:16 +00:00
Raff Tsai
ea4db183fe Add SettingSnapshot atom
Bug: 142941011
Test: m Settings
Change-Id: I135a8ee1c0f8527d539c3613425e7e4c082ec099
2020-03-25 17:08:26 +08:00
Tej Singh
547f46331c Fix ValueMetricProducer_test on hwasan
TestUseZeroDefaultBaseWithPullFailures was failing on hwasan builds
because the test had a reference to an Interval object that was
deleted. The test tried to get another Interval object and assign it to
the reference. However, what this really did is change the Interval
object that the reference referred to. Since that Interval object had
been deleted, hwasan failed the test.

This fixes the issue. Also clean up some usages of auto to make
the test more readable.

Test: bit statsd_test:* on blueline_hwasan
Bug: 152354576
Change-Id: I392740770715391c727d190b1ed8ba22cc01210f
2020-03-25 08:10:35 +00:00
Jeffrey Huang
38d702697d Add mAlertToAnomalyTrackerMap to MetricsManager
Bug: 148280505
Test: bit statsd_test:*
Change-Id: I7127dd7dac9f6c4f3d415534c339aaba28fa41f3
2020-03-24 17:22:32 -07:00
Muhammad Qureshi
9b995809fb Add truncate_timestamp annotation
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
2020-03-24 16:49:36 -07:00
tsaichristine
63143251fe Update the cc_benchmark to use the new socket schema
Also removed unused CreateEvent helper functions in metric_util.cpp

Test: bit statsd_benchmark:*
Bug: 149794614
Change-Id: I14bcc254c44773eb42f749305beadaaf23a19b2b
2020-03-24 16:03:48 -07:00
Christine Tsai
6094e98744 Merge "(Part 3) Use new socket schema with statsd tests" into rvc-dev am: 4aa7af0a8f am: 0b03be06a9 am: ab3c482b45 am: 5b940bbb60
Change-Id: I9d15f364bc84584788f194e8a8c4dd897f682f33
2020-03-24 21:28:24 +00:00