Commit Graph

7210 Commits

Author SHA1 Message Date
Jeffrey Huang
05e50cc991 Revert^2 "Delete atoms.proto from statsd"
e8552cd24a

Change-Id: I202a31ab654ca31ba9e5b73b23c5aa3d22a3e8b2
Merged-In: I81a8287ed5b055e7b6547794d01e7ac897f0f022
2020-11-24 22:47:44 +00:00
Jeffrey Huang
e8552cd24a Revert "Delete atoms.proto from statsd"
Revert "Add android bp to proto_logging"

Revert submission 1508746-delete_atoms

Reason for revert: Build Failure
Reverted Changes:
I184cf8bf8:Add android bp to proto_logging
I36ec354d2:Delete atoms.proto from statsd

Change-Id: Ifec6a57d66cbd9c37503ca47847c3ae492f3d343
2020-11-24 21:53:20 +00:00
Jeffrey Huang
5d230a2d49 Delete atoms.proto from statsd
Use the atoms.proto in proto_logging as the source of truth. Also
migrates statsd log api gen to use the new atoms.proto

Bug: 167962588
Test: m -j && m CtsStatsdAtomHostTestCases

Change-Id: I36ec354d273dceace5245d7634c68ac63dc5a8cd
Merged-In: I36ec354d273dceace5245d7634c68ac63dc5a8cd
2020-11-24 10:57:06 -08:00
Ryan Mitchell
8f2f4e14de Merge "Fix DominatorTree for locale and mcc/mnc config" 2020-11-15 21:41:24 +00:00
Ryan Mitchell
527ebbaa55 Fix DominatorTree for locale and mcc/mnc config
De-duping of configurations with locales was disabled previously since
there is not a good way to dedupe locales in a forwards compatible way
(change SHA: e38567480b).

In b/171892595, since every locale is a root in the dominator tree,
configs that do not specify locale qualifiers are dominated by the
default config and their values are checked for compatiblity with the
locale config values.

b/171892595 took a while to detect because, this is only an issue at
runtime when a resource has one config containing mnc/mcc without a
locale, one config containing a locale, and the values for the configs
differ. This is because mcc/mnc is the only qualifier with a greater
precedence than locale.

Make configurations with mcc/mnc and mcc unable to be dominated until
locale deduping is fixed.

Bug: 171892595
Bug: 62409213
Test: aapt2-tests
Change-Id: Ia0a5e5d7a1650d070f5f2fcaf9a8469a8c7dabe6
2020-11-11 17:02:57 +00:00
Steven Moreland
51f0cb67c1 libstatslog: disable on darwin
libbinder doesn't support mac.

Bug: 172023026
Test: N/A
Change-Id: Idc484994e7cf5125736ddd7f5c98165ee9f01e67
2020-11-05 16:12:03 +00:00
Mathew Inwood
2bbe471076 Clarify error message when signature in list.txt does not exist.
The previous error didn't really explain the problem from the users point
of view.

Test: modify hiddenapi-unsupported.txt and build
Change-Id: I6f551343db84b20b32a963dccddf10cd08ea2be7
2020-10-26 16:53:09 +00:00
Mathew Inwood
43db2533db Support adding custom tags to APIs.
Refactor the argument parsing code to support more flexible options.
Now, instead of:
  --unsupported-ignore-conflicts apis.txt

We do:
  --unsupported apis.txt --ignore-conflicts

And similarly for --packages. Flags now come in groups, starting with
one of ALL_FLAGS and continuing to the next such flag. Any of
--ignore-conflicts, --package or --tag X apply to the previous one of
ALL_FLAGS.

Also add the --tag flag used to tag APIs with a custom flag. This is
used to tag removed APIs as such.

Test: m -j out/soong/hiddenapi/hiddenapi-flags.csv
Bug: 171300342
Change-Id: I59e6c365c46282f4489d71e7acac2ae43e5907d2
2020-10-22 15:26:35 +01:00
Zoran Jovanovic
0f942f99ca OMS: Add config_signature policy handling
Alongside SIGNATURE and ACTOR_SIGNATURE policies, add CONFIG_SIGNATURE
policy to overlayable that overlay fulfills if it is signed with the
same certificate as the reference package whose package name is
declared in 'config-signature' tag of SystemConfig and is vetted by
OMS that it's a system pre-installed package.

BUG: 158726924
TEST: regular aapt2, idmap2, OMS tests

Merged-In: I645ee72271496008742886274be0d63a2985201b
Change-Id: I645ee72271496008742886274be0d63a2985201b
2020-10-14 14:52:46 -07:00
Treehugger Robot
e0f44eb6e7 Merge "Ignore resources from unknown types" 2020-09-17 17:52:13 +00:00
Treehugger Robot
bf6a120aaa Merge "Add ".webp" to default compress extensions" 2020-09-17 17:52:04 +00:00
Treehugger Robot
db0a92a881 Merge "Make configs differing only in density siblings" 2020-09-17 17:51:53 +00:00
Ryan Mitchell
701a7fe39d Ignore resources from unknown types
When loading binary APKs into aapt2 for dumping purposes, aapt2 allows
the presence of custom resource types in the resources.arsc. Since
apapt2 may not be able to correctly interpret the data of custom types,
ignore resources from custom types completely when constructing the
ResourceTable data structure for the APK.

Bug: 168247188
Bug: 36051266
Test: run aapt2 dump bading/resources on APKs from both bugs
Merged-In: Ia3c0b4e07457eb8634b5a256ef77270e99b8bd72
Change-Id: Ia3c0b4e07457eb8634b5a256ef77270e99b8bd72
2020-09-17 08:20:09 -07:00
Ryan Mitchell
59cefc8403 Add ".webp" to default compress extensions
The .webp extension contains compressed image data so do not deflate
.webp files in APKs.

Bug: 166137617
Test: aapt2 link
Merged-In: I70181437e0b51122c7aa5047bd0a0791ac3b8df6
Change-Id: I70181437e0b51122c7aa5047bd0a0791ac3b8df6
2020-09-17 08:19:49 -07:00
Ryan Mitchell
0a0bf36555 Make configs differing only in density siblings
Configurations differing only in density value will match the same
device configuration at runtime; therefore, they should be considered
sibling configurations in the dominator tree.

So, given configurations A and B:
1) If A has a density defined and B does not, A must never dominate B.
2) If A and B both have densities defined, neither must dominate the
   other.

Previous behavior:
<default>
  sw600dp-v13
    sw600dp-hdpi-v13
       sw800dp-hdpi-v13
    sw800dp-xxhdpi-v13

New behavior:
<default>
  sw600dp-v13
    sw600dp-hdpi-v13
      sw800dp-hdpi-v13
      sw800dp-xxhdpi-v13

Bug: 167944889
Test: aapt2_tests
Merged-In: Ie9fba4c4b74af2b3bbf8fc6432539a99f8647634
Change-Id: Ie9fba4c4b74af2b3bbf8fc6432539a99f8647634
2020-09-17 08:18:27 -07:00
Treehugger Robot
27e25ee89e Merge "Move PropertyMap from libutils to libinput" am: bf37f0d136
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1419037

Change-Id: I79f94c2c458d3314246cbe0980b28acac4d97cb4
2020-09-08 16:17:05 +00:00
Siarhei Vishniakou
13257dd7ed Move PropertyMap from libutils to libinput
Since PropertyMap has moved, update the #include directives.

Bug: 163171599
Test: make only
Change-Id: Ia12463cf80e4d47e0dcaf81104635b2717d28748
2020-09-02 20:15:40 -07:00
Xin Li
628590d7ec Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
2020-08-31 21:21:38 -07:00
Treehugger Robot
cde7692843 Merge "profman: inclusive language updates" 2020-08-20 13:25:01 +00:00
Orion Hodson
7cebdeeb53 profman: inclusive language updates
Based on:
  https://source.android.com/setup/contribute/respectful-code

Bug: 161336379
Bug: 161896447
Test: m
Change-Id: Iaf7db2f76d8979f1ccc06c7e9e705b69c1f8069d
2020-08-17 15:35:31 +01:00
Andrei Onea
5074e60452 Drop deprecated API lists from csv merge script
Only support the new API list names.

Bug: 162500436
Test: build and check hiddenapi-flags.csv
Change-Id: I5e3c2f8d14524d59dd65d26ce5196efcc15d6d8e
2020-08-07 19:06:41 +01:00
Aleksei Kalinov
c57b3c2b13 Update language to comply with Android's inclusive language guidance
The binary uses flags to mean both command-line parameter names
and the API names, used in files and internally in the class.

Internal representation and command-line parameter names are updated to
use more inclusive language. However, the output file produced by
`generate_csv` function still uses old flags. Format update in
the input/output files is out of scope for this change
and will be updated in the follow-up changelist.

See https://source.android.com/setup/contribute/respectful-code for
reference.

Bug: 161896447

Test: python3 generate_hiddenapi_lists_test.py

Change-Id: I36c85ce04b89ba3e4eee319f95511110d2c4374e
2020-07-30 08:29:33 +00:00
Makoto Onuki
eab9e7f801 Don't add API annotations in the internal R.java
I'm trying to enable a check for the following structure:
```
/** @hide */
public class Class1 {
    /** @hide */
    @SystemApi // Invalid because the class is hidden.
    public void method1() { }
}
```

The internal R.java file violates this, which this change is going to fix.

Bug: 159162473
Test: build (treehugger)
Test: atest aapt2_tests

Merged-in: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9
Change-Id: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9
2020-06-23 09:35:36 -07:00
TreeHugger Robot
7c72b7f45e Merge "Don't add API annotations in the internal R.java" into rvc-dev-plus-aosp 2020-06-23 16:27:59 +00:00
Muhammad Qureshi
ff0d53f089 Merge "Remove libstatsmetadata" into rvc-dev am: 271cbbd708
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11923902

Change-Id: Ief9909dfe6c21bb62e891677d3e08612241c56c3
2020-06-23 01:28:47 +00:00
Makoto Onuki
de6e6f2098 Don't add API annotations in the internal R.java
I'm trying to enable a check for the following structure:
```
/** @hide */
public class Class1 {
    /** @hide */
    @SystemApi // Invalid because the class is hidden.
    public void method1() { }
}
```

The internal R.java file violates this, which this change is going to fix.

Bug: 159162473
Test: build (treehugger)
Test: atest aapt2_tests

Change-Id: I613e8611ddaf5f8e4761d351d4cd0142d59c7cc9
2020-06-22 16:33:53 -07:00
Muhammad Qureshi
741d31898a Remove libstatsmetadata
Remove kWhitelistedAtoms usage in MetricsManager and remove:
- atoms_info references from statsd
- libstatsmetadata usages from statsd
- libstatsmetadata library
- atoms_info_writer.h/.cpp
- references to atoms_info in rest of stats-log-api-gen
- allow_from_any_uid annotation

Fixes: 147600720
Fixes: 154856835
Fixes: 148993016

Test: m stats-log-api-gen
Test: m stats-log-api-gen-test &&
out/host/linux-x86/nativetest/stats-log-api-gen-test/stats-log-api-gen-test
Test: m statsd

Change-Id: I2e0579609ff257da934b95cdda397f3ca0ffa1f0
2020-06-18 18:59:12 -07:00
Ryan Mitchell
1b4cda227a Merge "Add policies and enforce overlayable to header" into rvc-dev am: 2201f8b626
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11481145

Change-Id: I71ff9f46e1e5a5016291a062dd5389078527588f
2020-06-05 16:11:20 +00:00
Ryan Mitchell
a707013b78 Add policies and enforce overlayable to header
If the fulfilled policies change without the contents of the target
and overlay APKs changing, the idmap for the overlay should be
regenerated. This change adds fulfilled policies and enforce
overlayable to the idmap header so that idmap2d can determine if the
polices or enforce overlayable changed from what was used to generate
the idmap.

Bug: 119328308
Test: idmap2_tests
Test: atest RegenerateIdmapTest

Change-Id: I96f970e82b5243be01b205ac2cb6ab249c6100bc
2020-06-01 16:15:35 -07:00
Liz Kammer
5691fb68fd Merge "Do not rename R.java package" 2020-05-21 20:04:38 +00:00
Ryan Mitchell
ad19790515 Do not rename R.java package
Cherry picks the rest of Id9d10e16f32533da1b67ab72ac846791526e7a76.

When the --rename-resources-package flag is used, only rename the
package name within the resources.arsc. Generate the R.java under
the package name defined by the manifest unless --custom-package is
used.

Test: manual
Bug: 147434671
Merged-In: Iab30ff9d3d136fa1e5464913f8d493df22c5c1c4
Change-Id: I896b8c69793cff714a950081fd8521e4acf0cf25
2020-05-21 12:06:25 -07:00
satayev
dc3191e9bd Merge "Add support for greylist-max-r signatures." am: dbf501e0eb am: 06a93cbca2
Change-Id: Icd1c8858eba2eace7d7bfeccc6fb5dff80e8b6d6
2020-05-21 14:28:45 +00:00
Artur Satayev
54c2d606b3 Add support for greylist-max-r signatures.
Bug: 156307884
Test: m
Change-Id: I66f8e48817d16bad5b306b91323bf0cdf42dbabe
2020-05-20 17:50:24 +01:00
Ryan Mitchell
9ed5638125 Do not rename R.java package
When the --rename-resources-package flag is used, only rename the
package name within the resources.arsc. Generate the R.java under
the package name defined by the manifest unless --custom-package is
used.

(This is a cherry pick.)

Bug: 147434671
Test: manual
Merged-In: Id9d10e16f32533da1b67ab72ac846791526e7a76
Change-Id: Id9d10e16f32533da1b67ab72ac846791526e7a76
2020-05-13 09:04:14 -07:00
TreeHugger Robot
4dca85b87f Merge "Add OWNERS for display, haptics, input and power" into rvc-dev am: f30c225fcb
Change-Id: Id6ab3fe424d9914f1ec54c0f9a4684578ed89c0b
2020-05-12 20:28:17 +00:00
Michael Wright
2e7e81c950 Add OWNERS for display, haptics, input and power
Bug: 156349083
Test: N/A
Change-Id: Ia8afccfc2e470095ae3d52c827c0ac78b7c120ae
2020-05-12 19:11:13 +01:00
Ryan Mitchell
98b076b85d Merge "Do not rename R.java package" into rvc-dev am: 5c8dd641ba
Change-Id: I4a15555cf1df7c81a4d4eea2c77ec0d71df5c44f
2020-05-08 17:46:11 +00:00
Ryan Mitchell
5c8dd641ba Merge "Do not rename R.java package" into rvc-dev 2020-05-08 17:37:46 +00:00
Ruchir Rastogi
79e5389451 Merge "Use proper platform version checks (apigen)" into rvc-dev am: 0bb978de88
Change-Id: I43bc52a7deeb8889cdd9c5e5b560a261215d0244
2020-05-08 16:03:26 +00:00
Ryan Mitchell
940ae50498 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.

(This is a cherry pick.)

Bug: 147434671
Test: manual
Merged-In: I435ba07e29df0522c3a44cc5f2c460004a02d71c
Change-Id: I435ba07e29df0522c3a44cc5f2c460004a02d71c
2020-05-07 17:03:12 -07:00
Ruchir Rastogi
c480dd54ba Use proper platform version checks (apigen)
Test: m statslog-docsui-java-gen
Bug: 146235828
Change-Id: I5b1a2e0fa356368b91548bd050ec2c493b72f37c
2020-05-07 12:32:54 -07:00
Ryan Mitchell
2b7e847ac9 Do not rename R.java package
When the --rename-resources-package flag is used, only rename the
package name within the resources.arsc. Generate the R.java under
the package name defined by the manifest unless --custom-package is
used.

Bug: 147434671
Test: manual
Change-Id: Id9d10e16f32533da1b67ab72ac846791526e7a76
2020-05-06 11:26:48 -07:00
Svet Ganov
38cd221d81 Updating platform SDK version for R
* Finalize resources
  * Update appt/aapt2 constants
  * Update R and SDK constants
  * Fix a crashloop bug

Test: build + boot

bug:150281259

Change-Id: Ie56e12336cd1fcf347ac7164f6988b0c2da77c7d
Merged-In: Ie56e12336cd1fcf347ac7164f6988b0c2da77c7d
2020-05-03 09:58:54 -07:00
Svet Ganov
87ccbfaa46 Updating platform SDK version for R
* Finalize resources
  * Update appt/aapt2 constants
  * Update R and SDK constants
  * Fix a crashloop bug

Test: build + boot

bug:150281259

Exempt-From-Owner-Approval: merge conflict resolution

Change-Id: Ie56e12336cd1fcf347ac7164f6988b0c2da77c7d
Merged-In: Ie56e12336cd1fcf347ac7164f6988b0c2da77c7d
2020-05-02 14:26:57 -07:00
Ryan Mitchell
0e360fad3b Merge "Treat non-integer target SDK as version 10000" into rvc-dev am: 7adb6a1c58
Change-Id: I67f066baf0b850817fda00c68a21ace85f6bfb3d
2020-04-30 20:29:11 +00:00
Ryan Mitchell
7adb6a1c58 Merge "Treat non-integer target SDK as version 10000" into rvc-dev 2020-04-30 20:19:49 +00:00
Ryan Mitchell
95f024289b Treat non-integer target SDK as version 10000
Currently aapt2 treats non-integer target SDK values as SDK level 0.
This resulted in incorrect implied permission dumps. This change
causes aapt2 to treat non-integer SDK values as version 10000.

Bug: 155391001
Test: aapt2 dump badging CtsSkQPTestCases.apk
Change-Id: Ie4312a827974a7a10b40b12f8f23d264d1b1999a
2020-04-30 10:31:14 -07:00
Treehugger Robot
9109c6303d Merge "Fix clang-analyzer-core.uninitialized.Branch warnings" am: 54ac3c6932 am: 996530f7c1
Change-Id: Ic0e0fe3c131c1f9960251204db36a42d2e92035e
2020-04-28 02:08:33 +00:00
Treehugger Robot
54ac3c6932 Merge "Fix clang-analyzer-core.uninitialized.Branch warnings" 2020-04-28 01:36:36 +00:00
Roshan Pius
29c974a624 aapt2: Add command to rename overlay "targetPackage" attribute
Bug: 154960712
Test: atest ManifestFixerTest
Change-Id: I556fc11e271337de40c70d4ed56a0381a2f79712
Merged-In: I556fc11e271337de40c70d4ed56a0381a2f79712
2020-04-28 00:30:04 +00:00