Commit graph

1991 commits

Author SHA1 Message Date
Ulya Trafimovich
ef4358e536 Make PRODUCT_BOOT_JARS and PRODUCT_UPDATABLE_BOOT_JARS disjoint.
This is to unify boot jars with system server jars:
PRODUCT_SYSTEM_SERVER_JARS and PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS
do not overlap.

Test: walleye-userdebug boots

Bug: 146363577
Change-Id: If001049a46f8e9d38921dabeedbd61e971ebfe73
2020-02-10 17:56:09 +00:00
Automerger Merge Worker
4056e5044b java_sdk_library_import - Allow it to replace java_sdk_library am: 0bdcb27970 am: 3a12c94bc9 am: 58c8790849
Change-Id: I2d249bb20be3943e843f0d281a1988fedeb80001
2020-02-10 11:27:32 +00:00
Automerger Merge Worker
ae629959e0 Merge "java_sdk_library - pass patch_module through to stubs library" am: 3b531e3c85 am: f731846322 am: 0f40429eed
Change-Id: I4319a7bd092fb1ade6d569daf3f7f91874e1cf8d
2020-02-10 11:27:21 +00:00
Paul Duffin
0bdcb27970 java_sdk_library_import - Allow it to replace java_sdk_library
Previously a java_sdk_library_import module did not replace the
corresponding java_sdk_library module, even when it was marked as
prefer=true. That is because the java_sdk_library_import had an empty
set of sources.	However, the stubs modules that are created by the
java_sdk_library_import did override the stubs modules created by the
corresponding java_sdk_library module.

That created inconsistent behavior between the cases where only the
prebuilt is available and both source and prebuilt are available and
the prebuilt is preferred. e.g. assume a java_sdk_library/import module
called SDKLIB.

When both prebuilt and source modules are available for SDKLIB then
even if the prebuilt is preferred then any dependencies on the
SDKLIB module would use the source module.

This change fixes that inconsisteny by making the array of sources
non-empty.

Bug: 148080325
Test: m droid && TARGET_BUILD_APPS=Camera2 m
Change-Id: I25395e020393921735ada20c5492f27f1260f6c5
2020-02-10 10:45:29 +00:00
Paul Duffin
3b531e3c85 Merge "java_sdk_library - pass patch_module through to stubs library" 2020-02-10 10:42:34 +00:00
Automerger Merge Worker
037a2ebe04 Merge "Remove UseApexImage and GenerateApexImage." am: d862f0bce7 am: a80e0e808b am: d8029aa391
Change-Id: I18ccfbc97c076ba1d1c4bad9ccb77225fe3caf01
2020-02-09 23:44:08 +00:00
Nicolas Geoffray
d862f0bce7 Merge "Remove UseApexImage and GenerateApexImage." 2020-02-09 22:53:56 +00:00
Automerger Merge Worker
f8f5535fe7 Fix sdk aidl include for droiddoc am: 26bf49b0b2 am: 0130538069 am: 5f327eccc1
Change-Id: I16869c333576cdba8121c33d2416b7ca8f0e1eb0
2020-02-09 14:10:08 +00:00
Anton Hansson
26bf49b0b2 Fix sdk aidl include for droiddoc
Prior to this change droidstubs modules that set sdk_version
did not get framework.aidl added to its aidl includes.

Bug: 149138391
Test: patch CL in bug && m system_aidl_test-droidstubs
Change-Id: I92ab344c8a4311e10c1e5c8ebf525fa2dc704075
(cherry picked from commit f278ca60e06da86c67f6a3865c290f8451657ce9)
2020-02-08 20:37:07 +00:00
Paul Duffin
ab8da5dd53 java_sdk_library - pass patch_module through to stubs library
When building java.lang classes it is necessary to compile them using
patch_module: "java.base". This change causes patch_module to be passed
through to the java_library created to compile the stubs to allow this
to be used to generate stubs for java.lang.

Test: m droid
Change-Id: I7c27953a5d782eeedd7f25e849ab444d28e28228
2020-02-08 10:38:52 +00:00
Automerger Merge Worker
8401f47238 Merge "Add java_system_modules to sdk/module_exports" am: 568a82a36e am: 47511a0393 am: 5ce0ebb0df
Change-Id: Ie4414798a4ce32b6d943260ec6229fde9abc005d
2020-02-07 18:43:18 +00:00
Treehugger Robot
568a82a36e Merge "Add java_system_modules to sdk/module_exports" 2020-02-07 17:57:08 +00:00
Automerger Merge Worker
cb6b52ae03 Merge "Support dexpreopt against the primary boot image." am: 396b950a1b am: aa112da5c3 am: 32f41f49e9
Change-Id: I19425c4c6574b6f65afc229e4a3813a12f68dce3
2020-02-07 15:05:42 +00:00
Nicolas Geoffray
73d5983af0 Remove UseApexImage and GenerateApexImage.
These options are not used anymore.

Bug: 119800099
Test: m
Change-Id: I4568ff23ed71a5c288ed87828aed6e4bc4f8bd4d
2020-02-07 14:19:28 +00:00
Vladimir Marko
396b950a1b Merge "Support dexpreopt against the primary boot image." 2020-02-07 14:12:52 +00:00
Paul Duffin
7b81f5e9d7 Add java_system_modules to sdk/module_exports
Adds an SdkMemberType implementation for java_system_modules. It
specifies that java_system_modules can be used with sdk as well as
module_exports, and also that the libs property should be included
as transitive members in the sdk.

It also adds support for treating appropriate tagged properties in
the snapshot prebuilts module as references to sdk members so that
they are correctly transformed when creating the versioned modules.

Bug: 142940300
Test: m nothing
Change-Id: Ic10b5a6d5b92b6018334fe876f06feaf79cc55e9
2020-02-07 14:03:03 +00:00
Automerger Merge Worker
b9580d46fd Merge "java_sdk_library - Allow it to be replaced by prebuilt" am: 9be2556d90 am: e1c279f889 am: d690690d63
Change-Id: I4f276ce93edf7a92963f71f8f2e1542ea81c2ca9
2020-02-07 11:57:38 +00:00
Treehugger Robot
9be2556d90 Merge "java_sdk_library - Allow it to be replaced by prebuilt" 2020-02-07 11:16:41 +00:00
Vladimir Marko
40139d6422 Support dexpreopt against the primary boot image.
Framework and other dex files are used without image.

Test: taimen-userdebug boots when built with
      DEXPREOPT_USE_ART_IMAGE=true
Test: Check logcat for checksum verification failures.
      (Build ART with extra logging in OatFileAssistant.)
Test: Check that bootclasspath-checksums from some prebuilt
      oat files (say input.odex) contain only one image
      checksum followed by dex file checksums with
          grep -az -A1 -E '^bootclasspath-checksums$' <oat-file> | \
          xargs -0 echo | gawk '{print $2}'
Bug: 119800099
Change-Id: I65c2f247656e41f2c37df1ecb9e06af7dabab76e
2020-02-07 10:32:50 +00:00
Automerger Merge Worker
c533676987 Merge "java_sdk_library - Use prebuilt/prefer for unbundled app builds" am: 7300095182 am: bef2f16ca4 am: 81142bc17b
Change-Id: I3bf32b042a8707f80a21508705990970e63df688
2020-02-07 06:25:45 +00:00
Treehugger Robot
7300095182 Merge "java_sdk_library - Use prebuilt/prefer for unbundled app builds" 2020-02-07 05:28:35 +00:00
Paul Duffin
e74ac73bc9 java_sdk_library - Allow it to be replaced by prebuilt
Previously, a java_sdk_library called "SDKLIB" would create a
prebuilt_etc module called "SDKLIB.xml" which installs the generated
XML permission file to /etc/permissions/SDKLIB.xml. That module
depended on the java_sdk_library "SDKLIB" to generate the XML file
as one of its outputs by specifying srcs: [":SDKLIB{.xml}"].

If the java_sdk_library is replaced by a prebuilt then the SDKLIB.xml
module expects the prebuilt to provide the XML permissions file which
it doesn't because that is an implementation detail and so the build
breaks.

A couple of alternative approaches were looked at to fix this. One was
to have the logic that replaced the source module with the prebuilt to
inform the source module that it was being replaced so it could disable
its created module. That lead to a dependency cycle where
    SDKLIB -> SDKLIB.xml -> SDKLIB{.xml}

Another solution was to mark dependency tags in such a way that the
prebuilt could automatically identify and disable the SDKLIB.xml
module. Similar to how the visibility code will ignore dependencies
that are tagged with ExcludeFromVisibilityEnforcementTag. That became
very convoluted.

Instead the java_sdk_library was changed so that it was not responsible
for creating the XML permissions file. Instead it created a genrule
called "gen-SDKLIB.xml" to create it and then "SDKLIB.xml" depended on
that. The java_sdk_library also depended on the genrule to make the XML
permissions file available for APEX and testing.

Some refactoring of the APEX code and tests was necessary because they
had knowledge of the internal implementation of java_sdk_library. The
refactoring insulates them a little better from those details.

Bug: 148080325
Test: m droid && TARGET_BUILD_APPS=Camera2 m
Change-Id: I597bccbb177b6b6320c3a3edeff467243230d384
2020-02-06 15:58:05 +00:00
Jiyong Park
0f80c1848a apex_available tracks static dependencies
This change fixes a bug that apex_available is not enforced for static
dependencies. For example, a module with 'apex_available:
["//apex_available:platform"]' was able to be statically linked to any
APEX. This was happening because the check was done on the modules that
are actually installed to an APEX. Static dependencies of the modules
were not counted as they are not installed to the APEX as files.

Fixing this bug by doing the check by traversing the tree in the method
checkApexAvailability.

This change includes a few number of related changes:

1) DepIsInSameApex implementation for cc.Module was changed as well.
Previuosly, it returned false only when the dependency is actually a
stub variant of a lib. Now, it returns false when the dependency has one
or more stub variants. To understand why, we need to recall that when
there is a dependency to a lib having stubs, we actually create two
dependencies: to the non-stub variant and to the stub variant during the
DepsMutator phase. And later in the build action generation phase, we
choose one of them depending on the context. Also recall that an APEX
variant is created only when DepIsInSameApex returns true. Given these,
with the previous implementatin of DepIsInSameApex, we did create apex
variants of the non-stub variant of the dependency, while not creating
the apex variant for the stub variant. This is not right; we needlessly
created the apex variant. The extra apex variant has caused no harm so
far, but since the apex_available check became more correct, it actually
breaks the build. To fix the issue, we stop creating the APEX variant
both for non-stub and stub variants.

2) platform variant is created regardless of the apex_available value.
This is required for the case when a library X that provides stub is in
an APEX A and is configured to be available only for A. In that case,
libs in other APEX can't use the stub library since the stub library is
mutated only for apex A. By creating the platform variant for the stub
library, it can be used from outside as the default dependency variation
is set to the platform variant when creating the APEX variations.

3) The ApexAvailableWhitelist is added with the dependencies that were
revealed with this change.

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

Bug: 147671264
Test: m

Merged-In: Iaedc05494085ff4e8af227a6392bdd0c338b8e6e
(cherry picked from commit fa89944c79)
Change-Id: Iaedc05494085ff4e8af227a6392bdd0c338b8e6e
2020-02-06 14:45:08 +09:00
TreeHugger Robot
54f58bdb8e Merge changes from topic "apex_available"
* changes:
  shared_lib dependency from a static lib crosses the APEX boundary
  apex_available tracks static dependencies
2020-02-06 05:37:37 +00:00
Automerger Merge Worker
37c98748ea Merge "sdk_version: "module_current" is supported" am: c4930248c4 am: e04b901737 am: 5ca166b2a9
Change-Id: I8dcd37faa79f265ea144798c1753c62485707f79
2020-02-06 04:40:23 +00:00
Treehugger Robot
c4930248c4 Merge "sdk_version: "module_current" is supported" 2020-02-06 03:50:43 +00:00
Jiyong Park
fa89944c79 apex_available tracks static dependencies
This change fixes a bug that apex_available is not enforced for static
dependencies. For example, a module with 'apex_available:
["//apex_available:platform"]' was able to be statically linked to any
APEX. This was happening because the check was done on the modules that
are actually installed to an APEX. Static dependencies of the modules
were not counted as they are not installed to the APEX as files.

Fixing this bug by doing the check by traversing the tree in the method
checkApexAvailability.

This change includes a few number of related changes:

1) DepIsInSameApex implementation for cc.Module was changed as well.
Previuosly, it returned false only when the dependency is actually a
stub variant of a lib. Now, it returns false when the dependency has one
or more stub variants. To understand why, we need to recall that when
there is a dependency to a lib having stubs, we actually create two
dependencies: to the non-stub variant and to the stub variant during the
DepsMutator phase. And later in the build action generation phase, we
choose one of them depending on the context. Also recall that an APEX
variant is created only when DepIsInSameApex returns true. Given these,
with the previous implementatin of DepIsInSameApex, we did create apex
variants of the non-stub variant of the dependency, while not creating
the apex variant for the stub variant. This is not right; we needlessly
created the apex variant. The extra apex variant has caused no harm so
far, but since the apex_available check became more correct, it actually
breaks the build. To fix the issue, we stop creating the APEX variant
both for non-stub and stub variants.

2) platform variant is created regardless of the apex_available value.
This is required for the case when a library X that provides stub is in
an APEX A and is configured to be available only for A. In that case,
libs in other APEX can't use the stub library since the stub library is
mutated only for apex A. By creating the platform variant for the stub
library, it can be used from outside as the default dependency variation
is set to the platform variant when creating the APEX variations.

3) The ApexAvailableWhitelist is added with the dependencies that were
revealed with this change.

Bug: 147671264
Test: m

Change-Id: Iaedc05494085ff4e8af227a6392bdd0c338b8e6e
2020-02-06 09:16:19 +09:00
Automerger Merge Worker
7dc1ab5712 Merge "Add rules to handle asset resources." am: 387ad5c576 am: d75a5b879f am: 43db53b708
Change-Id: Ib005d9b417c8ec3bf9d5c55405f4345c58ad3390
2020-02-05 23:48:06 +00:00
Jaewoong Jung
387ad5c576 Merge "Add rules to handle asset resources." 2020-02-05 22:24:39 +00:00
Automerger Merge Worker
fc375087a3 Merge "Add support for compat config in APEX." am: 86a5dc5575 am: a53ed40948 am: 085528a57a
Change-Id: I3306751d7bf7ac39656e26e6556a36c8ea536f6f
2020-02-05 20:08:07 +00:00
atrost
6e12625c0f Add support for compat config in APEX.
apex module accepts PlatformCompatConfigIntf as prebuilt,
and places it in the etc folder of the apex.

Test: m
Test: flash device with dummy config in mediaprovider APEX -
the config is present
Change-Id: Ifc62cd262f6c6571c1bf6c2943879aa20877ecad
2020-02-05 13:33:50 +00:00
Automerger Merge Worker
6adb8c790a Merge "java_sdk_library use prebuilt jars for numeric sdk_version" am: 50fea3b6a7 am: f2e4ef549c am: bf6bc94be8
Change-Id: I32572f0213f1563989c8e61778fe682ed8e3db20
2020-02-05 08:34:44 +00:00
Paul Duffin
50061511d4 java_sdk_library - Use prebuilt/prefer for unbundled app builds
Previously, the java_sdk_library had special support for disabling the
stubs library when the build was configured to use prebuilts for sdks,
e.g. in an unbundled app build. That caused the prebuilt version of the
stubs library to be used instead. The disabling was done irrespective
of whether a prebuilt was available which prevents java_sdk_library
from being used in situations when prebuilts are not available, e.g.
when they have not been created yet.

This change moves the logic into tha java_sdk_library_import and
leverages the existing prebuilt/prefer mechanism to ensure that the
prebuilt version is used when required.

* Adds a ForcePrefer() method to Prebuilt to allow a module to forcibly
  set the value of the prefer property.
* Sets prefer true on the java_sdk_library_import and the stubs modules
  it creates when the prebuilt version should be used.
* Refactors PrebuiltJars for use by both java_sdk_library and
  java_sdk_library_import as they both need to provide access to
  prebuilts for previously released versions of the library.
* Removes disabling logic from java_sdk_library.

This will probably require some additional java_sdk_library_import
modules to be added to prebuilts/sdk/current/Android.bp.

Bug: 148080325
Test: m droid && TARGET_BUILD_APPS=Camera2 m
Change-Id: I0b5f751e82a2179a967ae64ca03dc9b9e7665c16
2020-02-05 08:09:57 +00:00
Paul Duffin
50fea3b6a7 Merge "java_sdk_library use prebuilt jars for numeric sdk_version" 2020-02-05 08:06:52 +00:00
Automerger Merge Worker
577f77c33e Merge "Build rules for compat config docs generation." am: 026ffecb9d am: 5467f3b9ba am: 78ec3d4b73
Change-Id: Iadaab6a5c196e7633a782dcbbaad928798270328
2020-02-04 17:01:33 +00:00
Anna Trostanetski
026ffecb9d Merge "Build rules for compat config docs generation." 2020-02-04 16:28:40 +00:00
Mathew Inwood
abd49ab4df Build rules for compat config docs generation.
We add a compat config build rule to extract the merged config, and
then update the droiddoc build rule to consume that.

Test: m -j offline-sdk-docs
Bug: 144927670
Change-Id: Ib1e85f97895c89227882e665572bda9bfc2a8cba
Exempt-From-Owner-Approval: ag/10097965 approved internally, Colin requested to patch to aosp
2020-02-04 16:28:22 +00:00
Paul Duffin
a2db18fb1e java_sdk_library use prebuilt jars for numeric sdk_version
Previously, when a library that used a numeric sdk version also
referenced a java_sdk_library it would use the current version of its
API. That was dangerous as there is an expectation that an app building
against a numbered version will also be targeted at that version and
so building against a later version of the API could hide runtime
incompatibilities.

This change will use prebuilt versions of the java_sdk_library's api
when being built for a numbered sdk version.

Bug: 148080325
Test: m droid
Change-Id: I3fd416553950785a443c1702e495a96debc33331
2020-02-04 14:47:04 +00:00
Automerger Merge Worker
f36215b3f5 Merge changes from topic "expose-system-test" am: 1b57531573 am: 364fbba51e am: 9462495940
Change-Id: I670fe7ce6ce8412b4db8ba8c778fff713c3c891f
2020-02-04 08:56:39 +00:00
Automerger Merge Worker
0a18203451 java_sdk_library_import - expose system and test stubs am: 56d4490d59 am: 914c7e38ad am: 5fd7242dea
Change-Id: I3aaca8b8f30e9dcb6096a6dc6e0adaed15838a6a
2020-02-04 08:56:36 +00:00
Automerger Merge Worker
914c7e38ad java_sdk_library_import - expose system and test stubs am: 56d4490d59
Change-Id: Ic3c8c2519001405cd004214e52a4685d9bd68657
2020-02-04 08:34:15 +00:00
Paul Duffin
1b57531573 Merge changes from topic "expose-system-test"
* changes:
  Remove legacy properties from java_sdk_library_import
  java_sdk_library_import - expose system and test stubs
2020-02-04 08:26:30 +00:00
Automerger Merge Worker
fbcc073910 Merge "Export the cert path for runtime_resource_overlay." am: 411a98a917 am: f0c7ebd377 am: bd91f26447
Change-Id: Ic956708566076e769ffb4aafc0d02664f070a823
2020-02-03 18:22:02 +00:00
Jaewoong Jung
411a98a917 Merge "Export the cert path for runtime_resource_overlay." 2020-02-03 17:43:46 +00:00
Paul Duffin
56d4490d59 java_sdk_library_import - expose system and test stubs
Previously, the java_sdk_library_import only exposed the public stubs.
This change adds support for exposing system and test stubs too by adding
separate structures for public, system and test scopes. The existing
properties are kept for legacy reasons (and because libs can be common
across the differents scopes).

It extracts some code that is common to both sdk library and sdk
library import.

The legacy support will be removed in a future change once all existing
usages have been switched over.

Bug: 148080325
Test: m droid
      TARGET_BUILD_APPS=Camera2 m
Change-Id: I0b26cc8af9ee044437ff3b80c1eca611816b9386
2020-02-03 15:58:08 +00:00
Paul Duffin
fcfd79166c Remove legacy properties from java_sdk_library_import
The legacy usages have all been updated so the legacy properties
can be safely removed. The Libs property is kept so it can be used to
specify properties common to all scopes.

Bug: 148080325
Test: m droid
      TARGET_BUILD_APPS=Camera2 m

Change-Id: I252ebbedbb463db3c7346e86d86b5880eea76fe9
2020-02-03 15:58:08 +00:00
Automerger Merge Worker
1f539d1d0e Merge "Improve java_sdk_library handling of test_current" am: b708108b60 am: 1b6cd581b7 am: 886c506205
Change-Id: I3f1c6df16e073159d37746c99180b999a7f44174
2020-02-01 09:19:21 +00:00
Jaewoong Jung
78ec5d8d6c Export the cert path for runtime_resource_overlay.
Fixes: 119811120
Test: app_test.go
Test: Converted and built IconPackFilledSystemUIOverlay
Change-Id: I3f7eae3127996773c5abf9f9bdb9d57a198ddaa3
2020-01-31 10:39:40 -08:00
Automerger Merge Worker
fe46418b38 Merge "Parameterize java_sdk_library by api scope" am: b8e5c68fef am: 2f7d7215b1 am: d09578c368
Change-Id: I91b022d54c51dbd5880e7e6c19d776775b2a5584
2020-01-31 17:14:33 +00:00
Automerger Merge Worker
009b117b67 Merge "Use merge_csv python_binary." am: 44fc5d201f am: 17fc5e20c9 am: 10874f33a3
Change-Id: I94fd82782a4c2de9e0f052085dcc027c07e8bd3d
2020-01-31 16:32:23 +00:00