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
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
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
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
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
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
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
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
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
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
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
This library is empty, and its functionality has moved
into libbinder/libhwbinder.
Bug: 148692216
Test: N/A
Change-Id: I5874efda9ab43fc00cf90395a1aabde45cf49579
The APEX dependency is more correctly tracked. Previously, the
dependency was tracked while we gather modules that will be installed to
an APEX. This actually was incorrect because we skipped many dependency
types that we don't need to follow to gather the modules list, such as
the headers dependency.
Now, the dependency is tracked directly when a module is mutated for an
APEX. In other words, if a module is mutated for an apex X, then the
module will appear in the X-deps-into.txt file.
This change also changes the format of the txt file. It now clearly
shows why a module is included in the APEX by showing the list of
modules that depend on the module.
Bug: 146323213
Test: m
Change-Id: I0a70cf9cce56e36565f9d55683fdaace8748a081
The function visits dependencies of an APEX that contribute to the
payload. checkApexAvailability is rewritten using the generic function.
There is no change in behavior.
Bug: N/A
Test: m
Change-Id: I1a8b4eb0a60a432f667a61b4f6f457c3b8f1cd3d
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
Currently, com.android.runtime provides libc/libm/libdl to system. But
they are supposed to be used from symlinks under /system/lib not
directly from runtime apex.
This helps linkerconfig to generate ld.config.txt automatically for
apexes.
Bug: 144664390
Test: m com.android.runtime
deapexer info com.android.runtime.apex
Change-Id: I1620e88e489fba88a06cc3bd6eb5b86a9b581e4f
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
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
Leaving out LOCAL_CERTIFICATE for flattened apex APKs causes
the apkcerts.txt to have empty keys for those APKs, which
confuses the signing tools. Set LOCAL_CERTIFICATE for them.
Also refactor the Certificate support to avoid introducing
duplicated handling for presigned certificates.
Bug: 147765187
Test: m apkcerts-list
Change-Id: Ife07661761cd5a89c9f009b8ce041db4dff9ec54
This change fixes a bug that license info for non-flattened APEXes are
not captured in /system/etc/NOTICE.xml.gz file. For non-flatted APEXes,
we have been creating NOTICE.html.gz file by concatenating all the
license infos of the modules that contributes to the APEX and embedding
the file into the asset directory of the APEX. Then at runtime, the info
is shown through the "Google Play System Update Licenses" UI. However,
this was problematic because the UI only shows license info for the
Google-signed APEXes, leaving OEM-signed APEXes (a.k.a. optional
modules).
The problem is now fixed by associating a merged license file with each
APEX and exporting them to Make, so that the merged license files are
included in the partition level /system/etc/NOTICE.xml.gz file
regardless of whether the APEX is a Google-signed one or not.
This also fixes a bug that license info entries are created for the
runtime paths /apex/<apex_name>/<path_to_a_file>, which is not necessary
as they are already included in the license info of the containing APEX.
Bug: N/A
Test: Go to Settings->About Phone->Legal information and check
that a) /system/apex/*.apex files are shown and b) /apex/<apex_name>/*
files are not shown
Change-Id: I2c25c803b6a4c39b24bb3f724502699382fab50c
This reverts commit 5df3b11f78.
Reason for revert: re-land with a fix
Fix a broken soong test
Add implicit dependency (libprofile-clang-extra) to make a test pass.
Bug: n/a
Test: m
Change-Id: I0b179199bc032501354f8e24782837453781bd8c
VNDK APEX is supposed to contain "vendor" variants of VNDK libraries.
This is different from normal APEXes which have "apex" variants.
Bug: 146758869
Test: build / flash / boot
Change-Id: I5e035678c337334092616b58d2e0e404788a6639
Exempt-From-Owner-Approval: Got ORV, but rebased with resolving merge conflicts.
This reverts commit 31c65d4fe4.
Bug: 144533348
Test: checkout master-art-host and run
ALLOW_MISSING_DEPENDENCIES=true DIST_DIR=out/dist /art/tools/dist_linux_bionic.sh -j80 com.android.art.host
the result is successful
Change-Id: Ica11eec9b64867088b16720a41c6d83905976ec5
This means everything that goes into apexes need to be
explicitly labeled to be available for apex.
Whitelist the current offenders. This list should be
trimmed down.
Bug: 147364041
Test: m
Test: multiproduct_kati -only-soong
Exempt-From-Owner-Approval: cherry-pick from internal
Change-Id: I837299c6a15d46f8a5ba544b613776b1cc27d7b8
Merged-In: I837299c6a15d46f8a5ba544b613776b1cc27d7b8
(cherry picked from commit 93488cbb10d4882845abb732f8e53714f0982031)
For each APEX, <apexname>-installed-files.txt is dist'ed to show the
list of files and their sizes that are included in the APEX.
Bug: 147605944
Test: m dist and examine the txt files
Change-Id: I565479523e51280fc88d5fbf8ea3f48ac0ae9fee