Vendor JNI libraries already have stable APIs enforced by the VNDK,
they shouldn't use SDK variants.
Bug: 156225490
Test: TestJNISDK
Change-Id: I21ba67e8e9fb05016caf5888129adc1a939545c2
Merged-In: I21ba67e8e9fb05016caf5888129adc1a939545c2
(cherry picked from commit c2d24050c5)
Check that jni_uses_sdk_apis and jni_uses_platform_apis are consistent
with sdk_version, and add tests that they select the right variant.
Bug: 154665579
Test: app_test.go
Change-Id: I544a4f881ba16dacd7e74cd480c095091b3cf667
Merged-In: I544a4f881ba16dacd7e74cd480c095091b3cf667
(cherry picked from commit 3c007704c7)
Compiling native modules against the NDK disables platform features
like ASAN. For anything shipped on the system image there is no
reason to compile against the NDK. Add a new mutator to Soong that
creates a platform and an SDK variant for modules that set
sdk_version, and ignore sdk_version for the platform variant. The
SDK variant will be used for embedding in APKs that may be installed
on older platforms. Apexes use their own variants that enforce
backwards compatibility.
Test: sdk_test.go
Test: TestJNIPackaging
Bug: 149591340
Change-Id: I7d72934aaee2e1326cc0ba5f29f51f14feec4521
Merged-In: I7d72934aaee2e1326cc0ba5f29f51f14feec4521
(cherry picked from commit 82e192c3ae)
Apps that expect to run on older platforms should use JNI libraries
that will also run on older platforms. Require that apps that set
sdk_version have jni_libs modules that also set sdk_version, or
set jni_uses_platform_apis: true to bypass the check.
Fixes: 149591057
Test: app_test.go
Change-Id: I76b9b45fb5773bc4dfc10520108f4f3578723909
Merged-In: I76b9b45fb5773bc4dfc10520108f4f3578723909
All updatable modules are expected to declare their earliest platform
version they support.
Bug: 153539598
Test: m
Change-Id: I6243d276e5ab25a1007187ad34789ca1b4cc87bf
Merged-In: I6243d276e5ab25a1007187ad34789ca1b4cc87bf
Exempt-From-Owner-Approval: cherry-pick from aosp
(cherry picked from commit f40fc858a2)
As a follow up, this property will be set to APKs participating in mainline program.
Bug: 153333044
Test: m
Change-Id: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
Merged-In: I6ea2f3c1d26992259e4e9e6a6d8cecf091d39c43
(cherry picked from commit 2db1c3f1c4)
Exempt-From-Owner-Approval: clean cherry-pick
If "v4_signature: true" is set, the v4 signature file,
named [outputApkFile].idsig
will be generated along side the outputApkFile.
Test: m nothing
Test: atest PackageManagerShellCommandIncrementalTest
BUG: 149354175
Change-Id: Ie84725a15406f96f65042ea9909460e4eb34d57f
Move the NDK modules defined in app_test.go into cc/testing.go in
preparation for using sdk_version: "current" in more tests.
Test: all soong tests
Change-Id: I80bc31225fb4562fce42781219cefbbd6affae06
Unit test: go test ./... -test.v -run TestOverrideAndroidApp
Unit test: python manifest_fixer_test.py
BUG: 148198056
Change-Id: Ib5ff235d2a93e88b86aec1c0b16327ea938a094d
Resource configs should not be deduped when building RROs since it
would be impossible to override some resource configs with the same
value as the default config. Also, aapt2 removes resources that do not
have default configurations. If an overlay attempts to overlay a
non-default configuration without overlaying the default, the resource
will be removed and the value will not be overlaid at all.
Bug: 146227008
Fixes: 119811120
Test: app_test.go
Change-Id: I834a58b18d1e74a0f6b3de3d0523009788787e42
If the install apk name is different than the module name, use
test_config_fixer to update the test-file-name value in the config.
Test: app_test.go
Fixes: 147375216
Change-Id: I2141eeebbb3552995400b45634712306673fd812
AAPT2 ignores assets in overlay resource inputs, so separate rules are
required to extract and merge assets from dependencies.
Test: app_test.go
Test: Added assets to Settings-core for testing
Test: Confirmed Settings.apk contains them with this change.
Fixes: 146655310
Change-Id: Iab8bc61b719541dae64f0e3502bc9cb45a353687
Skip the JNI uncompress step for presigned prebuilt test apps. They
don't need it, and they can invalidate the signature. Also, fix the
install partition of prebuilt test apps.
Fixes: 143472191
Test: app_test.go
Test: Converted CtsShimPrivUpgradePrebuilt to bp and checked the
final output apk signature.
Change-Id: Ied7d3576b5db4de40a9ca9e388336229d07212f5
The filesystem object was available through ModuleContext.Fs(), but
gives too much access to the filesystem without enforicing correct
dependencies. In order to support sandboxing the soong_build
process move the filesystem into the Config. The next change will
make it private.
Bug: 146437378
Test: all Soong tests
Change-Id: I5d3ae9108f120fd335b21efd612aefa078378813
This time, exclude NDK libraries instead of LLNDK libraries from the
package. This is necessary because there are libraries such as libvndksupport
which are LLNDK but are not accessible to apps.
Original commit message:
> Previously, android_app targets for which a.shouldEmbedJnis(ctx) = true
> (e.g. CtsSelinuxTargetSdk25TestCases) would need to specify all of their
> recursive library dependencies, including for example libc++ when depending
> on the platform libc++. This means unnecessary churn when we add a new
> dependency to libc++ (e.g. libunwind [1]). To avoid the churn and allow
> jni_libs clauses to be simplified, make the build system search for the
> recursive dependencies and automatically include them.
>
> This change allows us to remove code that was previously adding NDK libc++
> as a special case, as it is now covered by the generic code.
>
> Also fix some improper quoting that was exposed as a result of this change
> causing more files to be packaged than before.
>
> [1] https://android-review.googlesource.com/q/topic:%22libunwind-so%22
Bug: 144430859
Test: atest CtsAppOpsTestCases
Test: atest FrameworksNetSmokeTests
Change-Id: I8311ede0b44d7e50b9f272912ead8ef07e82b074
Previously, android_app targets for which a.shouldEmbedJnis(ctx) = true
(e.g. CtsSelinuxTargetSdk25TestCases) would need to specify all of their
recursive library dependencies, including for example libc++ when depending
on the platform libc++. This means unnecessary churn when we add a new
dependency to libc++ (e.g. libunwind [1]). To avoid the churn and allow
jni_libs clauses to be simplified, make the build system search for the
recursive dependencies and automatically include them.
This change allows us to remove code that was previously adding NDK libc++
as a special case, as it is now covered by the generic code.
Also fix some improper quoting that was exposed as a result of this change
causing more files to be packaged than before.
[1] https://android-review.googlesource.com/q/topic:%22libunwind-so%22
Bug: 144430859
Change-Id: I3d6fbcce75bc108a982eb7483992a4b202056339
AndroidMkEntries now returns multiple AndroidMkEntires so that a module
can emit multiple Make modules if needed.
Bug: 128708192
Test: m
Change-Id: I56b6f76d22943b80329951c5acb80a1b932441ad
Link type checking for java_library has not been working unintentionally.
So turn on link type checking for these types.
And also add tests for link type checking.
Bug: 145799020
Test: cherry-pick aosp/1182522 and check if build fails
Test: m nothing and there is no error(soong unittest)
Change-Id: Ifc347f657885de1028ac0076ddd103c0387b597a
This change also adds instrumentation_target_package to android_test, so
that the target package name in a test manifest can be easily
overridden.
Fixes: 134624457
Test: app_test.go
Change-Id: Ib8dd703da0038ac76210c92d79e133e37c718122
This fixes a bug where unsigned split apks were installed instead of
their signed counterparts.
Fixes: 140795853
Test: app_test.go
Test: m Split && apksigner verify --print-certs
Change-Id: I12cdbcaff9932b6388f920d7e03301d687c3bfdb
Only if PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE is set,
every app and java library in product cannot use hidden APIs anymore.
checkSdkVersion() checks if sdk_version of app and library is narrow enough,
checkLinkType() checks every library that app links agianst
Bug: 132780927
Test: m
Test: set PRODUCT_ENFORCE_PRODUCT_PARTITION_INTERFACE, and check whether build
error occurs.
Change-Id: Ic630503b875040f730feda4fef826ed6d71da111
For now, Soong checks link-type in java_library, so it cannot block hidden api usage from android_library that app links with.
So we should add check in 'android_library'
Test: m nothing
Change-Id: Ic040270ec668bdd693b690ac8a88be1048922c3b
Stripping is incompatible with ART module updatability.
Bug: 65154345
Bug: 138851227
Test: build and observe no change in output (stripping is not used by
default).
Change-Id: I4bbc01d9979605b7dd2f73ee99a74c1e817c3e8c
As sdk_check.mk checks, soong starts to check every app.
If sdk_version is empty, platform_apis must be true.
If sdk_version is not empty, platform_apis must be false.
Test: soong test
Test: m
Bug: 132780927
Change-Id: I7ba702d616404d155f8ac40cd008828663ad1488