Commit Graph

7097 Commits

Author SHA1 Message Date
Muhammad Qureshi
f77913fbc6 Remove kBytesFieldAtoms from atoms_info
Bug: 150415347
Test: m
Test: bit statsd_test:*
Change-Id: I2e55b445121a39e3bf12164cd9123561e8b5bd4c
2020-03-20 10:55:46 -07:00
Muhammad Qureshi
29613e8ff8 Merge "StatsEvent annotations java autogen" into rvc-dev 2020-03-19 17:20:19 +00:00
Muhammad Qureshi
38bdeb5977 Merge "Write annotations in native generated code." into rvc-dev 2020-03-19 17:19:50 +00:00
Muhammad Qureshi
8a69088a36 Merge "Store annotation during collation" into rvc-dev 2020-03-19 17:19:27 +00:00
Jeffrey Huang
f960305a31 StatsEvent annotations java autogen
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
2020-03-17 22:01:58 -07:00
Muhammad Qureshi
a31a6229dd Write annotations in native generated code.
Generated statslog.cpp: https://paste.googleplex.com/6345695252447232

Bug: 151101995
Test: m stats-log-api-gen
Test: m libstatslog
Change-Id: I745a9beb7be07a1890f811256c51627e6c5976dc
2020-03-17 21:57:35 -07:00
Muhammad Qureshi
b13a3214a1 Store annotation during collation
- 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
2020-03-17 20:19:04 -07:00
Philip P. Moltmann
12ac3f406f Rename featureId -> attributionTag
In the core functionality this changes everything including aidl's and
field names:
- Context
- ContentProvider
- AppOps*
- Package parsing

For the rest, this is a shallow change to only change to the changed
APIs. This keeps the change small-ish

Exempt-From-Owner-Approval: Rename
Fixes: 148792795
Test: TH
Change-Id: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
Merged-In: I2a2245fe76e09e62cb13d5785d2efb4a304ba54a
2020-03-12 19:26:10 +00:00
Jeffrey Huang
74fc4354b5 Remove apex_available from libstatslog
Test: m -j
Bug: 149781190
Change-Id: I765852b1719a3056c06a0965ea6a05a8e8410693
2020-03-10 15:14:27 -07:00
Eugene Susla
8f562219c8 Merge "Generate @NonNull setter args and @MaySetToNull to opt out" into rvc-dev 2020-03-06 18:53:24 +00:00
Muhammad Qureshi
d7944d6573 Merge "Remove libstatslog from libstatsmetadata" into rvc-dev 2020-03-06 08:04:46 +00:00
Muhammad Qureshi
513453c253 Merge "Support multiple module annotations per atom" into rvc-dev 2020-03-06 08:04:09 +00:00
Muhammad Qureshi
9e0f728fe4 Remove libstatslog from libstatsmetadata
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
2020-03-05 17:20:58 -08:00
Eugene Susla
47ca5d035e Generate @NonNull setter args and @MaySetToNull to opt out
Bug: 143653080
Test: source /usr/local/google/home/eugenesusla/android2/master/frameworks/base/tests/Codegen/runTest.sh
Change-Id: Iba8da34c91fd09e266429ab131add1d53449506b
(cherry picked from commit ab14c55c1f)
2020-03-05 23:54:43 +00:00
Muhammad Qureshi
f8460f70d0 Support multiple module annotations per atom
Bug: 150864291
Test: m stats-log-api-gen-test &&
out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test

Change-Id: Ibf8869078c6f1eae13e687f0196d6ed91ec35c64
2020-03-05 14:52:05 -08:00
Muhammad Qureshi
4341dbb253 Merge "Delete unused code in stats-log-api-gen" into rvc-dev 2020-03-05 21:41:17 +00:00
Muhammad Qureshi
4ef3c3bd26 Delete unused code in stats-log-api-gen
Bug: 145100015
Test: m
Change-Id: Idbbe35fbce0d751a5973128406596678e1ead5d3
2020-03-05 10:21:36 -08:00
Tej Singh
c88fbf1e1c Fail if there are repeated fields in atoms.proto
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
2020-03-05 01:06:57 -08:00
TreeHugger Robot
36a845dee4 Merge "Make libstatssocket shared" into rvc-dev 2020-02-28 08:56:00 +00:00
Tej Singh
eb7d8f4675 Make libstatssocket shared
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
2020-02-27 11:38:41 -08:00
Winson Chiu
b0c5105b2d Merge changes from topic "actor-signature-policy-rvc-dev" into rvc-dev
* changes:
  Actor signature overlayable policy
  Refactor overlayable policy
2020-02-27 18:27:53 +00:00
Winson
f56ade365a Actor signature overlayable policy
There are cases where an app can ship overlays for itself,
but the "signature" policy as described would open up
a vulnerability by allowing the system actor to create
and sign any arbitrary overlay that will apply to the target.

To prevent this, redefine "signature" as target package only,
and introduce "actor" for checking against the actor signature.
Any app that wishes to use both can include both policies.

Bug: 130563563

Test: m aapt2_tests idmapt2_tests and run from host test output
Test: atest libandroidfw_tests

Change-Id: I1c583a5b37f4abbeb18fc6a35c502377d8977a41
2020-02-26 15:59:44 -08:00
Winson
62ac8b56a9 Refactor overlayable policy
To make it easier to add the actor policy in a follow up CL,
move most of the policy handling to a central location.

The strings and transformation between strings and flags is
now handled in libidmap2policies, with libandroidfw
containing the single source of policy flags.

This also extracts all the test resource IDs into an R.h
so they can be swapped without having to edit a dozen files
each time.

Bug: 130563563

Test: m aapt2_tests idmapt2_tests and run from host test output
Test: atest libandroidfw_tests

Change-Id: Ie533c9cebf938215df7586f00c38763ae467e606
2020-02-26 15:59:43 -08:00
Ryan Mitchell
60b74fb42f Add --rename-resources-package to aapt2
There is currently no way to change the package name encoded in the
resources table. This change adds a flag that controls rewriting the
package name encoded into the resources table. This flag does not
rewrite the package name in the manifest xml.

Bug: 147434671
Test: manual
Change-Id: I435ba07e29df0522c3a44cc5f2c460004a02d71c
2020-02-26 21:35:47 +00:00
Mike Ma
5510f7c8cd Add text dumpsys section to incidentd
Enable Incidentd to dump any existing dumpsys section in plain text
(as dumpsys.proto), only in eng or userdebug build. This is for a
few dumpsys services that are prohibitively expensive to migrate to
protobuf dumpsys or will undergo a major rewrite (thus render the
previously defined proto completely useless).

Bug: 149816498
Bug: 146085372
Bug: 146086519
Test: $ incident -p EXPLICIT 4000 4001
Change-Id: I0693d9bace0055cfeb63d7c8d48995d57dc0b733
(cherry picked from commit 95ba73f9c9)
2020-02-23 08:05:42 +00:00
Automerger Merge Worker
9e2d91be92 Merge "Use argparse in merge_csv.py." am: 28207235fd am: e2de05262c am: 7c68fe93f4
Change-Id: Id58ead9f089cd86617e00b07c26f272e914feddf
2020-02-20 20:34:40 +00:00
Artur Satayev
4ef7a1a594 Use argparse in merge_csv.py.
- Allow passing list of explicit fieldnames, instead of sorting header names.
- Allow passing a single zip file with all CSV files to merge.

Bug: 145132366
Test: diff -w out/soong/hiddenapi/hiddenapi-greylist.csv
Change-Id: I7c6db369069452293c15eec290c635fb3879275d
2020-02-19 16:33:10 +00:00
Tej Singh
d87589549f Turn off cpp aidlgen, link libstatssocket as share
Test: make
Change-Id: I052fa53544e47eff6d1d8f409b62569e3d59fd04
2020-02-18 18:32:56 -08:00
Jeffrey Huang
b41dacd813 Allow statsd to link against libstatslog
Bug: 145923087
Test: m -j
Change-Id: I44f8a24284b4ef8445ebb17edac72c33f72e1e39
2020-02-18 14:52:54 -08:00
Automerger Merge Worker
0b49886dca Merge "Fix clang-tidy performance-faster-string-find warnings" am: 57fb318ca3 am: 7c0f0d3cec am: 40ef6319ca
Change-Id: Id9d31a0c5cf41a0bb4a58326faa79511a1d8cc4a
2020-02-12 00:53:37 +00:00
Chih-Hung Hsieh
f2ef6579f2 Fix clang-tidy performance-faster-string-find warnings
Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: I7fd815aa401fbcaff97b772f3ba5d6f1d2034011
2020-02-11 14:27:11 -08:00
Patrick Baumann
9918123bac Adds queries->provider tag
This change adds support for the <provider> tag inside of the <queries>
tag to support more succinct declaration that an app would like to see
the provider of a given authority.

Test: atest AppEnumerationTests AppsFilterTest
Bug: 136675067
Change-Id: Ie0f73213fae7a3a0619238e44063d4e5be157201
2020-02-07 17:08:30 -08:00
TreeHugger Robot
d1c1a97b1b Merge "Turn on new socket protocol" 2020-02-06 05:38:36 +00:00
TreeHugger Robot
c2ac82cd01 Merge "Fix key value pairs logging on old schema" 2020-02-06 05:23:10 +00:00
TreeHugger Robot
43bb1463c8 Merge "Proto message for "dumpsys sensorservice --proto"" 2020-02-06 04:19:25 +00:00
Muhammad Qureshi
deebbd9382 Turn on new socket protocol
Bug: 148909969
Bug: 143979391
Test: m
Test: fastboot flashall
Test: atest android.cts.statsd.atom.UidAtomTests#testLmkKillOccurred
Test: atest LibStatsPullTests
Test: atest GtsStatsdHostTestCases
Change-Id: I40bf643ac9e10e5b8caeb1d1b1a161d768e3bb99
2020-02-05 17:17:46 -08:00
Tej Singh
2bead545e7 Fix key value pairs logging on old schema
There was an extra level of lists caused by
FrameworkStatsLog.java. This fixes that.

Test: statsd_testdrive 83
Change-Id: I2afe6c739c786f886210f658c8ae8840774f8092
2020-02-05 17:17:16 -08:00
Howard Ro
1f0c52287b Merge "Update libstatssocket/pull API council feedback" 2020-02-05 18:28:12 +00:00
Mike Ma
a47ad7266c Proto message for "dumpsys sensorservice --proto"
Add SensorServiceProto for protobuf dumpsys of sensorservice. Primarily
used by incident service to capture an incident report proto.
Also add a gensrc rule to generate cpp headers of frameworks proto to
be used by native services like sensorservice. Added "static" qualifier
to a few generated fields in the header to avoid linker conflict.

Command to invoke (any of the following after lunch and env setup):
$ adb shell dumpsys sensorservice --proto
$ adb shell incident 3053
$ incident_report 3053

Bug: 146086105
Test: Execute the above commands and compare the output against dumpsys
      sensorservice

Change-Id: I282ff37bd3e845464d0693d69fc0d82943cc9855
2020-02-05 10:10:47 -08:00
Howard Ro
6269383520 Turn back to the old socket schema
Bug: 148909969
Test: GTS tests pass after this change (they fail otherwise)
Change-Id: Iee8d6506c4fb2fbf3acef474f9ee13df1b764c41
2020-02-04 21:53:40 -08:00
Dianne Hackborn
f27a9578e5 Merge "Work on issue #143085640: Per-process network access control" 2020-02-04 17:30:52 +00:00
Howard Ro
2688fe61c4 Merge "Turn on new socket schema" 2020-02-04 05:09:57 +00:00
Tej Singh
b26d044a75 Update libstatssocket/pull API council feedback
ALso, removes KeyValuePairs support from libstatssocket

Test: make
Test: atest libstatssocket_test
Test: atest statsd_test
Test: atest LibStatsPullTests
Test: statsd_testdrive 10068
Change-Id: I3a5d0e66f00cea5897e0db33cb769bf6ea67f320
2020-02-03 18:01:31 -08:00
Christine Tsai
f7e56a64e2 Merge "Allow default state, reset state, and nesting for binary states" 2020-02-03 22:46:06 +00:00
Muhammad Qureshi
af77b79ab6 Turn on new socket schema
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
2020-02-03 02:22:48 +00:00
Dianne Hackborn
fc0839ae30 Work on issue #143085640: Per-process network access control
Fix some issues when apps start declaring processes, add validation
that apps don't use processes they haven't declared (if they
declared some).  Also add package dump output for the processes it
has declared.

Bug: 143085640
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
Change-Id: If1d13bf402d2b0aea06f0c2c02d5e392c774c812
2020-02-02 13:39:32 -08:00
Automerger Merge Worker
317b317ad7 Merge "Use py3 features in merge_csv.py." am: 3e6f701980 am: aad8e7b161 am: f427fac8f4
Change-Id: Iecf5c7690f8fd3156bd7dfddbe0934b58e387e3d
2020-01-31 16:32:23 +00:00
Automerger Merge Worker
338963acbe Merge "Generate compile-time Q-compatible StatsLog" am: d8a5039db0 am: f4eb2201ae am: 79e6c0d075
Change-Id: I21fed9646eeb8c936584490c252bc020bbe68107
2020-01-31 16:31:25 +00:00
Treehugger Robot
3e6f701980 Merge "Use py3 features in merge_csv.py." 2020-01-30 15:18:58 +00:00
Muhammad Qureshi
bb699b68c0 Generate compile-time Q-compatible StatsLog
Bug: 148388745
Test: m NetworkStack
Test: m NetworkStackNext
Change-Id: Ic37bb67ce625d0a583c424d4775e9f0fa132c418
2020-01-29 14:27:04 -08:00