Commit Graph

7089 Commits

Author SHA1 Message Date
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
Artur Satayev
9430c17a6c Use py3 features in merge_csv.py.
- Use csv.QUOTE_MINIMAL strategy to only quote fields with special characters.
- Open file as 'r', not 'rb'.
- Use 'unix' dialect for '\n' as line terminator, instead of \r\n.

Bug: 145132366
Test: diff -w out/soong/hiddenapi/hiddenapi-greylist.csv
Change-Id: I888f3219beee5b83e53f05589a90a05f93399fe3
2020-01-29 19:54:58 +00:00
Artur Satayev
192ca30b7a Remove unused UnsupportedAppUsage annotations.
The new annotation is android.compat.annotation.UnsupportedAppUsage.

Test: m
Bug: 145132366
Exempt-From-Owner-Approval: previously approved change
Change-Id: Ie12e28eee0ed20b5677ee3162143700813b7ab64
2020-01-29 18:19:45 +00:00
Muhammad Qureshi
b6b3995f17 Add KeyValuePairs support for modules.
Add KeyValuePairs support to StatsLog autogen for modules.

Bug: 147674597
Test: m
Test: fastboot flashall
Test: adb logcat "*:S statsd:*" and inspect KeyValuePair atoms.
Test: statsd_testdrive 83
Change-Id: Ie40ea52fde494ec11da6b73f430c7a112711b55b
2020-01-28 16:34:22 -08:00
Muhammad Qureshi
b11e00d655 Add flag to stats-log-api-gen for WorkSource.
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
2020-01-23 11:39:38 -08:00
Muhammad Qureshi
17c204de33 Make writeKeyValuePairs accept Nullable args
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)
2020-01-23 11:32:07 -08:00
Muhammad Qureshi
0c8cdf54db Use preview_sdk_int for version code checks
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)
2020-01-23 11:29:21 -08:00
Treehugger Robot
7b56a5075d Merge "Add option to avoid clobbering visibility of <declare-styleable>" 2020-01-17 18:21:24 +00:00
Muhammad Qureshi
ad94425b15 Add flag to stats-log-api-gen for WorkSource.
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
2020-01-17 08:36:52 -08:00