Commit graph

20458 commits

Author SHA1 Message Date
Jooyung Han
42d7718086 Merge "Enforce apex.min_sdk_version for bundled builds" into rvc-dev 2020-04-01 15:37:23 +00:00
Artur Satayev
0f9e77362c Merge "Use modular removed-dex.txt files for greylisting." into rvc-dev 2020-04-01 13:07:41 +00:00
Anton Hansson
cd4c32e556 Merge "Always keep rsp files" into rvc-dev 2020-04-01 09:53:02 +00:00
Dan Shi
91847d895d Merge "Merge "Rename VTS to VTS10" am: 7182c45fe7 am: 4058983c0c am: 8989420fee am: 2d2a3643f5" into rvc-dev 2020-04-01 04:31:32 +00:00
Hsin-Yi Chen
1422d6d13d Merge "Fix the logic for selecting ABI dump paths" into rvc-dev 2020-04-01 04:02:03 +00:00
Dan Shi
1a9a9127b1 Merge "Rename VTS to VTS10" am: 7182c45fe7 am: 4058983c0c am: 8989420fee am: 2d2a3643f5
Bug: 151896491
Test: none

Change-Id: Iee9324c4edefef56171ecfac64fd11a9595e5f7c
Merged-In: Iadad4ba96bf9a7f3b1d12c9d4eeb90fb1ed0841d
Merged-In: Iee9324c4edefef56171ecfac64fd11a9595e5f7c
(cherry picked from commit ee3ec387b0)
2020-03-31 23:20:53 +00:00
Anton Hansson
a5cb6fe9bb Remove neverallow rules for framework-mediaprovider
We actually want some targets (in particular, the MediaProvider apk)
to link against framework-mediaprovider.

The gist of what the neverallow rule achieves (disallow general use)
is achieved equally well with visibility rules, which
framework-mediaprovider already has.

Bug: 152891096
Test: m nothing
Change-Id: Ic4b0a571985b9ad1dfdd56d45035f224a622700e
2020-03-31 20:37:26 +01:00
Artur Satayev
a8ec55990f Use modular removed-dex.txt files for greylisting.
Use droidstubs for public and system stubs to provide a list of @removed APIs. As these APIs are not present in the stubs, they are not whitelisted / greylised automatically. Keep them on greylist manually.

Bug: 143864733
Test: diff out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: I4c8e6899fadfdfd1da82f6f453cc92e71aa9b78c
Merged-In: I4c8e6899fadfdfd1da82f6f453cc92e71aa9b78c
Exempt-From-Owner-Approval: clean cherry-pick
(cherry picked from commit c7fb5c9964)
2020-03-31 14:46:39 +00:00
Anton Hansson
b2ed9acc69 Merge "Convert sdk_library to use androidmk Dist" into rvc-dev 2020-03-30 23:25:07 +00:00
Anton Hansson
84dc13b8de Merge "Add a Tag field to dist to dist a tagged output" into rvc-dev 2020-03-30 23:17:15 +00:00
Anton Hansson
6bb8810c8e Convert sdk_library to use androidmk Dist
Reuse the generic Dist support instead of writing
custom mk rules for it. Use the new Tag support to
grab the classes.jar instead of the dexed jar.

Bug: 152618077
Test: m sdk dist
Change-Id: Id893d52cc24b66e6bd900b5062a59f3820000bcd
2020-03-30 14:22:43 +01:00
Anton Hansson
1e65f94a4b Add a Tag field to dist to dist a tagged output
Make java_library support this mode of output, to allow
callers to dist the classes.jar file rather than the dexed
jar file.

Bug: 152618077
Test: followup CL
Change-Id: I5ba6949833a0fbb95376142aec5096ff5f084c00
2020-03-30 13:55:32 +01:00
Dan Willemsen
6d5d8a6d6a Simplify message around nsjail error
We have known problems (docker; distros w/o user namespaces) which mean
that we won't be turning this into a fatal error anytime soon. Also
remove the bug report link, it's not useful to continue getting the same
reports.

Bug: 123210688
Test: treehugger
Change-Id: I271871d68150417ac938f074d3730cad4518e327
Merged-In: I271871d68150417ac938f074d3730cad4518e327
(cherry picked from commit 1871d88e4f)
2020-03-28 18:05:05 +00:00
Jooyung Han
65d8a6262c Build VNDK APEX for VNDK-Lite
For VNDK-Lite devices, which doesn't define BOARD_VNDK_VERSION, VNDK
APEX is built with only VNDK-Sp libraries with core variants.

Bug: 141908078
Bug: 152353068
Bug: 151635128
Test: TH
Change-Id: I0d08d32473368fd158818d4c2c72fc4cfad68ce6
2020-03-27 23:23:32 +09:00
Jaewoong Jung
37ca4a1e0d Add code coverage support to android_app JNI libs.
This is a cherry-pick change.

Test: Built mainline module coverage data
Bug: 152117890
Change-Id: I47bf3e5d6e78c4518729bdb52616e248156d3cec
Merged-In: I47bf3e5d6e78c4518729bdb52616e248156d3cec
2020-03-27 13:06:12 +00:00
Dan Willemsen
706d5f6730 Always keep rsp files
It's painful to debug without these.

Bug: 151160048
Test: do a build; find out -name '*.rsp'
Change-Id: I6fc25095442178c0bcbc1dea444ba51e9259c600
Merged-In: I6fc25095442178c0bcbc1dea444ba51e9259c600
2020-03-27 12:03:30 +00:00
Hsin-Yi Chen
d41fc1895b Fix the logic for selecting ABI dump paths
A library may have both VNDK variant and stubs. getRefAbiDumpFile should
differentiate its vendor and core variants.

Bug: 152277104
Test: Add dumps to platform/ and vndk/ ; make libselinux.vendor libselinux
Change-Id: Iad038cf4cd3eccc3dfbef13fab67da044498ce77
Merged-In: Iad038cf4cd3eccc3dfbef13fab67da044498ce77
(cherry picked from commit 27d235f918)
2020-03-27 16:17:40 +08:00
Jooyung Han
7406660685 Enforce apex.min_sdk_version for bundled builds
Previously, when Q-targeting apexes are bundled-built, they are built
against the latest stubs.

It was because unwinder is linked dynamically in R and APIs are provided
by libc while Q apexes should run on Q where libc doesn't provide those
APIs. To make Q apexes run on Q device, libc++ should be linked with
static unwinder. But, because libc++ with static unwinder may cause problem
on HWASAN build, Q apexes were built against the latest stubs for bundled
build.

However, Q apexes should be built against Q stubs.

Now, only for HWASAN builds, Q apexes are built against the latest stubs
(and native modules are not linked with static unwinder).

Bug: 151912436
Test: TARGET_SANITIZE=hwaddress m
      => Q apexes(media, resolv, ..) are linked with the latest stubs
      m
      => Q apexes are linked with Q stubs,
         and Q apexes' libc++ is linked with static unwinder
Change-Id: If32f1b547e6d93e3955c7521eec8aef5851f908c
2020-03-27 02:58:20 +09:00
Songchun Fan
0ed9a7d674 Merge "[soong] new field in Android.bp to request APK signing V4" into rvc-dev 2020-03-26 17:48:20 +00:00
Songchun Fan
688de9af5d [soong] new field in Android.bp to request APK signing V4
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
2020-03-25 17:12:20 -07:00
Jooyung Han
c3e9263d7e Pass min_sdk_version to cc __ANDROID_SDK_VERSION__
The macro is required only for apex variants regardless of useVndk.
Before the enforcement of LLNDK sdk version, the macro was not passed to
vendor variants.

Bug: 151689896
Test: TARGET_BUILD_APPS=com.android.media.swcodec m
      libbase in swcodec apex is linked with liblog#29
      (compiled with __ANDROID_SDK_VERSIO__=29)

Merged-In: I57fa4afe027eb39b98bd94d534be9ebe11713f19
Change-Id: I57fa4afe027eb39b98bd94d534be9ebe11713f19
(cherry picked from commit 24282778ee)

Exempt-From-Owner-Approval: cp from aosp
2020-03-25 23:23:26 +00:00
Jooyung Han
67a96cd7cb Enforce min_sdk_version of apex(use_vendor:true)
Even though use_vendor:true is prohibited, there is media.swcodec apex
which is still use_vendor: true and also needs to support Android10.
(min_sdk_version: 29)

Because LLNDK stubs were provided only for the current VNDK version,
media.swcodec couldn't be built against min_sdk_version: 29.

This change introduces additional versions for LLNDK stubs which are
enforced when an apex with use_vendor: true sets min_sdk_version.

To make things easier, the versions of LLNDK stubs are borrowed from its
implementation libraries.

Bug: 147450930
Bug: 149591522
Test: TARGET_BUILD_APPS=com.android.media.swcodec m
      (with min_sdk_version: 29 set)
      check if liblog/libc/libm/libdl stubs are 29
      check if 29 stubs don't have new symbols.

Merged-In: I79946cbb4da6617138a96d2b254349d3a298e77b
Change-Id: I79946cbb4da6617138a96d2b254349d3a298e77b
(cherry picked from commit 380fc3615c)
2020-03-25 10:40:41 +09:00
Jooyung Han
89124ba39b cc: fix a utility to make C macro name
Use the result of regex.ReplaceAllString()

Bug: 149591522 (not directly related to this)
Test: m (with new unit test)
Merged-In: Ifce07547ccc067f1ee5bd8467c2fb7d7f8387b8e
Change-Id: Ifce07547ccc067f1ee5bd8467c2fb7d7f8387b8e
(cherry picked from commit b04a4997b8)
2020-03-25 10:40:24 +09:00
Ulya Trafimovich
f798c3ec32 Don't append build directory to the output path twice.
Soong already uses build directory as a part of the generated output
path. Besides, trying to append it second time breaks if the build
directory is an absolute path.

Test: frameworks/rs/build_rs.py  (uses absolute build directory path)
Test: walleye-userdebug boots

Bug: 152235239
Change-Id: Ie03c9e688013b9a3e6bc859c936d89c538ded76a
2020-03-24 14:09:43 +00:00
Anton Hansson
b4cf9df628 Merge "Default droiddoc to disting the api txt if there is one" into rvc-dev 2020-03-24 13:49:32 +00:00
Anton Hansson
37a1e4c193 Default droiddoc to disting the api txt if there is one
Bug: 149293194
Test: m dist sdk
Change-Id: Ia168d3e5d18dc4f0ed5ca9d69720db57c2b91f80
2020-03-23 17:01:16 +00:00
Ulya Trafimovich
9790f1058b Fix null pointer dereference in Soong on dexpreopt arc-services.
The null pointer dereference was caused by trying to get device name
from a config passed to dexpreopt. For Make modules, the config is a
stub that doesn't have a device name. The fix is to use build directory
instead of device name (it is provided both by the full config passed
to Soong modules and by the stub config passed to Make modules).

Test: walleye-userdebug boots.
Test: aosp_bertha_arm-userdebug builds and generates arc-services.odex.

Bug: 152193534
Change-Id: I7adc173646cae6eaee188c6672629a5a942aea06
2020-03-23 14:35:58 +00:00
Ulyana Trafimovich
26cb99941b Merge "Simplify the construction of class loader contexts for system server jars." into rvc-dev 2020-03-23 09:12:46 +00:00
Artur Satayev
f95405dad5 Merge "Merge CSV files generated by UnsupportedAppUsageProcessor." into rvc-dev 2020-03-22 11:53:58 +00:00
Artur Satayev
8a950790ee Merge CSV files generated by UnsupportedAppUsageProcessor.
Flow:
1. Annotation processor generates a CSV file per class as a CLASS_OUTPUT resource.
2. hiddenapi.go extracts individual .csv files and merges them into an index.csv file per module.
3. hiddenapi_singleton.go merges individual index.csv files into a combined .csv file.

In a follow up hiddenapi-index.csv would replace unsupportedappusage_index.csv

Bug: 145132366
Change-Id: I87d92f9c8d4b1cc1df526fc576ee3c2101116b58
Merged-In: I87d92f9c8d4b1cc1df526fc576ee3c2101116b58
Test: diff unsupportedappusage_index.csv hiddenapi-index.csv
Exempt-From-Owner-Approval: cp from r.android.com/1239709
2020-03-21 13:01:17 +00:00
Yabin Cui
06af9190b1 Merge "Switch from clang-r377782b to clang-r377782c." into rvc-dev 2020-03-21 03:37:02 +00:00
Makoto Onuki
571c9d93b3 Merge "Do not include any documentation when building stubs" into rvc-dev 2020-03-20 23:29:44 +00:00
TreeHugger Robot
fc5fafd902 Merge "Fix forwarding a vararg parameter" into rvc-dev 2020-03-20 19:40:06 +00:00
Yabin Cui
690c8b8b5e Switch from clang-r377782b to clang-r377782c.
Bug: 149849077
Test: N/A
Change-Id: Id8b5dd13e87d1acd8dab1431fa6859721553c49c
(cherry picked from commit 3125c990ed)
2020-03-20 11:17:30 -07:00
TreeHugger Robot
d775f6ae65 Merge "Cleanup vendor_boot artifacts in PRODUCT_OUT on installclean" into rvc-dev 2020-03-20 17:22:53 +00:00
Ulya Trafimovich
a4a83b0ef9 Simplify the construction of class loader contexts for system server jars.
This reworks CL https://r.android.com/1180134 as follows:

1) Do not reorder the list of system server jars passed from Make to
  Soong via the product variable PRODUCT_SYSTEM_SERVER_JARS. This means
  that for some products the order of jars on the system server
  classpath may be non-optimal: a jar X that depends on Y may be
  dexpreopted before Y, so that all references to the classes and
  methods from Y wil be unresolved.

  Unfortunately for such products, fixing the order is not a simple
  matter of rearranging their PRODUCT_SYSTEM_SERVER_JARS, because the
  conflicts may arise when the product-specific variable gets merged
  with the common variable.

2) As a consequence of 1), do not add artificial dependencies between
  system server jars: this is now impossible, as it would create
  circular dependencies for those products that have non-optimal order
  of jars.

3) Copy dex files for system server jars to a predefined build location.
  This is necessary because at the time when Soong generates class
  loader context for k-th jar, it needs to know the paths to jars 1 ..
  (k-1), and it might have not processed those jars yet (so Soong can't
  query the paths from the modules).

  This approach is similar to the way Soong handles bootclasspath jars.

4) Do not exclude from dexpreopting system server jars that are not
  Soong modules (those that are Make modules). The previous CL excluded
  them because Make modules do not have ModuleContext. But it turns out
  that ModuleContext is not necessary, as all the information is passed
  via the dexpreopt config.

Test: aosp_walleye-userdebug boots and there are no messages in the
  logcat regarding class loader context mismatch:

  $ adb logcat | grep 'mismatch'
  # empty

Test: Class loader contexts in the oat files for system server jars
  match expectations:

  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/com.android.location.provider.odex 2>/dev/null | grep '^classpath'
  classpath = PCL[]
  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/services.odex 2>/dev/null | grep '^classpath'
  classpath = PCL[/system/framework/com.android.location.provider.jar*1989208671]
  $ oatdump --oat-file=out/target/product/walleye/system/framework/oat/arm64/ethernet-service.odex 2>/dev/null | grep '^classpath'
  classpath = PCL[/system/framework/com.android.location.provider.jar*1989208671:/system/framework/services.jar*4040443083:/system/framework/services.jar!classes2.dex*2210087472]

Test: The phone boots and logcat has no scary messages related to
  class loader contexts:

  $ lunch aosp_walleye-userdebug && m
  $ adb reboot bootloader && fastboot flashall -w && adb wait-for-device
  $ adb root
  $ adb shell stop
  $ adb logcat -c
  $ adb shell setprop dalvik.vm.extra-opts -verbose:oat
  $ adb shell start
  $ adb logcat | egrep -io 'system_server: .*load.*/system/framework.*'
  system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0
  system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 0
  system_server: Loading /system/framework/oat/arm64/services.odex with executable: 0
  system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 0
  system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 0
  system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 0
  system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 0
  system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 0
  system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  system_server: Loading /system/framework/oat/arm64/services.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/services.odex with executable: 1
  system_server: Loading /system/framework/oat/arm64/ethernet-service.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/ethernet-service.odex with executable: 1
  system_server: Loading /system/framework/oat/arm64/wifi-service.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/wifi-service.odex with executable: 1
  system_server: Loading /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1
  system_server: Successfully loaded /system/framework/oat/arm64/com.android.location.provider.odex with executable: 1

Bug: 141785760
Bug: 140451054
Bug: 148944771
Bug: 147017252

Change-Id: I33c4087f8bfacd0ecb89877aa150b75360d06710
2020-03-20 15:23:18 +00:00
Aurimas Liutikas
2d732e0070 Do not include any documentation when building stubs
We only need documentation (javadocs) when building docs stubs,
for regular stubs, we can drop printing out all the docs.

Tested with:
touch frameworks/base/core/java/android/view/View.java && time make -j framework

Before (with just r.android.com/1254909)
Run #1 2m4.779s
Run #2 2m6.672s
Run #3 2m4.179s

Average: 125.2 seconds

After (with this patch and r.android.com/1254909)
Run #1 1m58.682s
Run #2 1m58.820s
Run #3 1m57.724s

Average: 118.4 seconds

Speedup ~6.8 seconds (5.4%)

Bug: 151160048
Test: make checkapi
Change-Id: I27eafb5a61bb9d26a74ca25f84c9daca17a8394f
Merged-in: I27eafb5a61bb9d26a74ca25f84c9daca17a8394f
2020-03-19 14:46:17 -07:00
Jooyung Han
67b141d459 Fix forwarding a vararg parameter
vararg parameter is passed without unpacking, which prints
not-so-useful value.

Bug: 151963308
Test: m
Merged-In: I03f011557d10c6e2bc06813491cd8df2cce7c6ea
Change-Id: I03f011557d10c6e2bc06813491cd8df2cce7c6ea
(cherry picked from commit cd87c69de4)
2020-03-19 20:00:36 +00:00
Will McVicker
92326a9fa4 Cleanup vendor_boot artifacts in PRODUCT_OUT on installclean
This makes sure that we don't keep old vendor_boot artifacts around
after a clean.

Signed-off-by: Will McVicker <willmcvicker@google.com>
Fixes: 151957122
Bug: 151949371
Test: touch $OUT/vendor-ramdisk/test-file && make installclean
Change-Id: I357929583f234212a998dceaa31506fce42e0255
2020-03-19 19:57:35 +00:00
Anton Hansson
bbd78556da Make system_server stubs consistent with other stubs
Include the module_api stubs in system_server one instead of
putting both of these jars on the classpath. Also rename it
to be in line with the other stubs.

Bug: 149293194
Test: m
Change-Id: Iead5af4152a49cd59a4fd7afc0312c2f0c872c1e
2020-03-19 17:42:59 +00:00
TreeHugger Robot
bed2ac5dd6 Merge "Fix vndk snapshot suffix on Makefile" into rvc-dev 2020-03-19 01:27:33 +00:00
Jiyong Park
162e844c40 track static deps when gatherint notices for apex
This change fixes a bug that license info for statically linked
libraries are absent in the merged notice for APEX. The problem was that
we were iterating over the apexFiles list that represents actual files
(not Soong modules) that are included in the APEX. The problem is now
fixed by iterarting the all the modules that directly or indirectly
contribute to the APEX using walkPayloadDeps() function.

Bug: 149455933
Test: m
Merged-In: I38655da62b590b669ab4649815b61a5a8e314154
(cherry picked from commit 9918e1afd7)
Change-Id: I38655da62b590b669ab4649815b61a5a8e314154
2020-03-18 12:45:50 +09:00
Jiyong Park
79505fbf22 Merge "Remove libselinux from the apex_available whitelist" into rvc-dev 2020-03-17 08:29:46 +00:00
Jiyong Park
7e5576a7b1 Remove libselinux from the apex_available whitelist
libselinux no longer is included in any APEX. Only the platform variant
of it (/system/lib/libselinux.so) exists and APEXes link to it.

Removing the lib name from the whitelist to make it clear that the
library is not available to any APEX.

Bug: 151053366
Bug: 150999716
Test: m

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

Merged-In: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
(cherry picked from commit 1731f6ae3f)
Change-Id: Id4fb933141ad32ff5217a58f1c7d689cc657e9ea
2020-03-17 05:25:31 +00:00
Baligh Uddin
cb6aa122d8 Allow for overriding container packagename for an Apex.
Test: go test ./... -test.v -run TestOverrideApex
BUG: 148198056
Merged-In: If49042a7acbf9f0dcb505664863d97805902e459
Change-Id: If49042a7acbf9f0dcb505664863d97805902e459
2020-03-16 16:41:11 -07:00
TreeHugger Robot
e989a8cb42 Merge "Add __ANDROID_SDK_VERSION__=<ver> macro" into rvc-dev 2020-03-16 16:07:17 +00:00
Jooyung Han
61c4154ca6 Add __ANDROID_SDK_VERSION__=<ver> macro
sdk_version is passed for relevant variants.
If not specified or "current",
it maps to "10000" for platform variants, and
"min_sdk_version" of the apex for apex variants.

Bug: 150860940
Test: m (soong test)
      manually check build.ninja
Merged-In: I5102ab0c5086b5ad29d16ac45af55d32062167b4
Change-Id: I5102ab0c5086b5ad29d16ac45af55d32062167b4
(cherry picked from commit ccce2f2c23)

Exempt-From-Owner-Approval: cp from aosp
2020-03-16 16:07:07 +00:00
TreeHugger Robot
e1ededc88f Merge "Make __ANDROID_APEX_<NAME>__ macro optional" into rvc-dev 2020-03-16 16:06:49 +00:00
Jooyung Han
68e511e4fd Make __ANDROID_APEX_<NAME>__ macro optional
This is rarely used feature but cost alot for the local build and build
inra.

Bug: 150506627
Test: m
Merged-In: Iec3ada4a97c7b228f2818563fa0e81b407f2715a
Change-Id: Iec3ada4a97c7b228f2818563fa0e81b407f2715a
(cherry picked from commit c87a059c88)

Exempt-From-Owner-Approval: cp from aosp
2020-03-16 16:06:31 +00:00
Jooyung Han
23b0adf4ce apex: Deprecate legacy_android10_support prop
min_sdk_version = 29 implies that the module should support Android10.

Bug: 150431944
Test: m
Merged-In: Iad90a239898f59456900ae7816b90379b1b43406
Change-Id: Iad90a239898f59456900ae7816b90379b1b43406
(cherry picked from commit 5417f775e5)

Exempt-From-Owner-Approval: cp from aosp
2020-03-16 10:57:51 +00:00