Commit graph

767 commits

Author SHA1 Message Date
Jiyong Park
b51e7ea3b8 Remove apex_available whitelist for the ART APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 150999716
Test: m
Merged-In: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
(cherry picked from commit be6e2b6a18)
Change-Id: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
2020-05-28 04:06:41 +00:00
Jiyong Park
69efc4625a Merge changes from topic "apex_available_art" into rvc-dev am: b7431abffe
Change-Id: Idb9f30b74687f2c5da9494db60ae6614a67c0c4b
2020-05-28 01:11:19 +00:00
Jiyong Park
885910e198 DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R." am: 8b39919030
Change-Id: If72ac03ec041b30dc2636ba5412c375ac1566ca4
2020-05-28 01:11:17 +00:00
Jiyong Park
b7431abffe Merge changes from topic "apex_available_art" into rvc-dev
* changes:
  Remove apex_available whitelist for the ART APEX
  DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R."
2020-05-28 00:49:45 +00:00
Artur Satayev
07d215215b Merge changes I4ab7e1a3,Ib525b2f5,I2d4c54fb into rvc-dev
* changes:
  Generate combined deps-info for all updatable modules.
  Remove ApexBundleDepsInfo.MinSdkVersion()
  Add "updatable" property to ApexModule interface.
2020-05-27 20:58:27 +00:00
Artur Satayev
2b4b7bbe82 Generate combined deps-info for all updatable modules.
Introduce a singleton apex rule to merge contents of individual
deps-info results into a single output file.

Bug: 149622332
Test: m
Change-Id: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Merged-In: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 849f844252)
2020-05-27 17:51:18 +01:00
Ulya Trafimovich
c0eb0b1ae5 Add "updatable" property to ApexModule interface.
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.

Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Merged-In: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 7c140d828a)
2020-05-27 17:50:51 +01:00
satayev
84ff6be8e9 Merge "Generate combined deps-info for all updatable modules." am: ede18549e5 am: 3a0a6427bd
Change-Id: I2ae338e9f883695260d922e6607c73770a4c8c04
2020-05-26 14:03:00 +00:00
satayev
ede18549e5 Merge "Generate combined deps-info for all updatable modules." 2020-05-26 13:28:28 +00:00
Jiyong Park
8b39919030 DO NOT MERGE: Revert "DO NOT MERGE: Remove AppSearch from Android R."
This reverts commit c9c7116721.

This revert is to avoid merge conflict when ag/11299431 is auto-merged
to master.

This change will again be reverted when ag/11299431 lands.

Bug: 150999716
Test: m

Change-Id: Ia0f7a0e0eb8cf6f6f4d0693de01777a8a750c769
2020-05-25 17:05:35 +09:00
Jiyong Park
be6e2b6a18 Remove apex_available whitelist for the ART APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: I2b792657b444f0c963e1e92b7c91f6a0cfe1688c
2020-05-25 17:05:35 +09:00
Jooyung Han
5ab5856db3 Merge "apex: Make android_library support APEX variants" 2020-05-21 12:02:39 +00:00
Jooyung Han
acc7bbebe4 apex: Make android_library support APEX variants
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.

Now, android_library supports AEPX variants.

Due to this change, the whilelist for apex_available got bigger.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
(cherry picked from commit bd133b1bdc)
2020-05-21 12:01:54 +00:00
Jooyung Han
a8625c5393 Merge "apex: Make android_library support APEX variants" into rvc-dev-plus-aosp 2020-05-21 06:17:29 +00:00
Jooyung Han
040ff3d5c1 apex: Make android_library support APEX variants
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.

Now, android_library supports AEPX variants.

Due to this change, the whilelist for apex_available got bigger.

Exempt-From-Owner-Approval: approved in rvc-dev

Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
2020-05-21 06:16:59 +00:00
Jooyung Han
ff4e78e876 Merge "apex: install hwasan lib if depended on libc" am: 166349beeb am: f7879cbfbd
Change-Id: I8c0ae40db7543d96f1511ded42cbd6b23b141796
2020-05-21 01:22:50 +00:00
Jooyung Han
166349beeb Merge "apex: install hwasan lib if depended on libc" 2020-05-21 00:48:26 +00:00
Jooyung Han
11c2093ea3 apex: Make android_library support APEX variants
The android_library module type can be used within an android_app that
can itself be added to an apex but android_library does not call
android.InitApexModule(module) and so it does not support apex variants
and so is treated as if it cannot be part of an APEX even though it
actually is.

Now, android_library supports AEPX variants.

Due to this change, the whilelist for apex_available got bigger.

Bug: 156978407
Test: m
Merged-In: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
Change-Id: I3a21d653fe9c4159e3a89791fe1a8597865eeae6
2020-05-20 21:49:30 +00:00
TreeHugger Robot
53754e3592 Merge "Remove apex_available whitelist for the extservices APEX" into rvc-dev 2020-05-17 15:17:58 +00:00
Jiyong Park
db4ce6e80a Remove apex_available whitelist for the extservices APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Merged-In: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
Change-Id: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
2020-05-17 21:23:08 +09:00
Jiyong Park
7d95a510cc Reland "Prevent statically linking to a lib providing stable C APIs"
This reverts commit 5b75774004.

Exempt-From-Owner-Approval: cherry-pick from internal

Bug: 151051671
Test: m
Merged-In: I05f0465976098941d47ecc06c978cfa116364d78
(cherry picked from commit af7ed39b06)
Change-Id: I05f0465976098941d47ecc06c978cfa116364d78
2020-05-17 20:47:27 +09:00
Paul Duffin
c91aafb699 Merge "Replace javaLibrary with java.Dependency,android.Module" into rvc-dev 2020-05-16 07:24:18 +00:00
Jiyong Park
af7ed39b06 Reland "Prevent statically linking to a lib providing stable C APIs"
This reverts commit 5b75774004.

Bug: 151051671
Test: m
Change-Id: I05f0465976098941d47ecc06c978cfa116364d78
2020-05-16 09:41:19 +09:00
Jaewoong Jung
8cf307e754 Add apex_set module.
apex_set takes an .apks file that contains a set of prebuilt apexes with
different configurations. It uses extract_apks to select and install the
best matching one for the current target.

Bug: 153456259
Test: apex_test.go
Test: com.android.media.apks
Change-Id: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
Merged-In: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
2020-05-16 00:37:36 +00:00
Jaewoong Jung
75b78df026 Merge "Add apex_set module." am: 805f2492e8 am: 23b4707ddc
Change-Id: I47e7a67ea8b2af27860531e67dd66c854b6bca70
2020-05-15 23:43:41 +00:00
Jaewoong Jung
805f2492e8 Merge "Add apex_set module." 2020-05-15 23:13:38 +00:00
Artur Satayev
849f844252 Generate combined deps-info for all updatable modules.
Introduce a singleton apex rule to merge contents of individual
deps-info results into a single output file.

Bug: 149622332
Test: m
Change-Id: I4ab7e1a3527fead97a81a5a2cb0e1e93a429117c
2020-05-15 19:10:19 +01:00
Jaewoong Jung
fa00c06187 Add apex_set module.
apex_set takes an .apks file that contains a set of prebuilt apexes with
different configurations. It uses extract_apks to select and install the
best matching one for the current target.

Bug: 153456259
Test: apex_test.go
Test: com.android.media.apks
Change-Id: I1da8bbcf1611b7c580a0cb225856cbd7029cc0a7
2020-05-15 11:02:01 -07:00
Paul Duffin
f299cbefcd Replace javaLibrary with java.Dependency,android.Module
Passes an additional android.Module parameter through to avoid having
to use javaLibrary interface.

Bug: 146586360
Test: m nothing
Merged-In: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
Change-Id: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
(cherry picked from commit 581bbbe8cb)
2020-05-15 17:07:02 +01:00
Treehugger Robot
ced4ae1496 Merge "Remove apex_available whitelist for the extservices APEX" am: 8cf3e5471d am: 8b4193d5bb
Change-Id: I0fda78f456e5634bfb67342bbe9706e09a167d0f
2020-05-15 15:21:07 +00:00
Treehugger Robot
8cf3e5471d Merge "Remove apex_available whitelist for the extservices APEX" 2020-05-15 14:46:43 +00:00
Treehugger Robot
c94b1728f1 Merge "Replace javaLibrary with java.Dependency,android.Module" am: 198c946c8a am: cf2a8b54a6
Change-Id: I505e846b647e2a29daeca376c1055e089c7c3001
2020-05-15 13:46:46 +00:00
Treehugger Robot
198c946c8a Merge "Replace javaLibrary with java.Dependency,android.Module" 2020-05-15 13:17:32 +00:00
Jooyung Han
8ce8db9ed6 apex: install hwasan lib if depended on libc
There're two ways to enable hwasan:
- global setting: TARGET_SANITIZE=hwaddress
- individual setting: sanitize: { hwaddress: true }

This change covers both cases by looking up if com.android.runtime is
hwaddress santized or not.

Bug: 156678661
Test: m (soong test added)
Change-Id: I67c382c3e76a06f4b27f221eebd153c698647227
2020-05-15 19:12:38 +09:00
Paul Duffin
581bbbe8cb Replace javaLibrary with java.Dependency,android.Module
Passes an additional android.Module parameter through to avoid having
to use javaLibrary interface.

Bug: 146586360
Test: m nothing
Change-Id: Ie533c16c753dc9c43171d0223953adea7b2b5ee6
2020-05-14 21:26:28 +01:00
Liz Kammer
8d501ef107 Merge "Add test data dependencies to APEX." am: 6109adaee0 am: 5b5cecd94e
Change-Id: I2589597f744dd62d0799f20d7de79dab4e8b07ae
2020-05-14 15:30:55 +00:00
Liz Kammer
6109adaee0 Merge "Add test data dependencies to APEX." 2020-05-14 15:06:49 +00:00
Jiyong Park
a8c03921f2 Remove apex_available whitelist for the extservices APEX
The marked library(ies) were available to the APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: I827d604c7e5a469a8b8a6d5a4b7917f2eaca48ca
2020-05-14 21:39:55 +09:00
Treehugger Robot
5a5194a485 Merge "Remove reference to libz_current." am: 6a53c65ebd am: 02d3e4e600
Change-Id: I616b77a4f1fae6370b30cbdffdd6ac6bc8d94ee6
2020-05-14 04:47:28 +00:00
Elliott Hughes
9912ee2f02 Remove reference to libz_current.
This no longer exists.

Bug: https://issuetracker.google.com/155351357
Test: treehugger
Change-Id: Ie38c971759acb0141cba6341f95c67effadd93a6
2020-05-13 14:20:12 -07:00
Liz Kammer
1c14a21994 Add test data dependencies to APEX.
Test: soong go tests

Bug: 155820504
Change-Id: If96d82c27f19953e34efb31f2111f1643c0c4008
2020-05-13 10:17:30 -07:00
Jiyong Park
cabc299091 Merge "Revert "Prevent statically linking to a lib providing stable C APIs"" am: 18bbde1615 am: a3c8a7d511
Change-Id: I7942cf827040f1683ffda90e1483e383ab33057a
2020-05-08 08:43:53 +00:00
Jiyong Park
18bbde1615 Merge "Revert "Prevent statically linking to a lib providing stable C APIs"" 2020-05-08 08:11:24 +00:00
Jiyong Park
5b75774004 Revert "Prevent statically linking to a lib providing stable C APIs"
This reverts commit 45b90e79c9.

Reason for revert: breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=run_bluetooth_host_native_tests&lkgb=6474123&lkbb=6474183&fkbb=6474137

Bug: 156046846
Change-Id: I0df395eaa4cd856ab466925031b21aa4adc3af08
Test: m on full-eng
2020-05-08 07:55:47 +00:00
Jiyong Park
e074cc3f52 Merge changes from topic "no_staticlinking_to_stubs" am: 06938a0a16 am: 36a0125014
Change-Id: I5c20e745bec1f57ba6bc2c1f08a7c942d98bcf75
2020-05-08 02:48:34 +00:00
Jiyong Park
18d4b2b708 Add GetPathString am: 1c7e962957 am: abf09b50e4
Change-Id: I079dd1d4394b494c225c054d46c5a5eb7fc4f113
2020-05-08 02:48:28 +00:00
Jiyong Park
abf09b50e4 Add GetPathString am: 1c7e962957
Change-Id: Iada405f160d8178ec90a1634f22a50cb18215938
2020-05-08 02:35:11 +00:00
Jiyong Park
06938a0a16 Merge changes from topic "no_staticlinking_to_stubs"
* changes:
  Prevent statically linking to a lib providing stable C APIs
  Add GetPathString
2020-05-08 02:12:58 +00:00
Ivan Lozano
7c3358dd60 Merge "Add gcov coverage support to Rust modules." am: 6c4e5c05c3 am: acdf2ac701
Change-Id: Id236afb83e583a93020803302a61dbf46904c295
2020-05-07 18:41:29 +00:00
Ivan Lozano
6c4e5c05c3 Merge "Add gcov coverage support to Rust modules." 2020-05-07 17:56:43 +00:00
Jeongik Cha
9d902cef58 Merge "Remove networkstack-aidl-interfaces-unstable-java from the whitelist" 2020-05-07 10:59:05 +00:00
Jiyong Park
45b90e79c9 Prevent statically linking to a lib providing stable C APIs
A lib providing stable C APIs should be available only to the APEX
containing the library. It shouldn't be available to other APEXes,
especially via static linking.

This change also fixes a bug that llndkImplDep (the dependency from
llndk stub to its implementation library) was recognized as being in the
same APEX.

Bug: 151051671
Test: m
Change-Id: Ifda7f4a367f68afcde93c86cda45a28cacd91f99
2020-05-07 16:20:00 +09:00
Jiyong Park
1c7e962957 Add GetPathString
The method is a thin wrapper around GetWalkPath and GetTagPath to make
it easy to construct a string representation of the current path.

It was originally inlined in the apex package. This change makes it a
function and moves it to the android package so make it more useful.

Bug: N/A
Test: m
Change-Id: I7e2bc2074baed759d67d9097151c9ac10e34ed31
2020-05-07 16:12:13 +09:00
Yo Chiang
c746c894b3 Merge "APEX should require base module of stub libraries" am: 6345dfde49 am: f8ae216e9c
Change-Id: Id5c8cb5aa416a3e0cf927067fd2bc2fbf6639128
2020-05-07 06:46:05 +00:00
TreeHugger Robot
67eb8ba040 Merge "Remove networkstack-aidl-interfaces-unstable-java from the whitelist" into rvc-dev am: c40859ae12
Change-Id: Ib0b0b010c4532fc9c5dbcd8c627e54a4ecccbaf4
2020-05-07 06:00:22 +00:00
Yo Chiang
29555d5f33 APEX should require base module of stub libraries
Bug: 155841765
Bug: 7456955
Test: m nothing and check the content of out/soong/Android-*.mk
Change-Id: I1f109c27a5e9bcfeb3a887b2e8d6a2cf983aa730
2020-05-06 09:18:01 +00:00
Jeongik Cha
255a570e6d Remove networkstack-aidl-interfaces-unstable-java from the whitelist
networkstack-aidl-interfaces-*java has explicit apex_available now.
Accordingly, remove it from the whitelist

Bug: 133526962
Test: m nothing
Change-Id: If5427afb2470a7dffbd418e1c405af508577ad93
2020-05-06 05:20:13 +00:00
Artur Satayev
334b51730a Export depsInfo into android package.
Move depsInfo into android for easier sharing with APK code.

Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Merged-In: If0ee967d37425540e69b4ce9304229d9f2cd86bd
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 872a144dca)
2020-05-05 16:19:07 +00:00
Ivan Lozano
a0cd8f9acb Add gcov coverage support to Rust modules.
This adds gcov coverage support for Rust device library and binary
modules (including test modules). Support is provided to pass Rust
static library gcno files to CC modules and visa versa.

Additional changes:
 * Begin mutator added for Rust modules.
 * SuffixInList added to android package.
 * CoverageEnabled added to Coverage interface.
 * CoverageFiles added to LinkableLibrary interface.
 * Fix in coverage mutator for non-CC modules which marked the wrong
   variant as the coverage variant.
 * Added coverage libraries to the cc.GatherRequiredDepsForTest.

Bug: 146448203
Test: NATIVE_COVERAGE=true COVERAGE_PATHS='*' m -j <rust_module>
Change-Id: If20728bdde42a1dd544a35a40f0d981b80a5835f
2020-05-05 10:30:15 -04:00
satayev
d82f528fa3 Merge "Export depsInfo into android package." am: 57769e469b am: ed11483aa6
Change-Id: I103c2e1f0eada4b1cd516cc1a24625d680627824
2020-05-05 10:30:28 +00:00
Artur Satayev
872a144dca Export depsInfo into android package.
Move depsInfo into android for easier sharing with APK code.

Bug: 149622332
Test: m, diff'ing outputs for conscrypt module.
Change-Id: If0ee967d37425540e69b4ce9304229d9f2cd86bd
2020-05-04 18:01:09 +01:00
Artur Satayev
2eedf623ff Ensure APEX's Java deps use stable SDKs.
Test: m
Bug: 153333044
Change-Id: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db
Merged-In: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db
Exempt-From-Owner-Approval: cp from aosp
(cherry picked from commit 8cf899afcc)
2020-05-04 16:51:59 +00:00
satayev
7c54f0358c Merge "Ensure APEX's Java deps use stable SDKs." am: 9d6ea77c52 am: 858239ce20
Change-Id: Icf58cab4392926b11836447d24161ef224e3ac09
2020-05-04 16:31:30 +00:00
satayev
9d6ea77c52 Merge "Ensure APEX's Java deps use stable SDKs." 2020-05-04 16:03:44 +00:00
Jiyong Park
63a3883802 Dependencies of tests are also included in APEX am: af9539fd14 am: 7e191d264a
Change-Id: Id6647ba0c1531e0605e5cedf921d3b01908d1ff5
2020-05-04 09:02:03 +00:00
Jeongik Cha
5bc011b479 Remove networkstack-aidl-interfaces-unstable-java from the whitelist
networkstack-aidl-interfaces-*java has explicit apex_available now.
Accordingly, remove it from the whitelist

Bug: 133526962
Test: m nothing
Change-Id: If5427afb2470a7dffbd418e1c405af508577ad93
Merged-In: If5427afb2470a7dffbd418e1c405af508577ad93
2020-05-04 08:32:41 +00:00
Jiyong Park
af9539fd14 Dependencies of tests are also included in APEX
Shared lib dependencies of a test is included in the APEX regardless of
whether the test has test_per_srcs or not.

Bug: N/A
Test: m (apex_test.go amended)
Change-Id: I6b16843cc7467c42e250aba88d79d5580ba47324
2020-05-04 10:31:32 +09:00
Treehugger Robot
a65a304368 Merge "runtime_resource_overlay can be included in APEXes" am: c869812b04 am: 765dbb0b83
Change-Id: Ia5f4e186891206912ae5cac5a7b29896a57ce1c6
2020-04-28 17:51:21 +00:00
Treehugger Robot
c869812b04 Merge "runtime_resource_overlay can be included in APEXes" 2020-04-28 17:13:26 +00:00
Jiyong Park
69aeba9982 runtime_resource_overlay can be included in APEXes
runtime_resource_overlay is put to an APEX via 'apps' property. It is
placed under ./overlay directory in it.

Bug: 154822536
Test: m
Change-Id: I8edf4a26c26368c52fb7b327b2ecc829f21ea148
2020-04-28 22:55:54 +09:00
Jiyong Park
5088a2cbd5 Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m
Merged-In: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
(cherry picked from commit 601d31c234)
Change-Id: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
2020-04-28 21:08:58 +09:00
Dario Freni
ccd4f112b1 Merge "Allow building unsigned APEXs payload for testing." into rvc-dev am: 73b6c98e10
Change-Id: Ie46b70b3125b430f4586fb67ec0868acc7066dfc
2020-04-28 07:33:35 +00:00
Dario Freni
73b6c98e10 Merge "Allow building unsigned APEXs payload for testing." into rvc-dev 2020-04-28 07:13:07 +00:00
Jiyong Park
28cb10ea68 Merge "mark platform un-availability" into rvc-dev 2020-04-28 02:29:55 +00:00
Jiyong Park
6a9ddc37a9 mark platform un-availability
A module is marked unavailable for platform when 1) it does not have
"//apex_available:platform" in its apex_available property, or 2)
it depends on another module that is unavailable for platform.

In that case, LOCAL_NOT_AVAILABLE_FOR_PLATFORM is set to true for the
module in the Make world. Later, that flag is used to ensure that there
is no module with the flag is installed to the device.

The reason why this isn't entirely done in Soong is because Soong
doesn't know if a module will be installed to the device or not. To
explain this, let's have an example.

cc_test { name: "mytest", static_libs: ["libfoo"]}
cc_library_static { name: "libfoo", static_libs: ["libbar"]}
cc_library { name: "libbar", apex_available: ["com.android.xxx"]}

Here, libbar is not available for platform, but is used by libfoo which
is available for platform (apex_available defaults to
"//apex_available:platform"). libfoo is again depended on by mytest
which again is available for platform. The use of libbar should be
allowed in the context of test; we don't want to make libbar available
to platform just for the dependency from test because it will allow
non-test uses of the library as well.

Soong by itself can't tell whether libfoo and libbar are used only in the
context of a test. There could be another module depending them, e.g.,

cc_library_shared { name: "mylib", static_libs: ["libfoo"] }

can exist and it might be installed to the device, in which case
we really should trigger an error.

Since Make has the knowledge of what's installed and what's not,
the check should be done there.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 153073816
Test: m
Test: remove "//apex_available:platform" from libmdnssd (it is currently
installed to /system/lib), and check that `m system_image` fails

Merged-In: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
(cherry picked from commit 89e850ab84)
Change-Id: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
2020-04-28 09:27:24 +09:00
TreeHugger Robot
ba505df1c4 Merge "Remove libopus from apex_available whitelist" into rvc-dev 2020-04-27 23:54:39 +00:00
Dario Freni
ca9133907f Allow building unsigned APEXs payload for testing.
Bug: 148447155
Test: built a testing apex with unsigned payload.
Merged-In: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
Change-Id: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
(cherry picked from commit 98410fd9d6)
2020-04-27 21:02:18 +01:00
Dario Freni
98410fd9d6 Allow building unsigned APEXs payload for testing.
Bug: 148447155
Test: built a testing apex with unsigned payload.
Change-Id: I95aa3f11ff1adc1421fcd7ed5a356ee531a0a818
2020-04-27 20:52:09 +01:00
Artur Satayev
8cf899afcc Ensure APEX's Java deps use stable SDKs.
Test: m
Bug: 153333044
Change-Id: Ib1acf3073e96fe23c92d292ec0b1a91e2cd408db
2020-04-27 19:16:40 +01:00
Treehugger Robot
8ffac4e19d Merge "mark platform un-availability" am: 01db260858 am: 547c6087df
Change-Id: Ida786db81d3bd1db40cfc28b6f3a013425781345
2020-04-27 13:03:05 +00:00
Treehugger Robot
01db260858 Merge "mark platform un-availability" 2020-04-27 12:37:45 +00:00
Jooyung Han
ced674e0e2 enforce updatable apexes to set min_sdk_version
updatable APEXes should set min_sdk_version as well.

Bug: 152655956
Test: m
Merged-In: I8192086eb89fa958dd8ff1b731e43e24bf217ce2
Change-Id: I8192086eb89fa958dd8ff1b731e43e24bf217ce2
(cherry picked from commit 548640b55f)
2020-04-27 19:44:06 +09:00
Treehugger Robot
35d20b1a4f Merge "enforce updatable apexes to set min_sdk_version" am: 4783297585 am: 09ae364a54
Change-Id: I2b2ce7dfb1dfc9cf498a7ed26a158a61548016c0
2020-04-27 10:20:32 +00:00
Jooyung Han
8c3b035045 Remove libopus from apex_available whitelist
libopus sets its own apex_available property.

Bug: 150999716
Test: m
Merged-In: I4cff3ebb7e017a1fb629b18b72238acf3df0d26e
Change-Id: I4cff3ebb7e017a1fb629b18b72238acf3df0d26e
(cherry picked from commit 47db5adb06)
2020-04-27 18:27:59 +09:00
Jooyung Han
cd5b550fdf Merge "Revert "Apex: add NeverAllowRule for updatable"" into rvc-dev am: b6e5e512de
Change-Id: I17009a86082db0c606228df8ae7840d33186b8fa
2020-04-27 07:44:43 +00:00
Jooyung Han
548640b55f enforce updatable apexes to set min_sdk_version
updatable APEXes should set min_sdk_version as well.

Bug: 152655956
Test: m
Change-Id: I8192086eb89fa958dd8ff1b731e43e24bf217ce2
2020-04-27 16:33:37 +09:00
Jooyung Han
b6e5e512de Merge "Revert "Apex: add NeverAllowRule for updatable"" into rvc-dev 2020-04-27 07:30:27 +00:00
Jooyung Han
cf75798d8f Revert "Apex: add NeverAllowRule for updatable"
This reverts commit e17caa63a6.

Reason for revert: rewrite this in ag/11250335 without neverallow

Bug: 152655956
Change-Id: I24436720056ac1b9878e37c2ee45c5806714f3e9
2020-04-27 07:30:10 +00:00
Marco Nelissen
1def8a267b Merge "com.android.media apex uses sonivox without jet" into rvc-dev am: 172e6fc12a
Change-Id: Ib641d951b8e2f70c95c8a2341289f73a2d348036
2020-04-25 15:05:24 +00:00
Marco Nelissen
172e6fc12a Merge "com.android.media apex uses sonivox without jet" into rvc-dev 2020-04-25 14:49:51 +00:00
Treehugger Robot
dcbc580195 Merge "Set apex_available property" am: 8c79615594 am: 75d9dae1e8
Change-Id: I79473f28becd80fd9bcf38db41762b2710c02cfb
2020-04-25 08:08:08 +00:00
Treehugger Robot
8c79615594 Merge "Set apex_available property" 2020-04-25 07:38:33 +00:00
Jooyung Han
28a49820e4 Merge "Apex: support codenames for min_sdk_version" 2020-04-25 04:41:44 +00:00
Jooyung Han
65cd0f0caa apex: respect filename property for apk-in-apex
android_app_import supports filename: property, which overrides .apk
filename.

Now, apex packaging rule respects it too.
(Previously, apex packaging ignored it)

Bug: 152163837
Test: m  (soong tests amended)
Merged-In: I72e2f1c923f4d01c42a87bf2232a025adca4c918
Change-Id: I72e2f1c923f4d01c42a87bf2232a025adca4c918
(cherry picked from commit 39ee119de2)
2020-04-25 02:25:39 +09:00
Jooyung Han
40b286ceea apex: Don't run apex mutators if disabled
apex_deps/apex/apex_flattened mutators don't have to run if module is
disabled.

For some branches which have no valid targets, apex modules are disabled
by the os mutator. e.g. aosp-build-tools

Some enforcement checks which run during those mutators may fail because
build-environment doesn't provide full context information.

For example, "Platform_version_all_codenames" config variable is not
set while apex.min_sdk_version uses one of those codenames.

Bug: 152655956
Test: m
Merged-In: I47e27d2d025ba4c36534708b113ce77c4cb2397b
Change-Id: I47e27d2d025ba4c36534708b113ce77c4cb2397b
(cherry picked from commit 49f6701e9a)
2020-04-25 02:22:28 +09:00
Marco Nelissen
917f1ca528 com.android.media apex uses sonivox without jet
which is now marked as apex_available in the sonivox Android.bp

Bug: 151448144
Test: build
Change-Id: Ie1e83e964aa544dced42db6a6a38303e27306faf
2020-04-24 10:21:54 -07:00
Jiyong Park
89e850ab84 mark platform un-availability
A module is marked unavailable for platform when 1) it does not have
"//apex_available:platform" in its apex_available property, or 2)
it depends on another module that is unavailable for platform.

In that case, LOCAL_NOT_AVAILABLE_FOR_PLATFORM is set to true for the
module in the Make world. Later, that flag is used to ensure that there
is no module with the flag is installed to the device.

The reason why this isn't entirely done in Soong is because Soong
doesn't know if a module will be installed to the device or not. To
explain this, let's have an example.

cc_test { name: "mytest", static_libs: ["libfoo"]}
cc_library_static { name: "libfoo", static_libs: ["libbar"]}
cc_library { name: "libbar", apex_available: ["com.android.xxx"]}

Here, libbar is not available for platform, but is used by libfoo which
is available for platform (apex_available defaults to
"//apex_available:platform"). libfoo is again depended on by mytest
which again is available for platform. The use of libbar should be
allowed in the context of test; we don't want to make libbar available
to platform just for the dependency from test because it will allow
non-test uses of the library as well.

Soong by itself can't tell whether libfoo and libbar are used only in the
context of a test. There could be another module depending them, e.g.,

cc_library_shared { name: "mylib", static_libs: ["libfoo"] }

can exist and it might be installed to the device, in which case
we really should trigger an error.

Since Make has the knowledge of what's installed and what's not,
the check should be done there.

Bug: 153073816
Test: m
Test: remove "//apex_available:platform" from libmdnssd (it is currently
installed to /system/lib), and check that `m system_image` fails

Change-Id: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
2020-04-24 21:40:13 +09:00
Ulyana Trafimovich
b59f9f2d52 Merge "Add "updatable" property to ApexModule interface." am: dc9510537a am: 0f4722751b
Change-Id: I475093d9bf96a94a54f4c64ad409f63a28b2ee95
2020-04-24 09:05:01 +00:00
Ulyana Trafimovich
dc9510537a Merge "Add "updatable" property to ApexModule interface." 2020-04-24 08:25:34 +00:00
Treehugger Robot
fd6b26abc1 Merge "Remove libopus from apex_available whitelist" am: f4dc25b476 am: a1c10cf43c
Change-Id: I15695035a45c934faec13384fef7bb8ad08d17ca
2020-04-24 01:07:26 +00:00
Ulya Trafimovich
7c140d828a Add "updatable" property to ApexModule interface.
For a given variant of a module that implements ApexModule interface,
the "updatable" property tests if this variant comes from an updatable
apex. For platform variants it is always false.

Test: lunch aosp_walleye-userdebug && m nothing
Bug: 138994281
Change-Id: I2d4c54fb397e29dc9b3203be7fb17be4536529f7
2020-04-23 11:58:53 +01:00
Jooyung Han
47db5adb06 Remove libopus from apex_available whitelist
libopus sets its own apex_available property.

Bug: 150999716
Test: m
Change-Id: I4cff3ebb7e017a1fb629b18b72238acf3df0d26e
2020-04-23 15:54:23 +09:00
Jiyong Park
71f42846a3 Set apex_available property
The marked library(ies) were available to the APEXes via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Merged-In: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
Change-Id: I11a4e877ee27f7c55e2f00371c6fa58daedb1a9f
2020-04-22 23:12:42 +09:00
Paul Duffin
f8b9e51f33 Remove conscrypt.module.intra.core.api.stubs from apex white list
It is no longer needed because non-static java_library dependencies are
not considered to be part of the depending APEX.

Bug: 153443117
Bug: 153306490
Test: m nothing
Merged-In: I7d58d1047b2d400395a253e492b35008284778ff
Change-Id: I7d58d1047b2d400395a253e492b35008284778ff
2020-04-22 12:51:53 +01:00
Paul Duffin
3766cb7b6a Ignore PrebuiltDepTag when processing APEX contents
When a source and a prebuilt module are present in the same build a
dependency is added from the source module to the prebuilt module.
Previously, the code for generating the APEX did not recognize that
tag and in some cases (e.g. for cc_(prebuilt_)library_shared) will
fail the build.

This change:
1) Adds a test to reproduce the problem.
2) Improves the debug message by pretty printing the tag.
3) Adds a new ExcludeFromApexContents interface that can be implemented
   by a tag to declare that it should be excluded from the APEX
   contents.
4) Ignores tags that implement that interface when generating APEX
   contents.
5) Implements that interface on prebuiltDependencyTag to fix the
   test.

Bug: 153326844
Bug: 153306490
Test: m nothing
Merged-In: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
Change-Id: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
2020-04-22 12:51:52 +01:00
Paul Duffin
b20ad0a7d4 Stop requiring apex_available on java_library members of sdks
Previously, adding java_library to an sdk required that the names of
any APEXes that transitively compiled against it were added to its
apex_available property. This change removes that requirement.

Also corrects the dependency path in the TestApexAvailable_IndirectDep
error which previously passed through "shared from static" static
dependency tags even though those are explicitly NOT followed when
checking apex_available settings.

Bug: 152878661
Bug: 153306490
Test: m droid
Merged-In: I995ed38956c1bc210b09494812de012fed9f9232
Change-Id: I995ed38956c1bc210b09494812de012fed9f9232
2020-04-22 12:51:51 +01:00
Paul Duffin
f020796cad Add dependency tags to apex available errors
Having dependency tags in the dependency path that shows why a specific
module is considered part of an apex makes it easier to understand why
that is the case and detect possible issues.

Bug: 152762638
Bug: 153306490
Test: m nothing
Merged-In: Iba2a8a5a6abe03dadee456e760aa4373cd00c07b
Change-Id: Iba2a8a5a6abe03dadee456e760aa4373cd00c07b
2020-04-22 12:51:51 +01:00
Paul Duffin
03e7d0ca9c Extract DepIsInSameApex and RequiredSdks interfaces
The DepIsInSameApex() and RequiredSdks() methods were defined in a few
places to avoid having to depend on the whole ApexModule/SdkAware
interfaces directly. However, that has a couple of issues:
1) It duplicates functionality making it difficult to change, changes
   to the definitions outside the main interfaces do not cause compile
   time failures, instead they result in a runtime change in behavior
   which can be difficult to debug.
2) IDE navigation (specifically in Intellij) does not detect that the
   duplicate definitions can resolve to the definitions in the main
   interface.

This change extracts the methods into their own interfaces and reuses
those interfaces instead of duplicating the methods to fix both of
these issues.

Bug: 152878661
Bug: 153306490
Test: m nothing
Merged-In: I0cfdf342a14eb0bfb82b1bd17e0633d81c7facfb
Change-Id: I0cfdf342a14eb0bfb82b1bd17e0633d81c7facfb
2020-04-22 12:51:50 +01:00
Paul Duffin
133608f602 Allow walkPayloadDeps visitor to control walk flow
Delegate the responsibility for determining whether the
walkPayloadDeps() should visit a child dependency to its do function.
This is needed to allow the visitor in checkApexAvailability() to avoid
checking the apex_available setting after crossing the APEX boundary.

Bug: 152878661
Bug: 153306490
Test: m droid
Merged-In: If46a2f74b6eca670befc3aeae430650e85542346
Change-Id: If46a2f74b6eca670befc3aeae430650e85542346
2020-04-22 12:51:48 +01:00
Paul Duffin
868ecfde70 Improve missing apex_available message
The apex available check can traverse quite a long path (5+ steps) to
get from the apex to a module that is missing the apex from its
apex_available property. Understanding where that dependency came from
can often require examining the dependency path which can be difficult.
This change adds the path to the error to simplify that process.

Bug: 153306490
Test: m nothing
Bug: 152762638
Merged-In: Ic4eb169dc2026cd8339d49e23b25d6d1c3879750
Change-Id: Ic4eb169dc2026cd8339d49e23b25d6d1c3879750
2020-04-22 12:51:47 +01:00
Paul Duffin
404db3f4e8 Copy white listed apex available settings into snapshot
Makes sure that the module snapshots do not rely on the white list
of apex available settings so that when those lists are removed it is
not necessary to update any snapshots.

Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
Change-Id: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
2020-04-22 12:51:37 +01:00
Paul Duffin
37a9aa24cc Remove special handling of test_ apexes
Test apexes no longer check to see whether their contents are available
so the special handling is no longer necessary.

Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
Change-Id: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
2020-04-22 12:51:36 +01:00
Paul Duffin
c23d9f652b Remove special handling of com.android.art.debug/release
The whitelistedApexAvailable used to map references to
com.android.art.debug/release to com.android.art before looking it up
in the white list. This change removed that mapping and simply added
both to the white list.

Bug: 142935992
Bug: 153306490
Test: m nothing
Merged-In: Ibad76fb73988688eb303e056197986ee9a6119ae
Change-Id: Ibad76fb73988688eb303e056197986ee9a6119ae
2020-04-22 12:51:35 +01:00
Jiyong Park
d5e0ea25d1 Don't run apex_available check for coverage builds
Coverage build adds extra dependencies for the runtime libs. Marking
them and their transitive dependenciese with apex_available doesn't make
any value; it instead adds noise.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m
Merged-In: I08e51cec1de6ded624ef9d4c41c1e5b2e611ff38
(cherry picked from commit 58d1090032)
Change-Id: I08e51cec1de6ded624ef9d4c41c1e5b2e611ff38
2020-04-20 16:26:18 +09:00
Jiyong Park
d182e5512f Remove some apex_available whitelist for the adbd APEX
The marked library(ies) were available to the adbd APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m
Merged-In: I6afbe905dda11056559521b937803dcd85b32fe5
(cherry picked from commit 3a0db5ef4e)
Change-Id: I6afbe905dda11056559521b937803dcd85b32fe5
2020-04-20 16:24:20 +09:00
Jiyong Park
24eec07f47 Make ndk_prebuilt_* be available to any apex
The NDK prebuilts are implicitly used when building with sdk_version set.
Make the module types be available to any apex so that we don't need to
manually add apex_available property to the module definitions manually.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m

Merged-In: I0870afa4c74b4a06ab1273dff84615778561ecc9
(cherry picked from commit e01e228270)
Change-Id: I0870afa4c74b4a06ab1273dff84615778561ecc9
2020-04-20 16:23:46 +09:00
Jiyong Park
2416c2903e Remove some apex_available whitelist
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 150999716
Test: m
Merged-In: I91d1b1076733a949ca2a959ba640ce34d0233492
(cherry picked from commit 541142ce6b)
Change-Id: I91d1b1076733a949ca2a959ba640ce34d0233492
2020-04-20 16:22:56 +09:00
Jooyung Han
0b2255f411 Merge "apex: respect filename property for apk-in-apex" am: 79a24f2ca8 am: 4c70b2800f
Change-Id: I8077fdf16054e2c1f958af4a2ce4452767b5fa8f
2020-04-18 03:22:38 +00:00
Jooyung Han
79a24f2ca8 Merge "apex: respect filename property for apk-in-apex" 2020-04-18 02:23:07 +00:00
Jooyung Han
cab7283b6b apex: Don't run apex mutators if disabled am: 49f6701e9a am: c080abef85
Change-Id: I897cba2391532ba33b2be9552f1f5eea1198bc3a
2020-04-17 13:47:47 +00:00
Jooyung Han
49f6701e9a apex: Don't run apex mutators if disabled
apex_deps/apex/apex_flattened mutators don't have to run if module is
disabled.

For some branches which have no valid targets, apex modules are disabled
by the os mutator. e.g. aosp-build-tools

Some enforcement checks which run during those mutators may fail because
build-environment doesn't provide full context information.

For example, "Platform_version_all_codenames" config variable is not
set while apex.min_sdk_version uses one of those codenames.

Bug: 152655956
Test: m
Change-Id: I47e27d2d025ba4c36534708b113ce77c4cb2397b
2020-04-17 15:49:32 +09:00
TreeHugger Robot
89030a315a Merge "Clean com.android.neuralnetworks APEX whitelist" into rvc-dev 2020-04-14 12:21:42 +00:00
Treehugger Robot
2b7c2e877b Merge "Clean com.android.neuralnetworks APEX whitelist" am: 0d4b9e32d0 am: 8e49cf8502
Change-Id: If3f8b2c319aafb2a5b759b13360ec7f1d6c1a9e8
2020-04-09 12:53:19 +00:00
Treehugger Robot
0d4b9e32d0 Merge "Clean com.android.neuralnetworks APEX whitelist" 2020-04-09 12:16:37 +00:00
Jooyung Han
aed150d6ed Apex: support codenames for min_sdk_version
Apex can use codenames like "Q", "R" for its min_sdk_version property.
Also, cc_library can use codenames for its stubs.versions.

Bug: 152655956
Test: m
Merged-In: I077ad7b2ac5d90b4c8708921e43846206f05ba70
Change-Id: I077ad7b2ac5d90b4c8708921e43846206f05ba70
(cherry picked from commit 29e91d2121)
2020-04-09 16:04:17 +09:00
Treehugger Robot
8c8763567d Merge "Remove conscrypt.module.intra.core.api.stubs from apex white list" am: b54015fa54 am: b9fd69e8af
Change-Id: I5338969f71eb6a39606d4f9627ea2c8fbc14e7d8
2020-04-09 02:31:29 +00:00
Paul Duffin
e2cfe9ce92 Remove conscrypt.module.intra.core.api.stubs from apex white list
It is no longer needed because non-static java_library dependencies are
not considered to be part of the depending APEX.

Bug: 153443117
Test: m nothing
Change-Id: I7d58d1047b2d400395a253e492b35008284778ff
2020-04-08 19:12:58 +01:00
Jooyung Han
f8300fdce1 Apex: add NeverAllowRule for updatable am: e17caa63a6
Change-Id: Ie893bf23a57083b594cd0fc5c09adb7a38322969
2020-04-08 15:56:17 +00:00
Paul Duffin
2842d14c50 Merge "Ignore PrebuiltDepTag when processing APEX contents" am: 846e60dbc7 am: 246bbcc5e2
Change-Id: Ia5482682e8673cd0721c6029d03e222a9e0aefe1
2020-04-08 14:59:24 +00:00
Paul Duffin
3e5c8b4995 Merge "Stop requiring apex_available on java_library members of sdks" am: f76c64018e am: c8c4a962d4
Change-Id: I8655a0889bb8bb089e16107ec29a1c559cb290b0
2020-04-08 14:59:16 +00:00
Paul Duffin
a726a11db1 Add dependency tags to apex available errors am: c519244cd5 am: e554326df5
Change-Id: I981156a84819badf8f24e79beffa2f51a41e06be
2020-04-08 11:40:00 +00:00
Paul Duffin
dddd5469ad Ignore PrebuiltDepTag when processing APEX contents
When a source and a prebuilt module are present in the same build a
dependency is added from the source module to the prebuilt module.
Previously, the code for generating the APEX did not recognize that
tag and in some cases (e.g. for cc_(prebuilt_)library_shared) will
fail the build.

This change:
1) Adds a test to reproduce the problem.
2) Improves the debug message by pretty printing the tag.
3) Adds a new ExcludeFromApexContents interface that can be implemented
   by a tag to declare that it should be excluded from the APEX
   contents.
4) Ignores tags that implement that interface when generating APEX
   contents.
5) Implements that interface on prebuiltDependencyTag to fix the
   test.

Bug: 153326844
Test: m nothing
Change-Id: I9dd4312c4f995c816c0a31d8d733eb5d7f56e1ea
2020-04-08 08:40:44 +01:00
Paul Duffin
6534770793 Stop requiring apex_available on java_library members of sdks
Previously, adding java_library to an sdk required that the names of
any APEXes that transitively compiled against it were added to its
apex_available property. This change removes that requirement.

Also corrects the dependency path in the TestApexAvailable_IndirectDep
error which previously passed through "shared from static" static
dependency tags even though those are explicitly NOT followed when
checking apex_available settings.

Bug: 152878661
Test: m droid
Change-Id: I995ed38956c1bc210b09494812de012fed9f9232
2020-04-08 08:40:44 +01:00
Paul Duffin
c519244cd5 Add dependency tags to apex available errors
Having dependency tags in the dependency path that shows why a specific
module is considered part of an apex makes it easier to understand why
that is the case and detect possible issues.

Bug: 152762638
Test: m nothing
Change-Id: Iba2a8a5a6abe03dadee456e760aa4373cd00c07b
2020-04-08 08:40:44 +01:00
Paul Duffin
7b49cfc537 Merge "Extract DepIsInSameApex and RequiredSdks interfaces" am: 2010598a51 am: 2a9b7c8791
Change-Id: I825f791ccecd83be6060654a36403756ace30d23
2020-04-08 07:26:23 +00:00
Jooyung Han
e17caa63a6 Apex: add NeverAllowRule for updatable
to enforce that apexes that set updatable: true also set min_sdk_version

Bug: 152655956
Test: m
Change-Id: I0d2e9f9b3234873de073ab82d91211faedd16498
2020-04-08 05:20:11 +00:00
Paul Duffin
923e8a5e9e Extract DepIsInSameApex and RequiredSdks interfaces
The DepIsInSameApex() and RequiredSdks() methods were defined in a few
places to avoid having to depend on the whole ApexModule/SdkAware
interfaces directly. However, that has a couple of issues:
1) It duplicates functionality making it difficult to change, changes
   to the definitions outside the main interfaces do not cause compile
   time failures, instead they result in a runtime change in behavior
   which can be difficult to debug.
2) IDE navigation (specifically in Intellij) does not detect that the
   duplicate definitions can resolve to the definitions in the main
   interface.

This change extracts the methods into their own interfaces and reuses
those interfaces instead of duplicating the methods to fix both of
these issues.

Bug: 152878661
Test: m nothing
Change-Id: I0cfdf342a14eb0bfb82b1bd17e0633d81c7facfb
2020-04-07 15:26:06 +01:00
Przemysław Szczepaniak
5642308998 Clean com.android.neuralnetworks APEX whitelist
Test: coral-userdebug build
Bug: 148593574
Change-Id: I1babea6c221dec1cd5364250d09f5ea541494942
Merged-In: I1babea6c221dec1cd5364250d09f5ea541494942
2020-04-06 14:02:31 +00:00
Jooyung Han
39ee119de2 apex: respect filename property for apk-in-apex
android_app_import supports filename: property, which overrides .apk
filename.

Now, apex packaging rule respects it too.
(Previously, apex packaging ignored it)

Bug: 152163837
Test: m  (soong tests amended)
Change-Id: I72e2f1c923f4d01c42a87bf2232a025adca4c918
2020-04-06 21:25:06 +09:00
Przemysław Szczepaniak
2bce0e8002 Clean com.android.neuralnetworks APEX whitelist
Test: coral-userdebug build
Bug: 148593574
Change-Id: I1babea6c221dec1cd5364250d09f5ea541494942
Merged-In: I1babea6c221dec1cd5364250d09f5ea541494942
2020-04-06 12:05:53 +00:00
Treehugger Robot
678c8de79c Merge changes from topic "no_whitelisting_apex_available" am: b9e4a3fdf4 am: bf4bc941a2
Change-Id: Ife369d5943e70b4d5a6836ca19d514dd1c38d658
2020-04-05 09:51:31 +00:00
Treehugger Robot
b9e4a3fdf4 Merge changes from topic "no_whitelisting_apex_available"
* changes:
  Remove some apex_available whitelist for the adbd APEX
  Make ndk_prebuilt_* be available to any apex
2020-04-05 09:10:47 +00:00
Jooyung Han
7e62fbe8e1 Merge "Apex: support codenames for min_sdk_version" into rvc-dev am: 95148f607e
Change-Id: Ib64f83d89dd7adeafa2b42bc81c7dd012fe13ff8
2020-04-05 00:32:30 +00:00
Jooyung Han
29e91d2121 Apex: support codenames for min_sdk_version
Apex can use codenames like "Q", "R" for its min_sdk_version property.
Also, cc_library can use codenames for its stubs.versions.

Bug: 152655956
Test: vendor/google/build/build_mainline_modules.sh
Change-Id: I077ad7b2ac5d90b4c8708921e43846206f05ba70
2020-04-02 23:26:41 +09:00
Paul Duffin
becaaba147 Merge "Allow walkPayloadDeps visitor to control walk flow" am: 4ac530d4c7 am: 94d5ca9d38
Change-Id: I85dbe29fdc5b71fa923a2583621ef713d1b151a0
2020-04-01 18:29:06 +00:00
Paul Duffin
4ac530d4c7 Merge "Allow walkPayloadDeps visitor to control walk flow" 2020-04-01 17:54:04 +00:00
Jiyong Park
f689b0ec7c Merge "Remove some apex_available whitelist" am: 1cda30e211 am: 41110b1cfb
Change-Id: Ieb597a084b56fbd3a18636f528e9fb1b6a963541
2020-04-01 13:36:05 +00:00
Jiyong Park
1cda30e211 Merge "Remove some apex_available whitelist" 2020-04-01 13:03:10 +00:00
Paul Duffin
be5a5be549 Allow walkPayloadDeps visitor to control walk flow
Delegate the responsibility for determining whether the
walkPayloadDeps() should visit a child dependency to its do function.
This is needed to allow the visitor in checkApexAvailability() to avoid
checking the apex_available setting after crossing the APEX boundary.

Bug: 152878661
Test: m droid
Change-Id: If46a2f74b6eca670befc3aeae430650e85542346
2020-04-01 09:30:31 +01:00
Paul Duffin
2b31dbcc56 Merge "Improve missing apex_available message" am: 4db3298d34 am: b0725e7dd0
Change-Id: I22d65f68467dd0858361341da020b6e4866b7722
2020-03-31 09:40:05 +00:00
Paul Duffin
df915ff3db Improve missing apex_available message
The apex available check can traverse quite a long path (5+ steps) to
get from the apex to a module that is missing the apex from its
apex_available property. Understanding where that dependency came from
can often require examining the dependency path which can be difficult.
This change adds the path to the error to simplify that process.

Test: m nothing
Bug: 152762638
Change-Id: Ic4eb169dc2026cd8339d49e23b25d6d1c3879750
2020-03-30 18:43:39 +01:00
Jiyong Park
a0b7fdee67 Don't run apex_available check for coverage builds am: 58d1090032 am: 774baea1fc
Change-Id: I429a4e7edea72cdbb160d120ce85d921c185e9d7
2020-03-30 05:59:21 +00:00
Jiyong Park
58d1090032 Don't run apex_available check for coverage builds
Coverage build adds extra dependencies for the runtime libs. Marking
them and their transitive dependenciese with apex_available doesn't make
any value; it instead adds noise.

Bug: 150999716
Test: m
Change-Id: I08e51cec1de6ded624ef9d4c41c1e5b2e611ff38
2020-03-28 14:43:19 +09:00
Jiyong Park
3a0db5ef4e Remove some apex_available whitelist for the adbd APEX
The marked library(ies) were available to the adbd APEX via the
hand-written whitelist in build/soong/apex/apex.go. Trying to remove the
whitelist by adding apex_available property to the Android.bp of the
libraries.

Bug: 150999716
Test: m
Change-Id: I6afbe905dda11056559521b937803dcd85b32fe5
2020-03-20 17:02:14 +09:00
Jiyong Park
541142ce6b Remove some apex_available whitelist
The marked library(ies) were available to the APEXes via the hand-written
whitelist in build/soong/apex/apex.go. Trying to remove the whitelist
by adding apex_available property to the Android.bp of the libraries.

Bug: 150999716
Test: m
Change-Id: I91d1b1076733a949ca2a959ba640ce34d0233492
2020-03-20 17:02:14 +09:00
Jiyong Park
e01e228270 Make ndk_prebuilt_* be available to any apex
The NDK prebuilts are implicitly used when building with sdk_version set.
Make the module types be available to any apex so that we don't need to
manually add apex_available property to the module definitions manually.

Bug: 150999716
Test: m

Change-Id: I0870afa4c74b4a06ab1273dff84615778561ecc9
2020-03-20 17:02:14 +09:00
Tim Joines
a0b20e3c07 Merge "Revert "Share vdex files in the ART apex between architectures (..."" am: 45feb06174 am: d5773388d2
Change-Id: Id68571fdfe1b4c5f5120e52ead7f374706a7ec4f
2020-03-18 20:19:19 +00:00
Tim Joines
45feb06174 Merge "Revert "Share vdex files in the ART apex between architectures (..."" 2020-03-18 19:46:48 +00:00
Tim Joines
c1ef1bb5cc Revert "Share vdex files in the ART apex between architectures (..."
Revert submission 1254009-vdex-symlinks

Reason for revert: This causing some devices to fail to boot. See b/151836042 for details.
Reverted Changes:
Iced89071b:Expect vdex files in a target-independent director...
Ifbceb8457:Share vdex files in the ART apex between architect...

Change-Id: I5bd88f8e61d442eed921d840c90777a2750ddb16
2020-03-18 18:00:41 +00:00
Ulyana Trafimovich
6d69cfa4a8 Merge "Share vdex files in the ART apex between architectures (via symlinks)." am: 5d2449efe4 am: f985044e23
Change-Id: I01fb1eee33776c09903bd558c0a1cb98d430089b
2020-03-18 14:17:24 +00:00
Ulyana Trafimovich
5d2449efe4 Merge "Share vdex files in the ART apex between architectures (via symlinks)." 2020-03-18 13:46:06 +00:00
Ulya Trafimovich
5b88fe36b5 Share vdex files in the ART apex between architectures (via symlinks).
Test: aosp_walleye-userdebug boots.

Test: Check symlinks to *.vdex files in the ART apex:
$ adb shell 'find /apex/com.android.art -name '*.vdex' | xargs ls -l'
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-apache-xml.vdex -> ../boot-apache-xml.vdex
  lrw-r--r-- 1 system system   25 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-bouncycastle.vdex -> ../boot-bouncycastle.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-core-icu4j.vdex -> ../boot-core-icu4j.vdex
  lrw-r--r-- 1 system system   24 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-core-libart.vdex -> ../boot-core-libart.vdex
  lrw-r--r-- 1 system system   19 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot-okhttp.vdex -> ../boot-okhttp.vdex
  lrw-r--r-- 1 system system   12 1970-01-01 01:00 /apex/com.android.art/javalib/arm/boot.vdex -> ../boot.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-apache-xml.vdex -> ../boot-apache-xml.vdex
  lrw-r--r-- 1 system system   25 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-bouncycastle.vdex -> ../boot-bouncycastle.vdex
  lrw-r--r-- 1 system system   23 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-core-icu4j.vdex -> ../boot-core-icu4j.vdex
  lrw-r--r-- 1 system system   24 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-core-libart.vdex -> ../boot-core-libart.vdex
  lrw-r--r-- 1 system system   19 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot-okhttp.vdex -> ../boot-okhttp.vdex
  lrw-r--r-- 1 system system   12 1970-01-01 01:00 /apex/com.android.art/javalib/arm64/boot.vdex -> ../boot.vdex
  -rw-r--r-- 1 system system 1229 1970-01-01 01:00 /apex/com.android.art/javalib/boot-apache-xml.vdex
  -rw-r--r-- 1 system system 2043 1970-01-01 01:00 /apex/com.android.art/javalib/boot-bouncycastle.vdex
  -rw-r--r-- 1 system system 2883 1970-01-01 01:00 /apex/com.android.art/javalib/boot-core-icu4j.vdex
  -rw-r--r-- 1 system system  865 1970-01-01 01:00 /apex/com.android.art/javalib/boot-core-libart.vdex
  -rw-r--r-- 1 system system  395 1970-01-01 01:00 /apex/com.android.art/javalib/boot-okhttp.vdex
  -rw-r--r-- 1 system system 7125 1970-01-01 01:00 /apex/com.android.art/javalib/boot.vdex

Bug: 150934453

Change-Id: Ifbceb845749f4c218693f4118e8b35b59ff26de1
2020-03-17 13:36:06 +00:00
Jiyong Park
79505fbf22 Merge "Remove libselinux from the apex_available whitelist" into rvc-dev 2020-03-17 08:29:46 +00:00
Automerger Merge Worker
0fdd1a61da Merge "Remove libselinux from the apex_available whitelist" am: 4f65ea2992 am: 8f93c7e4a8
Change-Id: Ic2b571ba51a6b6b63143e95cacdb74eb4b69361f
2020-03-17 05:31:20 +00:00
Jiyong Park
7e5576a7b1 Remove libselinux from the apex_available whitelist
libselinux no longer is included in any APEX. Only the platform variant
of it (/system/lib/libselinux.so) exists and APEXes link to it.

Removing the lib name from the whitelist to make it clear that the
library is not available to any APEX.

Bug: 151053366
Bug: 150999716
Test: m

Exempt-From-Owner-Approval: cherry-pick from aosp

Merged-In: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
(cherry picked from commit 1731f6ae3f)
Change-Id: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
2020-03-17 05:25:31 +00:00
Treehugger Robot
4f65ea2992 Merge "Remove libselinux from the apex_available whitelist" 2020-03-17 04:55:02 +00:00
Automerger Merge Worker
78c5fa002b Merge "Allow for overriding container packagename for an Apex." am: c822818147 am: 5b88818470
Change-Id: Ic41a6ec13f3d8dbceda05fb3c330ac5cee01aca5
2020-03-16 23:42:50 +00:00
Baligh Uddin
cb6aa122d8 Allow for overriding container packagename for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Merged-In: If49042a7acbf9f0dcb505664863d97805902e459
Change-Id: If49042a7acbf9f0dcb505664863d97805902e459
2020-03-16 16:41:11 -07:00
Baligh Uddin
c822818147 Merge "Allow for overriding container packagename for an Apex." 2020-03-16 23:07:31 +00:00
Baligh Uddin
5b57dbad86 Allow for overriding container packagename for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Change-Id: If49042a7acbf9f0dcb505664863d97805902e459
2020-03-16 12:38:06 -07:00
Jooyung Han
23b0adf4ce apex: Deprecate legacy_android10_support prop
min_sdk_version = 29 implies that the module should support Android10.

Bug: 150431944
Test: m
Merged-In: Iad90a239898f59456900ae7816b90379b1b43406
Change-Id: Iad90a239898f59456900ae7816b90379b1b43406
(cherry picked from commit 5417f775e5)

Exempt-From-Owner-Approval: cp from aosp
2020-03-16 10:57:51 +00:00
Automerger Merge Worker
577e719117 apex: Deprecate legacy_android10_support prop am: 5417f775e5 am: 14b360507a
Change-Id: I52872ae44fd2dfc9ef4a299aaf1412ec43e9fd8a
2020-03-16 05:06:18 +00:00
Jooyung Han
5417f775e5 apex: Deprecate legacy_android10_support prop
min_sdk_version = 29 implies that the module should support Android10.

Bug: 150431944
Test: m
Change-Id: Iad90a239898f59456900ae7816b90379b1b43406
2020-03-14 16:03:24 +09:00
Jooyung Han
0c4e016428 apex: choose stub according to min_sdk_version
Native modules within APEX should be linked with proper stub version
according to its min_sdk_version.

For example, when min_sdk_version is set to "29", libfoo in the apex
would be linked to libbar of version 29 from platform, even if it has
a newer version like 30.

Bug: 145796956
Test: m nothing (soong tests)
Merged-In: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
Change-Id: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
(cherry picked from commit 03b5185b88)

Exempt-From-Owner-Approval: got ORV already.
2020-03-12 14:07:05 +00:00
Automerger Merge Worker
212de176a1 Merge changes Iedcff7df,I4cb294c2 am: 001ca325fb am: c6b4caf37e
Change-Id: Id1b12796c0e9ffe050820f295380271bfdab0f42
2020-03-12 08:39:05 +00:00
Jiyong Park
1731f6ae3f Remove libselinux from the apex_available whitelist
libselinux no longer is included in any APEX. Only the platform variant
of it (/system/lib/libselinux.so) exists and APEXes link to it.

Removing the lib name from the whitelist to make it clear that the
library is not available to any APEX.

Bug: 151053366
Bug: 150999716
Test: m
Change-Id: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
2020-03-12 14:16:07 +09:00
Automerger Merge Worker
8aa853c134 Merge "Remove special handling of test_ apexes" am: f53737fadc am: 784e2e472b
Change-Id: I25af68ceb99b50d4d98a99a5af6143ddafcf5b58
2020-03-11 20:31:46 +00:00
Automerger Merge Worker
ebd4ff2305 Merge "Remove special handling of com.android.art.debug/release" am: de77904484 am: 0277cec3bd
Change-Id: I2441e873f40dfe9cc87cae39d0a980d917aa167e
2020-03-11 20:18:23 +00:00
Paul Duffin
7d74e7bea3 Copy white listed apex available settings into snapshot
Makes sure that the module snapshots do not rely on the white list
of apex available settings so that when those lists are removed it is
not necessary to update any snapshots.

Bug: 142935992
Test: m nothing
Change-Id: Iedcff7dfc2646a4da77258d16e06657dd2f411f9
2020-03-11 18:31:45 +00:00
Treehugger Robot
f53737fadc Merge "Remove special handling of test_ apexes" 2020-03-11 17:52:56 +00:00
Treehugger Robot
de77904484 Merge "Remove special handling of com.android.art.debug/release" 2020-03-11 16:46:21 +00:00
Paul Duffin
57380a902e Remove special handling of test_ apexes
Test apexes no longer check to see whether their contents are available
so the special handling is no longer necessary.

Bug: 142935992
Test: m nothing
Change-Id: Iecae7dcbb87908d19c672f74d3c1ed8810d4485b
2020-03-11 15:17:04 +00:00
Paul Duffin
50cbefd5e8 Remove special handling of com.android.art.debug/release
The whitelistedApexAvailable used to map references to
com.android.art.debug/release to com.android.art before looking it up
in the white list. This change removed that mapping and simply added
both to the white list.

Bug: 142935992
Test: m nothing
Change-Id: Ibad76fb73988688eb303e056197986ee9a6119ae
Merged-In: Ibad76fb73988688eb303e056197986ee9a6119ae
2020-03-11 15:16:47 +00:00
Automerger Merge Worker
aff9ac02b3 Fix path in apex when native_bridge_supported: true am: 35155c4f96 am: 42a3990433
Change-Id: If476ee6e04813eb1dd685473101eb14c68b70e3b
2020-03-11 13:54:23 +00:00
Jooyung Han
35155c4f96 Fix path in apex when native_bridge_supported: true
NativeBridgeRelativePath should be appended after /bin or /lib and
before subdir.

Bug: N/A
Test: m (add a soong test)
Change-Id: Id0c44c66b4900caa291e816cf3361fdec8ff9421
2020-03-11 20:07:34 +09:00
Jooyung Han
b8fa86ad6f Fix apex_available
Checking apex_available was missing some corner cases.
For example, the deps of share deps of cc_library modules are missed
while those from cc_library_shared are correctly tracked.

This was due to..

* calling DepIsInSameApex in WalkDeps: both work fine separately, but
when they are used together, it fails to work. It's due to how WalkDeps
works. (We might fix this bug too risky since it is used very widely)
* incorrect receiver for DepIsInSameApex in apex_deps mutator: receiver
is supposed to be parent, but child was used before. Interestingly lots
of deps are within the same group of module types(cc to cc, java to
java), it has worked. (note that receiver's DepIsInSameApex
implementation can be different).

This change fixes them by..

* walkPayloadDeps is now relying on ApexVariation, which is calculated
correctly by TopDown apex_deps mutator.
* use correct receiver for DepIsInSameApex in apex_deps mutator, which
requires for java.SdkLibrary to override the method and for
java.Library/Import to use passed dep instead of receiver to check its
membership of sdk.

Exempt-From-Owner-Approval: cherry-pick from aosp/master

Bug: 151071238
Test: build/boot
Merged-In: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
(cherry picked from commit 5e9013be22)
Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
2020-03-11 16:38:21 +09:00
Automerger Merge Worker
fe2d1c6a5a Merge "Fix apex_available" am: 4c8e3509ee am: 192a8f7385
Change-Id: Iea3359013e011e79acee013f3ce9fc103ee8a166
2020-03-11 00:26:08 +00:00
Jooyung Han
4c8e3509ee Merge "Fix apex_available" 2020-03-10 23:53:41 +00:00
Jooyung Han
5e9013be22 Fix apex_available
Checking apex_available was missing some corner cases.
For example, the deps of share deps of cc_library modules are missed
while those from cc_library_shared are correctly tracked.

This was due to..

* calling DepIsInSameApex in WalkDeps: both work fine separately, but
when they are used together, it fails to work. It's due to how WalkDeps
works. (We might fix this bug too risky since it is used very widely)
* incorrect receiver for DepIsInSameApex in apex_deps mutator: receiver
is supposed to be parent, but child was used before. Interestingly lots
of deps are within the same group of module types(cc to cc, java to
java), it has worked. (note that receiver's DepIsInSameApex
implementation can be different).

This change fixes them by..

* walkPayloadDeps is now relying on ApexVariation, which is calculated
correctly by TopDown apex_deps mutator.
* use correct receiver for DepIsInSameApex in apex_deps mutator, which
requires for java.SdkLibrary to override the method and for
java.Library/Import to use passed dep instead of receiver to check its
membership of sdk.

Bug: 151071238
Test: build/boot
Change-Id: I0569ef4bb8e79635e4d97a89f421a8d8b7d26456
2020-03-10 23:52:01 +00:00
Treehugger Robot
04c93a40f1 Merge "DO NOT MERGE: Remove AppSearch from Android R." 2020-03-10 08:19:05 +00:00
Jiyong Park
65cc4f7777 Apex_available check failure reveals dependency
When the check for apex_available has failed, the build system now shows
the module that brought the unavailable module into the APEX.

Bug: 151051671
Test: m
Merged-In: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
(cherry picked from commit 7bd9444b0f)
Change-Id: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
2020-03-09 18:56:54 +09:00
Automerger Merge Worker
62cdc4ad57 Merge "Apex_available check failure reveals dependency" into rvc-dev am: 5a3899b5c5
Change-Id: I683d10496836a77d5140031daae27ac71a83c76f
2020-03-09 09:01:38 +00:00
Alexander Dorokhine
466d39a18c DO NOT MERGE: Remove AppSearch from Android R.
Test: presubmit
Bug: 150249538
Merged-In: I0a87b9d893bc76acf5ac5e8684f450b9a4f2a0cd
(cherry picked from commit c9c7116721)
Change-Id: I0a87b9d893bc76acf5ac5e8684f450b9a4f2a0cd
2020-03-09 15:14:42 +09:00
Jiyong Park
7bd9444b0f Apex_available check failure reveals dependency
When the check for apex_available has failed, the build system now shows
the module that brought the unavailable module into the APEX.

Bug: 151051671
Test: m
Change-Id: Id1a3fda67fe56fdc2dc90ec800d10689415de4d6
2020-03-09 14:29:18 +09:00
Automerger Merge Worker
344ce5f777 apex: choose stub according to min_sdk_version am: 03b5185b88 am: 5cf1805a44
Change-Id: Ibe1984b4deaa0681a7339f871d8d3dc62072fe58
2020-03-06 20:13:50 +00:00
Jooyung Han
03b5185b88 apex: choose stub according to min_sdk_version
Native modules within APEX should be linked with proper stub version
according to its min_sdk_version.

For example, when min_sdk_version is set to "29", libfoo in the apex
would be linked to libbar of version 29 from platform, even if it has
a newer version like 30.

Bug: 145796956
Test: m nothing (soong tests)
Change-Id: I4a0b2002587bc24b7deeb5d59b6eeba5e1db5b1f
2020-03-07 03:12:45 +09:00
Automerger Merge Worker
0d2697146b DO NOT MERGE: Remove AppSearch from Android R. am: c9c7116721
Change-Id: I64870bfc6e92d288ef45ef1194a170ed44e70c2e
2020-03-06 09:37:42 +00:00
TreeHugger Robot
bc4df10016 Merge "DO NOT MERGE: Remove AppSearch from Android R." into rvc-dev 2020-03-05 21:09:00 +00:00
Colin Cross
7365eaafd5 Add min_sdk_version property to apexes
Add a min_sdk_version property apexes.  Currently a noop, but will
be used to enforce that dependencies are compatible with the
specified version.

Test: m checkbuild
Bug: 149591522
Merged-In: I923773c90fe15becbffae3986791aa9edde8f8f6
Change-Id: I923773c90fe15becbffae3986791aa9edde8f8f6
(cherry picked from commit 50317874ff)
2020-03-05 14:40:28 +09:00
Jiyong Park
af8998cba6 bundle config contains (path,manifest) pairs of embedded APKs
If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.

Exempt-From-Owner-Approval: cherry-pick from master

Bug: 148002117
Test: m

Merged-In: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
(cherry picked from commit cfaa1643e8)
Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
2020-03-01 03:59:11 +00:00
Automerger Merge Worker
3a58ea25c2 bundle config contains (path,manifest) pairs of embedded APKs am: cfaa1643e8 am: 9cb0071b9e
Change-Id: I1894098b8073f6ad0d83aa957a8bd4c149e904d2
2020-02-29 09:53:07 +00:00
Jiyong Park
cfaa1643e8 bundle config contains (path,manifest) pairs of embedded APKs
If an APEX contains APKs and the manifest package name of the APKs are
overridden (either via override_android_app
orPRODUCT_MANIFEST_PACKAGE_NAME_OVERRIDES), that the path to the APK
(relative in the APEX) and the overridden manifest package name is
recorded in the bundle config file.

Bug: 148002117
Test: m

Change-Id: Ibb90bcefb77fa6b2dad77cb2facc6079de9ab154
2020-02-29 09:07:46 +09:00
Automerger Merge Worker
d8c70e3f73 Merge "Add "jni_libs" property to apex module" am: c6e538406c am: 77de0c97a0
Change-Id: Ic6c20b4b5e8334f6fe5532f6da3d29797731620c
2020-02-28 17:32:43 +00:00
Automerger Merge Worker
eed20ed32a Merge changes I789b526c,Ie15c811f am: 6e147e4f54 am: 450510faa7
Change-Id: I5e1d927f6f586010ef59d5f3ff1c14b6273bf8f4
2020-02-28 17:32:35 +00:00
Jooyung Han
c6e538406c Merge "Add "jni_libs" property to apex module" 2020-02-28 17:12:53 +00:00
Jooyung Han
6e147e4f54 Merge changes I789b526c,Ie15c811f
* changes:
  apex: refactor apex properties
  apex: fix a test util (ensureExactContent)
2020-02-28 17:08:45 +00:00
Jooyung Han
643adc4896 Add "jni_libs" property to apex module
Which is the list of JNI libraries that are embeded inside the apex.
jni_libs is handled just like native_shared_libs except that it is
stored in apex_manifest.

When linkerconfig finds an apex with JNI libs, it exposes the namespace
for the apex as visible so that libnativeloader can link the namespace
to the corresponding classloader-namespace.

Bug: 149363889
Test: m nothing(runs soong test)
Change-Id: I52ebe38b44545e6e8853e34a3404a235c858112a
2020-02-27 13:50:06 +09:00
Jooyung Han
01a868d096 apex: refactor apex properties
Embed common properties (apexNativeDependencies) so that the logic for
adding dependencies for native modules can be reused.

Bug: N/A
Test: m

Change-Id: I789b526c09eea14213ab1544590ed2238ed8c625
2020-02-27 13:45:14 +09:00
Automerger Merge Worker
c93ba028ea Merge "No symlink for host APEXes" into rvc-dev am: 73fa54e7a4
Change-Id: I8c02e7d52eadd32eb3f30514b3ab6f7c596a4919
2020-02-27 03:35:27 +00:00
Jiyong Park
73fa54e7a4 Merge "No symlink for host APEXes" into rvc-dev 2020-02-27 03:22:01 +00:00
Jiyong Park
638d30ed21 No symlink for host APEXes
Symlinking doesn't make sense for host APEXes.

Bug: 150255435
Test: m com.android.art.host and inspect the built APEX; there is
no symlink.

Merged-In: I28492dfaaef471117a430be05255fbef76e557b0
(cherry picked from commit 9b96418dfe)
Change-Id: I28492dfaaef471117a430be05255fbef76e557b0
2020-02-27 12:09:33 +09:00
Jiyong Park
9b96418dfe No symlink for host APEXes
Symlinking doesn't make sense for host APEXes.

Bug: 150255435
Test: m com.android.art.host and inspect the built APEX; there is
no symlink.

Change-Id: I28492dfaaef471117a430be05255fbef76e557b0
2020-02-26 18:27:19 +09:00
Jooyung Han
650417966c apex: do not follow jni_libs from android_app
Because APK-in-APEX embeds its jni_libs in it. We don't have to follow
deps of jni_libs.

Bug: 146992436
Test: m com.android.tethering
      deapexer extract com.android.tethering.apex apex
      ls apex # there should be no /lib dir

Merged-In: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
Change-Id: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
(cherry picked from commit b7bebe2616)
2020-02-26 14:10:23 +09:00
Automerger Merge Worker
4d174673ae Merge "apex: do not follow jni_libs from android_app" am: 077f9a44f9 am: 52b4afe8f2
Change-Id: Ia392382fc787293cecd36c6456d1b2ec0af13877
2020-02-26 03:06:33 +00:00
Jooyung Han
077f9a44f9 Merge "apex: do not follow jni_libs from android_app" 2020-02-26 02:35:10 +00:00
Alexander Dorokhine
c9c7116721 DO NOT MERGE: Remove AppSearch from Android R.
Test: presubmit
Bug: 150249538
Change-Id: I0a87b9d893bc76acf5ac5e8684f450b9a4f2a0cd
2020-02-25 17:16:41 -08:00
Automerger Merge Worker
6fb054854f Merge "Add min_sdk_version property to apexes" am: 414d50c35d am: cca4f68ddf
Change-Id: Ia6a7ed104652bfe282d513e419da2f8d6a21a82c
2020-02-25 16:06:25 +00:00
Colin Cross
414d50c35d Merge "Add min_sdk_version property to apexes" 2020-02-25 15:34:26 +00:00
Jooyung Han
b7bebe2616 apex: do not follow jni_libs from android_app
Because APK-in-APEX embeds its jni_libs in it. We don't have to follow
deps of jni_libs.

Bug: 146992436
Test: m com.android.tethering
      deapexer extract com.android.tethering.apex apex
      ls apex # there should be no /lib dir

Change-Id: Ifa1a6430a420ae7376b155cd59b8ece462cced7e
2020-02-25 20:47:04 +09:00
Colin Cross
50317874ff Add min_sdk_version property to apexes
Add a min_sdk_version property apexes.  Currently a noop, but will
be used to enforce that dependencies are compatible with the
specified version.

Test: m checkbuild
Bug: 149591522
Change-Id: I923773c90fe15becbffae3986791aa9edde8f8f6
2020-02-21 14:54:31 -08:00
Automerger Merge Worker
f9c738d084 Allow for setting a logging_parent for an Apex. am: 004d717158 am: f4fa3fe81e am: 833162725c
Change-Id: Ifa85d785453e5e363b4b374ce0ea1d12963cafbb
2020-02-21 18:05:12 +00:00
Baligh Uddin
004d717158 Allow for setting a logging_parent for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Change-Id: Ib3749e59f5e31903f2dbe75f86534738147a55ec
2020-02-21 16:59:26 +00:00
Automerger Merge Worker
7094cbc872 Merge "have a per-module switch to turn the symlinking optimizaiton off" am: eb9b9f23ec am: 67a0970d4f am: 279f6f1c80
Change-Id: Iae286618eb0206d7d9b0c40369048e5f38fb6084
2020-02-20 02:22:14 +00:00
Jiyong Park
eb9b9f23ec Merge "have a per-module switch to turn the symlinking optimizaiton off" 2020-02-20 01:47:57 +00:00
Automerger Merge Worker
ddf8057250 Merge "Permissions XML file for java_sdk_library is mutated for APEX" am: 2d6d5d8995 am: dcf5cfaea5 am: ba87e454cb
Change-Id: If143ba1b41e7374d2c92e91c5a5906370ce1f6c4
2020-02-20 00:50:53 +00:00
Jiyong Park
2d6d5d8995 Merge "Permissions XML file for java_sdk_library is mutated for APEX" 2020-02-19 23:57:14 +00:00
Jiyong Park
9d677206d1 have a per-module switch to turn the symlinking optimizaiton off
The optimization is confusing syshealth because the modules will use
more memory when they are switched to the prebuilt (unbundled) or
updated via Play.

Let's have a per-module switch to control the behavior and turn it on
only for non-updatable modules like ART.

Bug: 149805758
Test: m
Change-Id: Ieb842c47f31f3b06e403b1e1f9e463c3e5524107
2020-02-19 20:16:25 +09:00
Jiyong Park
e383388f98 Permissions XML file for java_sdk_library is mutated for APEX
This change fixes a regression that was introduced with
I597bccbb177b6b6320c3a3edeff467243230d384. With the change, the content
of the permissions XML file for a java_sdk_library was determined before
the java_sdk_library is mutated for an APEX. As a result, the file path
to the implementation jar library was always set to
/system/framework/*.jar regardless of whether the java_sdk_library is
part of an APEX or not.

This change fixes the problem, by creating the permissions XML file via
a new module type. The content of the xml file is determined after the
xml file is mutated for APEXes.

Bug: 149600642
Test: m

Change-Id: Id21f8d8285df49b0b3be1daf0f101f2bc978eeb0
2020-02-19 09:47:37 +09:00
Automerger Merge Worker
e81fff6889 Merge "Statically link the unwinder into binaries packaged into an unbundled APEX with legacy_android10_support: true." am: d8b80bc683 am: 4b20d12832 am: 7fe957e171
Change-Id: Ic27432ee08f3acd6052ceeacb56249077a5edf65
2020-02-18 21:48:42 +00:00
Peter Collingbourne
dc4f986b2a Statically link the unwinder into binaries packaged into an unbundled APEX with legacy_android10_support: true.
Bug: 149075752
Test: tapas com.android.conscrypt com.android.tethering arm64
Test: m out/target/product/generic_arm64/{,symbols/}apex/com.android.{tethering,conscrypt}/lib64/libc++.so
Test: Verified that unwinder was dynamically linked to tethering's
Test: libc++ and statically linked to conscrypt's.
Test: lunch flame-userdebug && m
Test: Verified that unwinder was dynamically linked to /system/lib64/libc++.so
Change-Id: I98eed7cb4316962b19b5c12e150c224c25d0e91d
2020-02-13 22:29:44 -08:00
Jeffrey Huang
946f7d4600 Merge "Remove liblog from whitelist" am: 7d8ecd0bc1 am: e7f62e9019 am: 7fc4e23f00
Change-Id: Ib57efd0d3f3e36059edd92a5f9722c4b4623e5fd
2020-02-14 01:30:42 +00:00
Jeffrey Huang
7d8ecd0bc1 Merge "Remove liblog from whitelist" 2020-02-14 00:45:22 +00:00
Treehugger Robot
cf56a70cd2 Merge "apexDepsMutator is a top-down mutator" am: 680afd7bc7 am: 933fb89a3f am: c798bcde06
Change-Id: I4695d3aa1231ff40d4a6570a0973360ebd9bf01d
2020-02-13 22:59:40 +00:00
Treehugger Robot
680afd7bc7 Merge "apexDepsMutator is a top-down mutator" 2020-02-13 22:29:23 +00:00
Jeffrey Huang
f0ae6ccaa7 Remove liblog from whitelist
Bug: 145923087
Test: m -j
Change-Id: Ib1b711c01262ce9466cdd49daa3cc7142376004c
2020-02-13 12:33:39 -08:00
Automerger Merge Worker
2bd5ffa8d4 Update apex.go to remove libutils am: 9401b187f8 am: 8aac3e3c0d am: 762abb8e1c
Change-Id: Ib964dc1b1dbc1e3c724c6174bc1e36763fe777b4
2020-02-13 06:48:23 +00:00
Jeffrey Huang
9401b187f8 Update apex.go to remove libutils
Bug: 145922701
Test: m -j
Change-Id: I13078f43129a7a9478b9bb97bb94c2c70fdb148c
2020-02-12 17:35:59 -08:00
Automerger Merge Worker
8014e606dd Merge "Update apex dependency even for test and non-installable APEXes" am: 4e29184a4e am: ee239878f4 am: 088d5cf1cb
Change-Id: I68fe4bcf81ccc2cd9b16857c59cc1d484a006547
2020-02-12 08:11:23 +00:00
Jiyong Park
f760cae41b apexDepsMutator is a top-down mutator
apex { name: ["myapex"], native_shared_libs: ["libX", "libY"] }
cc_library { name: "libX", shared_libs: ["libY"] }
cc_library { name: "libY", shared_libs: ["libZ"], stubs: {...} }

apexDepsMutator was a bottom up mutator and it uses WalkDeps to traverse
the dependency tree rooted at myapex in a depth-first order. While
traversing the tree, if calls BuildForApex for a module that will be
part of the APEX.

libY is visited twice. Once via libX and once via myapex. If the visit
from libX was before the visit from myapex (since this is a depth-first
traversing), BuildForApex is not called for libY and its dependency
libZ, because libY provides a stub. And then when libY is again visited
via myapex, BuildForApex is correctly called for the module, but not for
its dependencies libZ because the paths from libY to libZ was already
visited.

As a result, the apex variant of libY has a dependency to the non-apex
variant of libZ.

Fixing the problem by changing the mutator a top-down one.

Bug: 148645937
Test: m
Change-Id: Ib2cb28852087c63a568b3fd036504e9261cf0782
2020-02-12 17:01:26 +09:00
Treehugger Robot
4e29184a4e Merge "Update apex dependency even for test and non-installable APEXes" 2020-02-12 07:45:47 +00:00
Automerger Merge Worker
db7d85cc51 Merge "<apex_name>-deps-info correctly tracks dependencies" am: 2bb26d3fad am: 39b51a899f am: 5a14677e31
Change-Id: I54d0ececcb8e0a6c92ce13666f922a42cc80efbd
2020-02-12 01:18:44 +00:00
Jiyong Park
2bb26d3fad Merge "<apex_name>-deps-info correctly tracks dependencies" 2020-02-12 00:47:21 +00:00
Jiyong Park
ab872e0295 Update apex dependency even for test and non-installable APEXes
The apex dependency map wasn't updated for test or non-installable
APEXes to work around the problem that a module being in such APEX
prevented the module from being installed in the system partition.

Since that problem is not happening any more, removing the unnecessary
work-around.

Bug: 123892969
Test: m
Change-Id: I43e07a9611a3e08ff39b9a64454b1c67949d35bc
2020-02-12 07:45:16 +09:00
Automerger Merge Worker
cc5564d707 Merge "rm libbinderthreadstate" am: 7072100760 am: 897d8b2612 am: b115ea1d5f
Change-Id: I82b9cb9c16840796cd6e2485189de57f17360873
2020-02-11 19:07:00 +00:00
Steven Moreland
7072100760 Merge "rm libbinderthreadstate" 2020-02-11 18:45:39 +00:00
Automerger Merge Worker
e7184139f6 Merge "Document apex and apex_test" am: a871ee2067 am: e0d6f7d9d3 am: d27a333182
Change-Id: Iabbff9fe6d65618de71347ead245fc43136454c9
2020-02-11 03:39:25 +00:00
Jiyong Park
fce0b4209f Document apex and apex_test
Bug: 149082647
Test: m
Change-Id: I39e72eecda1d0e2984a3dde4987c4928f58d2afc
2020-02-11 03:56:06 +09:00
Automerger Merge Worker
0ec2b81ee5 Merge "add walkPayloadDeps" am: 58b5030e30 am: 1cf0db8136 am: 230eceddce
Change-Id: Id9b071d99aa88fcfad5af8500836e0971f694647
2020-02-10 06:16:59 +00:00
Jiyong Park
58b5030e30 Merge "add walkPayloadDeps" 2020-02-10 05:20:59 +00:00
Steven Moreland
14850a5139 rm libbinderthreadstate
This library is empty, and its functionality has moved
into libbinder/libhwbinder.

Bug: 148692216
Test: N/A
Change-Id: I5874efda9ab43fc00cf90395a1aabde45cf49579
2020-02-07 16:22:28 -08:00