android_app_import and android_test_import modules with processed: true
and skip_preprocessed_apk_checks are used directly from the source tree.
If the source file name doesn t match the module name and the file is
used as test data it can result in the wrong filename being used. Copy
the source file to an output file with the correct name first.
Bug: 290376750
Test: m CtsAppSecurityHostTestCases
(cherry picked from https://android-review.googlesource.com/q/commit:5780d57a7116643c6d9eac735982ac44bd6b0189)
Merged-In: I4a6dd1c5e48db7085ea41035def31f0844948a46
Change-Id: I4a6dd1c5e48db7085ea41035def31f0844948a46
If a header jar couldn't be built (for example when an API generating
annoation processor is in use) the implementation jar is reused as the
header jar. If the implementation jar contains an annotation processor
listed in META-INF/services/javax.annotation.processing.Processor then
later javac executions with the implementation jar in the classpath
could attempt to run the annotation processors unexpectedly. Remove
the META-INF/services directory when using an implementation jar as
a header jar.
Bug: 290933559
Test: builds
(cherry picked from commit f06d8dc8e3)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:d3b1b77184b1c002136039e70074899a35b1ed77)
Merged-In: I40d48644bc5a09a9564dc2c4b38f627edd00fcf8
Change-Id: I40d48644bc5a09a9564dc2c4b38f627edd00fcf8
Currently, Soong changes in aosp are not merged to udc-mainline-prod,
while the mainline projects changes from aosp are merged. This leads to
a conflicting build configuration issue for aosp-first projects, which
want to maintain consistent bp module definition between aosp and main.
In order to support specifying `aconfig_declaration` property in aosp
for mainline projects, this change adds the property to the module
definition while not performing any build actions, in order to resolve
presubmit failures in udc-mainline-prod when specifying the property in
aosp changes.
Cherry-picking the aosp changes that introduces the property is not an
option, as the flagging infra is not expected to be imported to
udc-mainline-prod.
Test: m nothing --no-skip-soong-tests
Bug: 315027929
Merged-In: I37becd1b9dd9069d7ac4abed130906df30b3fdf4
Change-Id: Ie467c1dd4a36774f6268452fae8c054b9b3ad7d9
Ignore-AOSP-First: CPing test_spec rule to udc-mainline-prod to support migration of test targets. Cherry pick of:aosp/2786121
Change-Id: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
Merged-In: I2d7d4684a10c15aeecc27b8db800ab27a807d2e2
This Cl adds a new rule to Soong to generate code ownership metadata. Also, this CL adds a provider in the Java SDK library to provide generated source files to the Code_metadata rule. Will add providers to other libraries in the future changes.
Ignore-AOSP-First: CPing test_spec rule to udc-mainline-prod to support migration of test targets. Cherry pick of:aosp/2786121
Bug: 296873595
Change-Id: Ic2e43aa9b161231fea4416d1f0d36b778361d7c5
Merged-In: Ic2e43aa9b161231fea4416d1f0d36b778361d7c5
Bug: 312536783
Bug: 312536905
Test: m nothing --no-skip-soong-tests -j96
Ignore-AOSP-First: CPing test_spec rule to udc-mainline-prod to support migration of test targets. Cherry pick of:aosp/2836072
Change-Id: I1e12281927269d42ae796348b223030acfd6ecfa
Merged-In: I1e12281927269d42ae796348b223030acfd6ecfa
This CL adds test for test_spec.go and all_test_specs.go (singleton).
Bug: 296873595
Test: m nothing --no-skip-soong-tests -j96
Ignore-AOSP-First: CPing test_spec rule to udc-mainline-prod to support migration of test targets. Cherry pick of:aosp/2836072
Change-Id: I5010c68512e75d1b9a337c02da86faac15e376fe
Merged-In: I5010c68512e75d1b9a337c02da86faac15e376fe
This Cl adds a new rule to Soong to generate test spec metadata. Also, this CL adds a provider in various test module to provide test spec related data to the Soong rule.
Will add providers and test code to other Module in the future changes.
Provider added for the following test modules in this change: android_robolectric_test, android_test, bootclasspath_fragment_test, java_test, java_test_host, python_test, python_test_host, sh_test,and sh_test_host.
Bug: 296873595
Change-Id: I5f89f72d5874bb7838ae357efdb8c6ca208e18a7
Ignore-AOSP-First: CPing test_spec rule to udc-mainline-prod to support migration of test targets. Cherry pick of:aosp/2774872
Change-Id: I23c09ed262915a5f68d6e7a4f21683e0389cd5f6
Merged-In: I5f89f72d5874bb7838ae357efdb8c6ca208e18a7
Previously, the logic to add the Metalava command line option
`--hide-annotation android.annotation.FlaggedApi` when
`SOONG_SDK_SNAPSHOT_HIDE_FLAGGED_APIS=true` was done in
`droidstubs.go`. It worked but it turns out that we need to pass more
options to Metalava in that situation because while we need to hide
most flagged APIs we need to release some flagged APIs whose features
are ready. They cannot have the `@FlaggedApi` annotation removed
because that would cause the APIs to be released in the next QPR which
is not what we want.
So, in addition to the above option we will need to pass additional
options to Metalava to tell it to keep some flagged APIs. Rather than
hard code that in the build, requiring build changes for every new
SDK extension release this change uses the argument expansion mechanism
in Metalava (treating `@<file>` as if the contents of `<file>` were
passed as command line options) to delegate that to
":sdkext-released-flagged-apis".
The easiest way to do that was to move the logic to `sdk_library.go`
as `droidstub` would do the work of tracking the file dependencies
correctly. It also reduces the affect modules to `java_sdk_library`
modules rather than all `droidstubs` modules.
Bug: 313398274
Test: UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_sdks.sh --build-release=next
Change-Id: Ib1cf22f8ef74abc135215537e9311936372eaac7
Merged-In: I4967376c0236bad729398af80fa59b48dbab5f21
Temporary workaround to allow module SDK snapshot builds to hide
flagged APIs until such time as development moves to `main` and
the build in `main` can handle that properly.
Bug: 299570421
Test: UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true vendor/google/build/mainline_modules_sdks.sh
# Check that flagged APIs are excluded from everything but
# for-latest-build.
Change-Id: I5b133b98aab91b2ad5ba717dd663c60a5ed90c9d
Merged-In: I4967376c0236bad729398af80fa59b48dbab5f21
Currently the product variable that is controlled by
APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE only overrides apexes, but it
doesn't apply to android_apps. This commit allows android_apps which set
updatable: true in their Android.bp to have their min_sdk_version be
overriden by this product variable.
Bug: 295311875
Test: go test
(cherry picked from https://android-review.googlesource.com/q/commit:0e0d96efa71e7146f2d43ec9c2fbe66226426811)
Merged-In: If3cb82a17cae4553b577dd1a4637ee13c3c95302
Change-Id: If3cb82a17cae4553b577dd1a4637ee13c3c95302
Bug: 279960392
Test: CI and m --skip-soong-tests TARGET_PRODUCT=aosp_x86_64 EMMA_INSTRUMENT=true CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="external/cronet" mts
(cherry picked from https://android-review.googlesource.com/q/commit:d8aa20062aad83b170b0945b71db79e48daa9fe8)
Merged-In: I4489ed725aee6097e6e340f5f6d06ecaf1c64222
Change-Id: I4489ed725aee6097e6e340f5f6d06ecaf1c64222
That will allow the format of a file to be changed by simply modifying
the signature format in the current API file (e.g. from `2.0` to `3.0`)
and then running `m update-api` and it will just update the current API
file (and the corresponding removed API file).
Bug: 295577788
Test: m checkapi && m update-api
# Also did as described above and modified the
# `libcore/api/current.txt` file from `2.0` to `3.0` and ran
# `m update-api` and checked that only that file and the
# corresponding `removed.text` file was changed.
(cherry picked from https://android-review.googlesource.com/q/commit:10a23c29e279ebfef4869cea72a65207e8de0cab)
Merged-In: I20c9bc151677502cf09b0c06fb442fd385caccdd
Change-Id: I20c9bc151677502cf09b0c06fb442fd385caccdd
Metalava has not differentiated between bootclasspath and classpath for
years so this change replaces the use of the two deprecated single
hyphen options with `--classpath`.
Bug: 295136054
Test: m checkapi
(cherry picked from https://android-review.googlesource.com/q/commit:f8aaaa13f4fb87cc0f7bd5231f2334499d174109)
Merged-In: I3ab20b76a60cab66a27784b7d87a069813d19835
Change-Id: I3ab20b76a60cab66a27784b7d87a069813d19835
`-encoding` and `-source` have been deprecated in metalava.
`-encoding` actually does nothing apart from check to make sure that
the value is `utf-8` (in some case). Metalava always uses `utf-8`.
`-source` has been deprecated in favor of `--java-source` as metalava
also can consume kotlin and it has its own `--kotlin-source` option.
Bug: 295136054
Test: ./gradlew
(cherry picked from https://android-review.googlesource.com/q/commit:808211e519ae43517ae7d6ed5348ffb1e3b63c45)
Merged-In: I08e6931958f40022d65d417360e32b72a1d70444
Change-Id: I08e6931958f40022d65d417360e32b72a1d70444
Previously, `--api-overloaded-method-order source` was the default if
that option was not specified but the other change in this topic is
switching it to `--api-overloaded-method-order signature` to match the
behavior in AndroidX. This change explicitly specifies the option
needed by Soong's use of metalava.
Bug: 294300564
Bug: 285140653
Test: m checkapi
Merged-In: I00e049e0d991e650ab9940a3d495ed2b6e7480f8
Change-Id: I00e049e0d991e650ab9940a3d495ed2b6e7480f8
(cherry picked from commit 7202ffebf9)
Previously, `--api-class-resolution api` was the default if that option
was not specified but the other change in this topic is switching it to
`--api-class-resolution api:classpath` to match the behavior in
AndroidX. This change explicitly specifies the option needed by Soong's
use of metalava.
Bug: 294300564
Bug: 285140653
Test: m checkapi
Merged-In: Ief3c7f9dfdfa946f21cb048a579ec90309fb350f
Change-Id: Ief3c7f9dfdfa946f21cb048a579ec90309fb350f
(cherry picked from commit 5b7035f850)
Metalava no longer looks for common typos. It relies on the code
analyzers that run on Gerrit to detect them.
Bug: 294300564
Bug: 288072162
Test: m checkapi
Change-Id: I08eca8008af39ebe69442db419ebd3d3378aa0de
Merged-In: I08eca8008af39ebe69442db419ebd3d3378aa0de
(cherry picked from commit c0036491cd)
Soong does not enforce apex_available on the contents of test apex. To
prevent special-casing test apexes in the apex validation aspect in
Bazel, drop the test apexes from the tags altogether.
( The core problem I am trying to solve is making sure that stub
libraries in Bazel have a single apex available. apex validation happens
to be a nice side benefit)
Bug: 277651159
Test: go test ./bp2build
(cherry picked from https://android-review.googlesource.com/q/commit:39b6cc53369a6ec132b58d99514cd7a2ea499efd)
Merged-In: Ibb3cfedb5c0f2cda0464bf3758c70b67cb5885d1
Change-Id: Ibb3cfedb5c0f2cda0464bf3758c70b67cb5885d1
Apparently there's some special case-code in package manager that
scans apps as privileged regardless of their location. BT is one
such app -- so allow it to specify a privapp allowlist even though
it isn't in priv-app.
Bug: 284500052
Test: use privapp_allowlist in Bluetooth and its overriddes
Change-Id: Ib9ac86ebc45087a176100fe8df07db7bf81a85a7
Use the APK's filename as the on-device filename for the allowlist.
Previously the filename of the source xml file was used, which leads to
a problem when the same source file is used for different apps (even
if only one of those modules ends up being installed).
Bug: 284500052
Test: app_test.go & presubmit boot tests
(cherry picked from https://android-review.googlesource.com/q/commit:92d1f52790e83952bf305464f0083d8c05f4c557)
Merged-In: I0b43a35e3a310464d79d7f37e0900d639f4a479c
Change-Id: I0b43a35e3a310464d79d7f37e0900d639f4a479c
AndroidMk assumes that the app is the last file installed, and it uses
this assumption to populate the LOCAL_SOONG_INSTALLED_MODULE entry. This
CL moves the privapp_allowlist installation to before the app
installation to respect this assumption.
Bug: 242509786
Test: go test
Test: OUT_DIR=out.ref m nothing &&
cp aosp/2562351 && OUT_DIR=out.change m nothing &&
GOWORK=$PWD/build/bazel/mkcompare/go.work \
go run android/bazel/mkcompare/cmd -json \
<(sed -e "s/out\.ref/out/g" out.ref/soong/Android-aosp_cheetah.mk) \
<(sed -e "s/out\.change/out/g" out.change/soong/Android-aosp_cheetah.mk)
&& verify manually that the only diffs are related to the removal of
the prebuilt_etc module.
(cherry picked from https://android-review.googlesource.com/q/commit:b1daccdc97ae08603b0e2f5eafe97bd11238ee58)
Merged-In: I95ec27070f575e79fb976de68493a219717ed89a
Change-Id: I95ec27070f575e79fb976de68493a219717ed89a
For a non-override android_app, we can assume that the privapp_allowlist
already contains the correct package_name, and so we don't need to
overwrite it in this case.
Bug: 242509786
Test: go test
Ignore-AOSP-First: need to submit here to update PermissionController in sync with internal version
Merged-In: I0f137e34cae3478dc8b9178d138121ff1d936f07
Change-Id: I0f137e34cae3478dc8b9178d138121ff1d936f07
This change allows override_android_app to use the same
privapp_allowlist as the non-override module so that they will always
remain in sync.
Test: go test ./java -v -run TestPrivappAllowlist
Test: go test ./apex -v -run TestApexWithApps
Test: m com.android.permission com.google.android.permission and verify
manually that apex_payload.img contains correct privapp_allowlist
Test: m com.android.permission before and after change &&
`diffoscope apex_payload_reference.img apex_payload_with_change.img`
&& verify that there are no semantic changes
Bug: 242509786
(cherry picked from https://android-review.googlesource.com/q/commit:580636bdd23171f31bfedd773c065e0861dd5c4a)
Merged-In: Ifdcb28af40763aed7a4aac9a7f681153554bc256
Change-Id: Ifdcb28af40763aed7a4aac9a7f681153554bc256
Some targets may implement classes declared elsewhere, e.g., system
server implements services defined in framework-res.apk's manifest.
Allow depending on the aapt-generated proguard flags for a given
target to support this.
Bug: 272495195
Test: m + reference ":framework-res{.aapt.proguardOptionsFile}"
(cherry picked from https://android-review.googlesource.com/q/commit:34b080ddcf7757bba3dcb938df46aa660b2564a0)
Merged-In: I2a16632ed6e5a9bddbe326bdb7ab0dd79b45e587
Change-Id: I2a16632ed6e5a9bddbe326bdb7ab0dd79b45e587
Getting the first certificate will panic if there are no certificates,
which can happen when AllowMissingDependencies is set and the
certificate property is a module reference to a missing module.
Only get the first certificate if the list is not nil.
Use mainCertificate since it handles the logic already.
Test: TestAppMissingCertificateAllowMissingDependencies
Bug: 283102635
Merged-In: : I8b27f65aa7d071041171ad45ac52bf47fa31bf2b
Change-Id: Icaaa45d48ca4edb876687c0813165d107d28ef8a
Build a new target *.latest.version which will contain a text file
containing the last finalized version.
Bug: 242316893, 282140551
Test: atest prebuilt_apis_test
(cherry picked from https://android-review.googlesource.com/q/commit:daa314ac97d5ab8076113ee7f269b4e4cc3cf620)
Merged-In: I41fa91c9ec273f342b7807c66c4d65ba13260124
Change-Id: I41fa91c9ec273f342b7807c66c4d65ba13260124
After this change, there is a clear separation between tests that are
related to dexpreopt and tests that are not. The former uses
PrepareForTestWithDexpreopt, while the latter uses
PrepareForTestWithJavaDefaultModules. The benefit is that the latter
will no longer affected by any dexpreopt changes.
Bug: 280776428
Test: m nothing
(cherry picked from https://android-review.googlesource.com/q/commit:b95998be731406209f18fab764b96421a17ab4c9)
Merged-In: Ib957765b9287d51c082e0a33cee17a6bb56daeef
Change-Id: Ib957765b9287d51c082e0a33cee17a6bb56daeef
As-is, dexpreopt config and bootjar is in the dir including
DeviceName(). It causes unnecessary dexpreopt invocation when target is
changed repeatly. To avoid it, rename dir to common name.
Bug: 278833696
Test: m
(cherry picked from https://android-review.googlesource.com/q/commit:4753b39ccaaf573910e6b7a4200e9ca03ec8d96d)
Merged-In: I2818d9ae09e6c22ca6989cc8efdb70b470ec502c
Change-Id: I2818d9ae09e6c22ca6989cc8efdb70b470ec502c
Bug: 280440941
Test: -
1. Patch ag/22302622 to disable dexpreopt.
2. lunch aosp_cf_x86_64_phone-userdebug && m
3. See app profiles still generated.
Test: -
1. Patch ag/20592051 to enable profile for service-art.
2. banchan com.android.art x86_64 && m
3. See the profile for service-art generated.
(cherry picked from https://android-review.googlesource.com/q/commit:cf61e3c59133227894ac7d72091b48451a3e6761)
Merged-In: I6090b4b74cedb6d129fcbeef58d075c8ccdcc4e2
Change-Id: I4e721b475b84a2f667bbccc030a8947078f26bb0
Currently, target_sdk_version of MTS tests were being set to 10000 even
in release branches. This should only happen in active branches.
Test: Unit test
Test: aapt2 on CtsContentTestCases in udc-dev and verified
targetSdkVersion is 34
Bug: 279507428
Change-Id: Ib79318febc0f6e771b3679c0281a97357930ec56
Merged-In: Ib79318febc0f6e771b3679c0281a97357930ec56
(cherry picked from commit fb6a1ee68b)
Module lib surface is comprised of contributions from art, conscrypt,
and i18n api domains. On top of this, the module lib api surface generates an additional stub library containing the contributions of the non-updatable api domains. Adding this additional module to the testing module enables more thorough testing of module lib api scope java_api_library modules.
Test: m
Change-Id: Ia648651fb9e6cba2642de7e8d39047d888bf49ce