1128 Commits

Author SHA1 Message Date
Ryan Mitchell
22cf8d565e Merge "Add policies and enforce overlayable to header" into rvc-dev am: 2201f8b626 am: 64d0e6f31b am: e2426c48bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11481145

Change-Id: I268738c0312b6a158599d9487f09b753c91ba36a
2020-06-05 16:46:45 +00: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
Ryan Mitchell
22dc5310a4 Only move private attrs when building framework
When aapt was changed to move private attributes into a different type
(9b624c186cb6059dfb3ec24bfb6386a0fc17b88c), attributes only were moved
when building the framework. When this functionality was ported to
aapt2, all apps using the public tag would have their private
attributes moved. The change does not appear to be intentional and
thus is a parity issue.

This change only moves private attributes when building a package with
an id of 0x01.

Bug: 151683505
Test: manual
Change-Id: Ic9843f99e428f94cb6a55988a3881b8a91c7d7e2
2020-06-01 19:28:48 +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
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
Ryan Mitchell
d7465318e6 Merge "Do not rename R.java package" into rvc-dev am: 5c8dd641ba am: 98b076b85d am: 1da72bfb6c am: 9bb6fa9e89
Change-Id: I128110df8aa4c7f0d9abd144be3f4078e6d87ad6
2020-05-08 18:41:04 +00: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
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
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
Svet Ganov
ed460aa186 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
2020-05-01 15:25:27 -07:00
Ryan Mitchell
1e43cc068b Merge "Treat non-integer target SDK as version 10000" into rvc-dev am: 7adb6a1c58 am: 6792a33c0c am: 5ccbe1ef42 am: 0860bd59f3
Change-Id: I0c4bec68c9615b9e9516c4c432ebd24a2a6cea9e
2020-04-30 21:33:08 +00:00
Ryan Mitchell
5ccbe1ef42 Merge "Treat non-integer target SDK as version 10000" into rvc-dev am: 7adb6a1c58 am: 6792a33c0c
Change-Id: I3b4c79c0efaf68207157b6f6a8d095efb178feb1
2020-04-30 20:48:41 +00: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
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
Automerger Merge Worker
fafe29f8b2 Merge "Merge "aapt2: Add command to rename overlay "targetPackage" attribute" into rvc-dev am: 6839fc74b6 am: 5c47bceb5d" into rvc-d1-dev-plus-aosp am: 88786a6f61 am: b1b587c7fb
Change-Id: If200647b976a4d562f7bc2fcc0cc3b2b97c0d485
2020-04-27 23:14:46 +00:00
TreeHugger Robot
7e1ac80637 Merge "aapt2: Add command to rename overlay "targetPackage" attribute" into rvc-dev am: 6839fc74b6 am: 5c47bceb5d
Change-Id: Ie1752a33f28ff1cfa7f453b90815c552b9b14a39
2020-04-27 23:08:42 +00:00
TreeHugger Robot
136b08c06f Merge "aapt2: Add command to rename overlay "targetPackage" attribute" into rvc-dev am: 6839fc74b6
Change-Id: I3aa0d0ec7107cb20f026e03fc0bf3ad3805c0cba
2020-04-27 22:55:31 +00:00
Roshan Pius
ae12ce4119 aapt2: Add command to rename overlay "targetPackage" attribute
Bug: 154960712
Test: atest ManifestFixerTest
Change-Id: I556fc11e271337de40c70d4ed56a0381a2f79712
2020-04-27 21:49:23 +00:00
Clark DuVall
8f51d6b876 Reorder styleable attributes in shared libraries
This is a similar fix to
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/10109386
but deals with styleable attributes instead of style items.

Bug: 147674078
Test: JavaClassGeneratorTest.SortsDynamicAttributesAfterFrameworkAttributes
Change-Id: Ida6572cf07e2b5987e9d8941cf169a37c43578c4
2020-04-22 13:19:28 -07:00
TreeHugger Robot
661aa306ff Merge "Include the name of the resource in an error message." 2020-04-16 18:25:09 +00:00
Orion Hodson
d3e1ceb521 Merge "Add explicit dependencies on jni_headers" am: c0fe0ae29f am: 6963d8e1c8 am: 18f7afccb6 am: 98d4cf4125 am: ed92902c8b
Change-Id: I6269e5e702d4930c86042c1bb1d812853f17c355
2020-04-16 11:23:50 +00:00
Orion Hodson
18f7afccb6 Merge "Add explicit dependencies on jni_headers" am: c0fe0ae29f am: 6963d8e1c8
Change-Id: I2fdf3826653466d65e3d63fa896d1ec23c5716cd
2020-04-16 10:58:50 +00:00
Orion Hodson
63f06b738d Add explicit dependencies on jni_headers
Preparation for removing implicit include paths for jni.h from soong.

Also remove unnecessary jni.h includes from PathParser.{h,cpp}.

Bug: 152482542
Test: lunch aosp_x86_64 && m checkbuild
Change-Id: Ib18afa3d2c93ed3ce69204286d5177991100fd7e
Exempt-From-Owner-Approval: build refactoring
2020-04-16 08:26:14 +00:00
Donald Chai
ab7e0d5a51 Include the name of the resource in an error message.
Bug: 153393440
Tested: N/A
Change-Id: I6979c683978af2670b1823ff8380175673067630
2020-04-15 22:03:56 -07:00
TreeHugger Robot
b40aa702dc Merge "Master is now S" into rvc-dev-plus-aosp am: d88d0431dc am: 19b51e0838 am: 175083fba5
Change-Id: Iceb608472c526a4a19c5b3f0ef1901777f69fe60
2020-04-10 23:45:40 +00:00
Dan Willemsen
0985ac8982 Master is now S
Bug: 150754986
Test: treehugger
Change-Id: I44d1b5a0fea74e2bb9e332dcb8486fd30fbd2f07
Merged-In: I44d1b5a0fea74e2bb9e332dcb8486fd30fbd2f07
2020-04-10 05:18:32 +00:00
TreeHugger Robot
466934b9b0 Merge "Create aapt2_artifacts dist goal for aapt2" 2020-04-09 16:55:07 +00:00
Dan Willemsen
c7a1109a1f Master is now S
Bug: 150754986
Test: treehugger
Change-Id: I44d1b5a0fea74e2bb9e332dcb8486fd30fbd2f07
2020-04-08 15:46:40 -07:00
Ryan Mitchell
655b936e84 Create aapt2_artifacts dist goal for aapt2
Building aapt2_artifacts will output aapt2 and aapt2-protos.zip to
DIST_DIR. If BUILD_HOST_static is not specified, aapt2.exe will also
be built.

Bug: 147476179
Test: m -j dist DIST_DIR=~/dist_test aapt2_artifacts
Test: m -j dist DIST_DIR=~/dist_test BUILD_HOST_static=1 \
      aapt2_artifacts
Change-Id: I9a0ee769f8c6579f1e01c04e42c62ebe850ba401
2020-04-06 16:16:14 -07:00
Mohamed Heikal
537e4e8b85 Merge "Enable --collapse-resource-names on bundles" 2020-04-02 21:21:04 +00:00
Mohamed Heikal
e0388de6be Enable --collapse-resource-names on bundles
This cl enables aapt2 optimize and convert to handle collapsed resource
names optimization.

Test: make aapt2_test

Change-Id: I160d7e5bbd94580b52c00b648918e47beb4674f1
2020-03-31 14:58:01 -04:00
Narayan Kamath
ca96d07baf Merge "aapt2: Preserve annotation parameters for SystemApi." into rvc-dev am: 924069c2aa am: d7bc5846b6 am: 6edf7daeec am: 798ee20e2b am: 124e0a4f2a
Change-Id: I9a5cd8f4023299cf9430cf3389ed9b372b326ec2
2020-03-31 00:18:24 +00:00
Narayan Kamath
124e0a4f2a Merge "aapt2: Preserve annotation parameters for SystemApi." into rvc-dev am: 924069c2aa am: d7bc5846b6 am: 6edf7daeec am: 798ee20e2b
Change-Id: I6d95f80ba27bd4c028fc490fe14dacf136ee8a12
2020-03-30 18:15:43 +00:00
Narayan Kamath
45f8d1cf43 Merge "aapt2: Preserve annotation parameters for SystemApi." into rvc-dev am: 924069c2aa
Change-Id: Ieb278c96432a0a23d65752a2c89365b02ed936f4
2020-03-30 13:22:15 +00:00
Narayan Kamath
1c1544ff96 aapt2: Preserve annotation parameters for SystemApi.
SystemAPI can now be parameterized. Note that this change preserves
the content of the annotation params without attempting to interpret
them in any way. This means that references to types outside of
java.lang must be fully qualified.

Test: atest aapt2_tests
Bug: 147581540
Change-Id: I0630fb1c7c7a7f5918ff2dca32fb8e078b367751
2020-03-26 11:47:59 +00:00
TreeHugger Robot
76750266cd Merge "Fix aapt2 Maybe check" 2020-03-20 03:23:36 +00: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
Philip P. Moltmann
aea50fc06a 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 11:47:51 -07:00
Philip P. Moltmann
8a06c2870e 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
2020-03-11 23:52:32 +00:00
Automerger Merge Worker
578f3a9037 Merge "Suppress bugprone-use-after-move warnings" am: 100a6f64e5 am: a4f123ba5f
Change-Id: Iabb0a0570f64d39844758d4313d009b380aba356
2020-03-09 03:28:19 +00:00
Chih-Hung Hsieh
7a616f65d6 Suppress bugprone-use-after-move warnings
Bug: 150783499
Test: WITH_TIDY=1 make
Change-Id: Ifdd5d89d2207caba765e8f74e8a86f6b6b4ff609
2020-03-06 10:04:30 -08:00
Automerger Merge Worker
dc5de7b23b Merge "Generate "keep" rules for android:name and class attributes" am: a13d7fc861 am: 4da226a984
Change-Id: I4443b84896684ac3249108316487035319b4f52e
2020-03-06 00:56:33 +00:00
Jeremy Woods
4bdc698d9f Generate "keep" rules for android:name and class attributes
We should keep classes that are in the android:name or class xml
attributes.

Test: m -j aapt2_tests
Bug: 142601969
Change-Id: Ia67365bd702bae75d38b9572d68e9930e856e0f8
2020-03-05 13:06:26 -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