Introduce aidl.libs prop on cc libraries to pass in aidl_library. The goal is to eventually disallow aidl.include_dirs (a pattern for passing aidl headers dir for aidl compilation) and enforce aidl headers to be explicitly specified in Android.bp.
Bug: 278704136
Test: go test
(cherry picked from https://android-review.googlesource.com/q/commit:367d89da7887825f74b0c9554b2e1b9619d94f08)
Merged-In: Ia78bc11dfa12f47d2d1bb90dc65372ddb17f7e14
Change-Id: Ia78bc11dfa12f47d2d1bb90dc65372ddb17f7e14
We currently specifies aidl files directly to the srcs prop on a filegroup or other module types such as cc_library or java_library. We use aidl.include_dirs prop to specify paths to aidl headers. This include_dirs pattern isn't migratable to Bazel because Bazel requires explicit dependencies.
This CL introduces aidl_library to better map with Bazel's aidl_library rule and to enable aidl headers to be specified in a separate aidl_library or the hdrs prop. A follow-up CL will turn on inputs sandbox to enforce all aidl headers be explicitly specified in Android.bp
Test: go test
Bug: 278704136
(cherry picked from https://android-review.googlesource.com/q/commit:0e7fd8a14b5e1ebc2f2516639e9cea5dfdefce63)
Merged-In: I2c99af080525bf8a6c5724ed5ee2001842969098
Change-Id: I2c99af080525bf8a6c5724ed5ee2001842969098
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
The core problem I am trying to solve is making sure that stub
libraries in Bazel have a single apex available. In Soong, this will be
enforced using some graph walk which is not easy to port to Bazel.
However, we might need to revisit this when we build the enforcement
mechanism in Bazel. We likely need a `test_for` on the top level
apex_test Bazel rule so that the test apex is _allowed_ to link against impl
of the library it is trying to test.
(This CL retricts this to cc_library, I can expand this to other modules
if this is the right approach.)
Bug: 277651159
(cherry picked from https://android-review.googlesource.com/q/commit:f57a966b6694da970e99f519919f9b845b713163)
Merged-In: Iaeec22c5626df79a33785c766ed29102b1da403e
Change-Id: Iaeec22c5626df79a33785c766ed29102b1da403e
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
This script will be used to change the package that is being allowed to
use privileged permissions.
Test: python scripts/modify_permissions_allowlist.py
Bug: 242509786
(cherry picked from https://android-review.googlesource.com/q/commit:580f7b0094bd98d3769b6cdeaaab6a9748621253)
Merged-In: I1d7cb3c906ad39aef42ad4394953251db40d1bf1
Change-Id: I1d7cb3c906ad39aef42ad4394953251db40d1bf1
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
This reverts commit 1db4348734.
Changes from original:
- extracted function to add the current version to stub
versions for bp2build.
- added libc++ to mixed builds denylist
Reason for revert: re-uploading with fix in topic
Bug: 270408757
(cherry picked from https://android-review.googlesource.com/q/commit:75dbca2eae78bb280b50828d3c2165bda5d87ba5)
Merged-In: Ifa0ed456bf8cb4a7f861d6826263adfedb4fdd9c
Change-Id: Ifa0ed456bf8cb4a7f861d6826263adfedb4fdd9c
SortedUniqueStrings and FirstUniqueStrings dedupes repeating elements
and returns the deduped list. Currently, it also modifies the input list
in-place, which causes non-determinisitc failures like b/275313114
Operate on a copy of the input so that the input remains untouched.
SortedUniqueStrings is O(NlogN) and FirstUniqueStrings is ~O(N), so
creating a copy (O(N)) should not result in major performance regressions.
Numbers for this single unit test:
```
go test . -run TestStubsForLibraryInMultipleApexes -v -count 1000
Before: 174s
After: 172s
```
Bug: 275313114
Test: go test ./android
Test: go test . -run TestStubsForLibraryInMultipleApexes -v -count 1000
(cherry picked from https://android-review.googlesource.com/q/commit:8a8714c781175f8f1a6c189d919ee8b0ee8c1e27)
Merged-In: Id859723b2c2ebdc0023876c4b6fabe75d870bad7
Change-Id: Id859723b2c2ebdc0023876c4b6fabe75d870bad7
Previously, CopyOf on an empty list was returning nil. With the updates
to SortedUniqueStrings and FirstUniqueStrings, we need to differentiate
between empty lists and nil.
Bug: 275313114
Test: m nothing
(cherry picked from https://android-review.googlesource.com/q/commit:cc4da765113299fa11dcb1e651ec4ae33e6f8f9b)
Merged-In: I91063ebbe5013cbda5d8f70efde4683c66581599
Change-Id: I91063ebbe5013cbda5d8f70efde4683c66581599
1) Use attribute name "default_package_metadata" instead of
"default_applicable_licenses" in packages to better describe its use.
2) Add a filegroup "default_metadata_file" in packages to search for
METADATA file in each package.
3) Include "default_metadata_file" in each package's
"default_package_metadata" attribute.
Bug: 275472038
Test: CIs
(cherry picked from https://android-review.googlesource.com/q/commit:2c9e8d612819840020b2d110d23fb2771b6c92f0)
Merged-In: I645c013c39e3190fd96c4a549d39a331aced16bd
Change-Id: I645c013c39e3190fd96c4a549d39a331aced16bd
clang-r487747c contains upstream fix for the excessive stack protactor
checks (fc4494dffa54) and checks are no longer inserted for C only code
or C++ code built without exeception. The Android platform does not
enable C++ exception by default, thus turning on the check should not
have significant performance impact.
This reverts commit ecc18df6ff.
Test: presubmit
Bug: 277565884
Bug: 279955553
(cherry picked from https://android-review.googlesource.com/q/commit:e9850f81531f070ac5cd193fdcd767bc91605bfe)
Merged-In: I2fc5826048ba5d00cabcc8401ac40a6f54812a44
Change-Id: I2fc5826048ba5d00cabcc8401ac40a6f54812a44
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
This fixes an incrementality bug that resulted in superfluous
build.ninja regeneration after a new glob definition is added.
(cherry picked from https://android-review.git.corp.google.com/c/platform/build/soong/+/2585669)
Fixes: 279674820
Test: Treehugger
Test; New integration test in this CL
Merged-In: Ifefe66a0eb1c125e9ad5373d60437a1cb1e6fdec
Change-Id: Ifefe66a0eb1c125e9ad5373d60437a1cb1e6fdec
prebuilt_etc may use sub_dir property to define a relative install
path. Use SubDir() to read either sub_dir or relative_install_path
property.
Bug: 282080219
Test: m vendor-image
Merged-In: I07a21c5aeb87b403854ed32976d26e70b046b8c1
Change-Id: I07a21c5aeb87b403854ed32976d26e70b046b8c1
(cherry picked from commit 8bd3afe68c)