diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-15 21:49:01 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-06-15 21:49:01 +0000 |
commit | 15d03b09ddb5c0e2c0309d8e3e818e411c2ff394 (patch) | |
tree | 06dc6aefc5afb43f1e5905294ca43040eb8b0601 | |
parent | 799298c32e8dae898ccb35cfd4e7eac2ef5df557 (diff) | |
parent | 1332595b84e5d13688288210b090fbb3a114e23e (diff) | |
download | common-15d03b09ddb5c0e2c0309d8e3e818e411c2ff394.tar.gz |
Snap for 8730993 from 1332595b84e5d13688288210b090fbb3a114e23e to mainline-tzdata3-releaseaml_tz3_314012070aml_tz3_314012050aml_tz3_314012010aml_tz3_313110000aml_tz3_312511020aml_tz3_312511010aml_tz3_312410020aml_tz3_312410010android12-mainline-tzdata3-releaseaml_tz3_314012010
Change-Id: I953fd99f8356f102a38466061f0bfd4f2df61cfc
66 files changed, 316 insertions, 2075 deletions
@@ -62,16 +62,6 @@ soong_config_module_type { } soong_config_module_type { - name: "module_prebuilt_systemserverclasspath_fragment", - module_type: "prebuilt_systemserverclasspath_fragment", - config_namespace: "ANDROID", - bool_variables: ["module_build_from_source"], - properties: [ - "prefer", - ], -} - -soong_config_module_type { name: "module_java_import", module_type: "java_import", config_namespace: "ANDROID", diff --git a/build/allowed_deps.txt b/build/allowed_deps.txt index 17cf6dc2..896eb188 100644 --- a/build/allowed_deps.txt +++ b/build/allowed_deps.txt @@ -13,22 +13,11 @@ # See go/apex-allowed-deps-error for more details. # TODO(b/157465465): introduce automated quality signals and remove this list. -android.hardware.audio.common-V1-ndk(minSdkVersion:31) -android.hardware.audio.common@5.0(minSdkVersion:30) -android.hardware.bluetooth.a2dp@1.0(minSdkVersion:30) -android.hardware.bluetooth.audio-V1-ndk(minSdkVersion:31) -android.hardware.bluetooth.audio-V2-ndk(minSdkVersion:31) -android.hardware.bluetooth.audio@2.0(minSdkVersion:30) -android.hardware.bluetooth.audio@2.1(minSdkVersion:30) -android.hardware.bluetooth@1.0(minSdkVersion:30) -android.hardware.bluetooth@1.1(minSdkVersion:30) android.hardware.cas.native@1.0(minSdkVersion:29) android.hardware.cas@1.0(minSdkVersion:29) android.hardware.common-ndk_platform(minSdkVersion:29) android.hardware.common-V2-ndk(minSdkVersion:29) android.hardware.common-V2-ndk_platform(minSdkVersion:29) -android.hardware.common.fmq-V1-ndk(minSdkVersion:29) -android.hardware.graphics.allocator-V1-ndk(minSdkVersion:29) android.hardware.graphics.allocator@2.0(minSdkVersion:29) android.hardware.graphics.allocator@3.0(minSdkVersion:29) android.hardware.graphics.allocator@4.0(minSdkVersion:29) @@ -37,7 +26,6 @@ android.hardware.graphics.bufferqueue@2.0(minSdkVersion:29) android.hardware.graphics.common-ndk_platform(minSdkVersion:29) android.hardware.graphics.common-V2-ndk(minSdkVersion:29) android.hardware.graphics.common-V2-ndk_platform(minSdkVersion:29) -android.hardware.graphics.common-V3-ndk(minSdkVersion:29) android.hardware.graphics.common@1.0(minSdkVersion:29) android.hardware.graphics.common@1.1(minSdkVersion:29) android.hardware.graphics.common@1.2(minSdkVersion:29) @@ -60,12 +48,9 @@ android.hardware.neuralnetworks@1.0(minSdkVersion:30) android.hardware.neuralnetworks@1.1(minSdkVersion:30) android.hardware.neuralnetworks@1.2(minSdkVersion:30) android.hardware.neuralnetworks@1.3(minSdkVersion:30) -android.hardware.radio-V1.0-java(minSdkVersion:current) android.hardware.tetheroffload.config-V1.0-java(minSdkVersion:current) android.hardware.tetheroffload.control-V1.0-java(minSdkVersion:current) android.hardware.tetheroffload.control-V1.1-java(minSdkVersion:current) -android.hardware.uwb-V1-ndk(minSdkVersion:Tiramisu) -android.hardware.uwb-V1-rust(minSdkVersion:Tiramisu) android.hardware.wifi-V1.0-java(minSdkVersion:30) android.hardware.wifi-V1.0-java-constants(minSdkVersion:30) android.hardware.wifi-V1.1-java(minSdkVersion:30) @@ -96,11 +81,7 @@ android.hidl.safe_union@1.0(minSdkVersion:29) android.hidl.token@1.0(minSdkVersion:29) android.hidl.token@1.0-utils(minSdkVersion:29) android.media.audio.common.types-V1-cpp(minSdkVersion:29) -android.media.audio.common.types-V1-ndk(minSdkVersion:29) android.net.ipsec.ike.xml(minSdkVersion:(no version)) -android.system.suspend-V1-ndk(minSdkVersion:30) -android.system.suspend-V1-ndk(minSdkVersion:Tiramisu) -android.system.suspend.control-V1-ndk(minSdkVersion:30) android_downloader_lib(minSdkVersion:30) androidx-constraintlayout_constraintlayout(minSdkVersion:14) androidx-constraintlayout_constraintlayout-solver(minSdkVersion:24) @@ -195,7 +176,6 @@ audiopolicy-aidl-cpp(minSdkVersion:29) auto_value_annotations(minSdkVersion:19) av-headers(minSdkVersion:29) av-types-aidl-cpp(minSdkVersion:29) -avrcp_headers(minSdkVersion:30) bcm_object(minSdkVersion:29) bionic_libc_platform_headers(minSdkVersion:29) boringssl_self_test(minSdkVersion:29) @@ -210,10 +190,8 @@ car-rotary-lib(minSdkVersion:28) car-rotary-lib-resources(minSdkVersion:28) car-ui-lib(minSdkVersion:28) car-ui-lib-resources(minSdkVersion:28) -census(minSdkVersion:30) clatd(minSdkVersion:30) codecs_g711dec(minSdkVersion:29) -com.android.vcard(minSdkVersion:9) com.google.android.material_material(minSdkVersion:14) connectivity_native_aidl_interface-V1-java(minSdkVersion:30) conscrypt(minSdkVersion:29) @@ -241,7 +219,6 @@ datastallprotosnano(minSdkVersion:29) dnsproxyd_protocol_headers(minSdkVersion:29) DocumentsUI-res-lib(minSdkVersion:29) exoplayer-annotation_stubs(minSdkVersion:16) -exoplayer-mediaprovider-core(minSdkVersion:16) exoplayer-mediaprovider-ui(minSdkVersion:16) ExtServices(minSdkVersion:30) ExtServices(minSdkVersion:current) @@ -252,30 +229,27 @@ fmtlib(minSdkVersion:29) fmtlib_headers(minSdkVersion:29) fmtlib_ndk(minSdkVersion:29) fp16_headers(minSdkVersion:30) -framework-bluetooth(minSdkVersion:current) framework-mediaprovider(minSdkVersion:30) framework-permission(minSdkVersion:30) framework-permission(minSdkVersion:current) framework-statsd(minSdkVersion:30) framework-statsd(minSdkVersion:current) framework-tethering(minSdkVersion:30) -framework-uwb(minSdkVersion:33) -framework-uwb(minSdkVersion:Tiramisu) +framework-uwb(minSdkVersion:current) framework-wifi(minSdkVersion:30) framework-wifi-util-lib(minSdkVersion:30) gemmlowp_headers(minSdkVersion:(no version)) GoogleCellBroadcastApp(minSdkVersion:29) GoogleCellBroadcastServiceModule(minSdkVersion:29) GoogleExtServices(minSdkVersion:30) +GoogleExtServices(minSdkVersion:current) GooglePermissionController(minSdkVersion:28) GooglePermissionController(minSdkVersion:30) -gpr_base(minSdkVersion:30) guava(minSdkVersion:current) gwp_asan_headers(minSdkVersion:S) icing-java-proto-lite(minSdkVersion:current) iconloader(minSdkVersion:21) iconloader(minSdkVersion:26) -internal_include_headers(minSdkVersion:30) ipmemorystore-aidl-interfaces-java(minSdkVersion:29) ipmemorystore-aidl-interfaces-V10-java(minSdkVersion:29) jacocoagent(minSdkVersion:9) @@ -296,11 +270,8 @@ libadbd_core(minSdkVersion:(no version)) libadbd_core(minSdkVersion:30) libadbd_services(minSdkVersion:(no version)) libadbd_services(minSdkVersion:30) -libaddress_sorting(minSdkVersion:30) libaidlcommonsupport(minSdkVersion:29) liballoc.rust_sysroot(minSdkVersion:29) -libalts_frame_protector(minSdkVersion:30) -libalts_util(minSdkVersion:30) libamrextractor(minSdkVersion:29) libandroid_log_sys(minSdkVersion:29) libandroid_logger(minSdkVersion:29) @@ -308,12 +279,10 @@ libanyhow(minSdkVersion:29) libapp_processes_protos_lite(minSdkVersion:(no version)) libapp_processes_protos_lite(minSdkVersion:30) libarect(minSdkVersion:29) -libarect_headers(minSdkVersion:29) libasync_safe(minSdkVersion:apex_inherit) libasyncio(minSdkVersion:(no version)) libasyncio(minSdkVersion:apex_inherit) libatomic(minSdkVersion:(no version)) -libaudio-a2dp-hw-utils(minSdkVersion:29) libaudio_system_headers(minSdkVersion:29) libaudioclient_aidl_conversion_util(minSdkVersion:29) libaudioclient_headers(minSdkVersion:29) @@ -338,15 +307,8 @@ libbinder_ndk_sys(minSdkVersion:Tiramisu) libbinder_rs(minSdkVersion:Tiramisu) libbinder_tokio_rs(minSdkVersion:Tiramisu) libbinderthreadstateutils(minSdkVersion:29) -libbitflags(minSdkVersion:29) -libbluetooth-types(minSdkVersion:29) libbluetooth-types-header(minSdkVersion:29) -libbluetooth_headers(minSdkVersion:30) libbrotli(minSdkVersion:(no version)) -libbt-platform-protos-lite(minSdkVersion:30) -libbt_keystore_cc(minSdkVersion:30) -libbt_keystore_cc_headers(minSdkVersion:30) -libbtcore_headers(minSdkVersion:30) libbuildversion(minSdkVersion:(no version)) libbuildversion(minSdkVersion:26) libbytes(minSdkVersion:29) @@ -360,10 +322,8 @@ libc_headers_arch(minSdkVersion:apex_inherit) libc_llndk_headers(minSdkVersion:apex_inherit) libc_scudo(minSdkVersion:apex_inherit) libcap(minSdkVersion:29) -libcesu8(minSdkVersion:29) libcfg_if(minSdkVersion:29) libcfg_if.rust_sysroot(minSdkVersion:29) -libchrome(minSdkVersion:30) libcodec2(minSdkVersion:29) libcodec2_headers(minSdkVersion:29) libcodec2_hidl@1.0(minSdkVersion:29) @@ -403,7 +363,6 @@ libcodec2_soft_vp9dec(minSdkVersion:29) libcodec2_soft_vp9enc(minSdkVersion:29) libcodec2_vndk(minSdkVersion:29) libcom_android_networkstack_tethering_util_jni(minSdkVersion:30) -libcombine(minSdkVersion:29) libcompiler_builtins.rust_sysroot(minSdkVersion:29) libcore.rust_sysroot(minSdkVersion:29) libcrypto(minSdkVersion:29) @@ -411,11 +370,8 @@ libcrypto_static(minSdkVersion:(no version)) libcrypto_utils(minSdkVersion:(no version)) libcrypto_utils(minSdkVersion:apex_inherit) libcutils(minSdkVersion:29) -libcutils_bindgen(minSdkVersion:29) libcutils_headers(minSdkVersion:29) libcutils_sockets(minSdkVersion:29) -libcxx(minSdkVersion:29) -libcxxbridge05(minSdkVersion:29) libdexfile_external_headers(minSdkVersion:31) libdexfile_support(minSdkVersion:31) libdiagnose_usb(minSdkVersion:(no version)) @@ -423,13 +379,9 @@ libdiagnose_usb(minSdkVersion:apex_inherit) libdmabufheap(minSdkVersion:29) libdmabufinfo(minSdkVersion:S) libdoh_ffi(minSdkVersion:29) -libdowncast_rs(minSdkVersion:29) libeigen(minSdkVersion:(no version)) libenv_logger(minSdkVersion:29) -liberror_headers(minSdkVersion:29) -libevent(minSdkVersion:30) libexpat(minSdkVersion:apex_inherit) -libexpectedutils_headers(minSdkVersion:29) libextservices(minSdkVersion:30) libextservices_jni(minSdkVersion:30) libfft2d(minSdkVersion:30) @@ -438,7 +390,6 @@ libFLAC(minSdkVersion:29) libFLAC-config(minSdkVersion:29) libFLAC-headers(minSdkVersion:29) libflacextractor(minSdkVersion:29) -libflatbuffers-cpp(minSdkVersion:30) libfmq(minSdkVersion:29) libfmq-base(minSdkVersion:29) libform_urlencoded(minSdkVersion:29) @@ -458,41 +409,6 @@ libgcc_stripped(minSdkVersion:(no version)) libgetopts(minSdkVersion:29) libgralloctypes(minSdkVersion:29) libgrallocusage(minSdkVersion:29) -libgrpc(minSdkVersion:30) -libgrpc++(minSdkVersion:30) -libgrpc++_base(minSdkVersion:30) -libgrpc++_codegen_base_src(minSdkVersion:30) -libgrpc_base(minSdkVersion:30) -libgrpc_base_c(minSdkVersion:30) -libgrpc_bindgen(minSdkVersion:29) -libgrpc_client_authority_filter(minSdkVersion:30) -libgrpc_client_channel(minSdkVersion:30) -libgrpc_deadline_filter(minSdkVersion:30) -libgrpc_http_filters(minSdkVersion:30) -libgrpc_lb_policy_grpclb_secure(minSdkVersion:30) -libgrpc_lb_policy_pick_first(minSdkVersion:30) -libgrpc_lb_policy_round_robin(minSdkVersion:30) -libgrpc_max_age_filter(minSdkVersion:30) -libgrpc_message_size_filter(minSdkVersion:30) -libgrpc_resolver_dns_ares(minSdkVersion:30) -libgrpc_resolver_dns_native(minSdkVersion:30) -libgrpc_resolver_fake(minSdkVersion:30) -libgrpc_resolver_sockaddr(minSdkVersion:30) -libgrpc_secure(minSdkVersion:30) -libgrpc_server_backward_compatibility(minSdkVersion:30) -libgrpc_trace(minSdkVersion:30) -libgrpc_transport_chttp2(minSdkVersion:30) -libgrpc_transport_chttp2_alpn(minSdkVersion:30) -libgrpc_transport_chttp2_client_connector(minSdkVersion:30) -libgrpc_transport_chttp2_client_insecure(minSdkVersion:30) -libgrpc_transport_chttp2_client_secure(minSdkVersion:30) -libgrpc_transport_chttp2_server_insecure(minSdkVersion:30) -libgrpc_transport_chttp2_server_secure(minSdkVersion:30) -libgrpc_transport_inproc(minSdkVersion:30) -libgrpc_workaround_cronet_compression_filter(minSdkVersion:30) -libgrpc_wrap(minSdkVersion:29) -libgrpcio(minSdkVersion:29) -libgrpcio_sys(minSdkVersion:29) libgsm(minSdkVersion:apex_inherit) libgtest_prod(minSdkVersion:apex_inherit) libgtest_prod_headers(minSdkVersion:apex_inherit) @@ -510,24 +426,17 @@ libhwbinder_headers(minSdkVersion:29) libidna(minSdkVersion:29) libion(minSdkVersion:29) libip_checksum(minSdkVersion:30) -libjni(minSdkVersion:29) -libjni_sys(minSdkVersion:29) libjsoncpp(minSdkVersion:29) libkll(minSdkVersion:30) libkll-encoder(minSdkVersion:30) libkll-protos(minSdkVersion:30) liblazy_static(minSdkVersion:29) -libldacBT_abr(minSdkVersion:Tiramisu) -libldacBT_enc(minSdkVersion:Tiramisu) liblibc(minSdkVersion:29) liblibc.rust_sysroot(minSdkVersion:29) libLibGuiProperties(minSdkVersion:29) liblibm(minSdkVersion:29) -liblibz_sys(minSdkVersion:29) -liblock_api(minSdkVersion:29) liblog_headers(minSdkVersion:29) liblog_rust(minSdkVersion:29) -liblogger(minSdkVersion:29) liblua(minSdkVersion:(no version)) liblua(minSdkVersion:30) liblz4(minSdkVersion:(no version)) @@ -545,7 +454,6 @@ libmedia_midiiowrapper(minSdkVersion:29) libmediaformatshaper(minSdkVersion:29) libmemchr(minSdkVersion:29) libmeminfo(minSdkVersion:S) -libmemoffset(minSdkVersion:29) libminijail(minSdkVersion:29) libminijail_gen_constants(minSdkVersion:(no version)) libminijail_gen_constants_obj(minSdkVersion:29) @@ -554,7 +462,6 @@ libminijail_gen_syscall_obj(minSdkVersion:29) libminijail_generated(minSdkVersion:29) libmio(minSdkVersion:29) libmkvextractor(minSdkVersion:29) -libmodpb64(minSdkVersion:30) libmp3extractor(minSdkVersion:29) libmp4extractor(minSdkVersion:29) libmpeg2dec(minSdkVersion:29) @@ -573,26 +480,19 @@ libnetdutils(minSdkVersion:29) libnetjniutils(minSdkVersion:29) libnetworkstackutilsjni(minSdkVersion:29) libneuralnetworks_common(minSdkVersion:(no version)) -libneuralnetworks_common(minSdkVersion:30) libneuralnetworks_headers(minSdkVersion:(no version)) -libneuralnetworks_headers(minSdkVersion:30) libneuralnetworks_shim_static(minSdkVersion:30) -libnix(minSdkVersion:29) libnum_cpus(minSdkVersion:29) -libnum_traits(minSdkVersion:29) liboggextractor(minSdkVersion:29) libonce_cell(minSdkVersion:29) libopenjdkjvmti_headers(minSdkVersion:31) libopus(minSdkVersion:29) libpanic_abort.rust_sysroot(minSdkVersion:29) -libparking_lot(minSdkVersion:29) -libparking_lot_core(minSdkVersion:29) libpercent_encoding(minSdkVersion:29) libperfetto_client_experimental(minSdkVersion:S) libpin_project_lite(minSdkVersion:29) libpin_utils(minSdkVersion:29) libPlatformProperties(minSdkVersion:S) -libpower(minSdkVersion:Tiramisu) libproc_macro_nested(minSdkVersion:29) libprocessgroup(minSdkVersion:29) libprocessgroup_headers(minSdkVersion:29) @@ -604,14 +504,8 @@ libprofile-clang-extras_ndk(minSdkVersion:(no version)) libprofile-extras(minSdkVersion:(no version)) libprofile-extras_ndk(minSdkVersion:(no version)) libprofiler_builtins.rust_sysroot(minSdkVersion:29) -libprotobuf(minSdkVersion:29) -libprotobuf-c-nano(minSdkVersion:30) -libprotobuf-cpp-full(minSdkVersion:29) libprotobuf-cpp-lite(minSdkVersion:29) -libprotobuf-cpp-lite-ndk(minSdkVersion:(no version)) -libprotobuf-cpp-lite-ndk(minSdkVersion:33) libprotobuf-java-lite(minSdkVersion:current) -libprotobuf-java-micro(minSdkVersion:8) libprotobuf-java-nano(minSdkVersion:9) libprotoutil(minSdkVersion:(no version)) libqemu_pipe(minSdkVersion:(no version)) @@ -622,12 +516,9 @@ libring-test(minSdkVersion:29) librustc_demangle(minSdkVersion:(no version)) librustc_demangle.rust_sysroot(minSdkVersion:29) librustc_demangle_static(minSdkVersion:(no version)) -librustutils(minSdkVersion:29) libruy_static(minSdkVersion:30) -libscopeguard(minSdkVersion:29) libsfplugin_ccodec_utils(minSdkVersion:29) libslab(minSdkVersion:29) -libsmallvec(minSdkVersion:29) libsonivoxwithoutjet(minSdkVersion:29) libspeexresampler(minSdkVersion:29) libspin(minSdkVersion:29) @@ -661,7 +552,6 @@ libstd(minSdkVersion:29) libstd_detect.rust_sysroot(minSdkVersion:29) libsync(minSdkVersion:(no version)) libsystem_headers(minSdkVersion:apex_inherit) -libsystem_properties_bindgen(minSdkVersion:29) libsysutils(minSdkVersion:apex_inherit) libtcutils(minSdkVersion:30) libterm(minSdkVersion:29) @@ -671,7 +561,6 @@ libtextclassifier(minSdkVersion:30) libtextclassifier-java(minSdkVersion:28) libtextclassifier-java(minSdkVersion:current) libtextclassifier_abseil(minSdkVersion:30) -libtextclassifier_bert_tokenizer(minSdkVersion:30) libtextclassifier_flatbuffer_headers(minSdkVersion:30) libtextclassifier_hash_headers(minSdkVersion:(no version)) libtextclassifier_hash_static(minSdkVersion:(no version)) @@ -683,9 +572,6 @@ libtinyvec(minSdkVersion:29) libtinyvec_macros(minSdkVersion:29) libtinyxml2(minSdkVersion:S) libtokio(minSdkVersion:29) -libtokio_stream(minSdkVersion:29) -libtsi(minSdkVersion:30) -libtsi_interface(minSdkVersion:30) libui(minSdkVersion:29) libui-types(minSdkVersion:apex_inherit) libui_headers(minSdkVersion:29) @@ -701,7 +587,6 @@ libutf(minSdkVersion:(no version)) libutf(minSdkVersion:14) libutils(minSdkVersion:apex_inherit) libutils_headers(minSdkVersion:apex_inherit) -libuwb_uci_packets(minSdkVersion:Tiramisu) libvorbisidec(minSdkVersion:29) libvpx(minSdkVersion:29) libwavextractor(minSdkVersion:29) @@ -724,15 +609,12 @@ metrics-constants-protos(minSdkVersion:current) modules-utils-backgroundthread(minSdkVersion:29) modules-utils-build(minSdkVersion:29) modules-utils-build_system(minSdkVersion:29) -modules-utils-bytesmatcher(minSdkVersion:29) modules-utils-handlerexecutor(minSdkVersion:29) modules-utils-list-slice(minSdkVersion:30) -modules-utils-locallog(minSdkVersion:30) modules-utils-os(minSdkVersion:30) modules-utils-preconditions(minSdkVersion:29) modules-utils-shell-command-handler(minSdkVersion:29) modules-utils-statemachine(minSdkVersion:29) -modules-utils-synchronous-result-receiver(minSdkVersion:29) modules-utils-uieventlogger-interface(minSdkVersion:29) ndk_crtbegin_so.21(minSdkVersion:(no version)) ndk_crtbegin_so.27(minSdkVersion:(no version)) @@ -759,8 +641,6 @@ netd_aidl_interface-V6-java(minSdkVersion:29) netd_aidl_interface-V7-java(minSdkVersion:29) netd_aidl_interface-V8-java(minSdkVersion:29) netd_aidl_interface-V8-ndk(minSdkVersion:29) -netd_aidl_interface-V9-java(minSdkVersion:29) -netd_aidl_interface-V9-ndk(minSdkVersion:29) netd_event_listener_interface-java(minSdkVersion:29) netd_event_listener_interface-lateststable-java(minSdkVersion:29) netd_event_listener_interface-ndk_platform(minSdkVersion:29) @@ -780,7 +660,6 @@ NetworkStackApi29Shims(minSdkVersion:29) NetworkStackApi30Shims(minSdkVersion:29) NetworkStackApi31Shims(minSdkVersion:29) NetworkStackApi33Shims(minSdkVersion:29) -NetworkStackApi34Shims(minSdkVersion:29) NetworkStackApiCurrentShims(minSdkVersion:29) NetworkStackApiStableLib(minSdkVersion:29) NetworkStackApiStableShims(minSdkVersion:29) @@ -969,7 +848,6 @@ prebuilt_asm-commons-9.2(minSdkVersion:current) prebuilt_asm-tree-7.0(minSdkVersion:current) prebuilt_asm-tree-9.2(minSdkVersion:current) prebuilt_bionic_libc_platform_headers(minSdkVersion:(no version)) -prebuilt_car-ui-lib-nodeps(minSdkVersion:28) prebuilt_com.google.android.material_material-nodeps(minSdkVersion:(no version)) prebuilt_com.google.android.material_material-nodeps(minSdkVersion:14) prebuilt_crtbegin_dynamic(minSdkVersion:(no version)) @@ -1007,7 +885,6 @@ prebuilt_perfetto_trace_protos(minSdkVersion:(no version)) prebuilt_test_framework-sdkextensions(minSdkVersion:(no version)) resourceobserver_aidl_interface-V1-ndk(minSdkVersion:29) resourceobserver_aidl_interface-V1-ndk_platform(minSdkVersion:29) -sap-api-java-static(minSdkVersion:30) server_configurable_flags(minSdkVersion:29) ServiceWifiResourcesGoogle(minSdkVersion:30) SettingsLibActionBarShadow(minSdkVersion:21) @@ -1023,7 +900,6 @@ SettingsLibProgressBar(minSdkVersion:21) SettingsLibRadioButtonPreference(minSdkVersion:21) SettingsLibRestrictedLockUtils(minSdkVersion:21) SettingsLibSearchWidget(minSdkVersion:21) -SettingsLibSelectorWithWidgetPreference(minSdkVersion:21) SettingsLibSettingsTheme(minSdkVersion:21) SettingsLibSettingsTransition(minSdkVersion:29) SettingsLibTopIntroPreference(minSdkVersion:21) @@ -1035,7 +911,6 @@ statsd-aidl-ndk_platform(minSdkVersion:(no version)) statsd-aidl-ndk_platform(minSdkVersion:30) statsprotos(minSdkVersion:29) tensorflow_headers(minSdkVersion:(no version)) -tensorflowlite_java(minSdkVersion:30) TetheringApiCurrentLib(minSdkVersion:30) textclassifier-java-proto-lite(minSdkVersion:30) textclassifier-statsd(minSdkVersion:30) @@ -1045,13 +920,6 @@ TextClassifierNotificationLibNoManifest(minSdkVersion:30) TextClassifierServiceLibNoManifest(minSdkVersion:28) TextClassifierServiceLibNoManifest(minSdkVersion:30) tflite_support(minSdkVersion:30) -tflite_support_base_task_api_java(minSdkVersion:30) -tflite_support_classifiers_java(minSdkVersion:30) -tflite_support_java(minSdkVersion:30) -tflite_support_libz(minSdkVersion:30) -tflite_support_metadata_extractor(minSdkVersion:30) -tflite_support_task_core_proto(minSdkVersion:30) -tflite_support_tokenizers(minSdkVersion:30) wifi-lite-protos(minSdkVersion:30) wifi-nano-protos(minSdkVersion:30) xz-java(minSdkVersion:current) diff --git a/build/build_unbundled_mainline_module.sh b/build/build_unbundled_mainline_module.sh index ed4b0849..7c2478f9 100755 --- a/build/build_unbundled_mainline_module.sh +++ b/build/build_unbundled_mainline_module.sh @@ -56,6 +56,7 @@ readonly -a DEFAULT_MODULES=( com.android.runtime com.android.sdkext com.android.sepolicy + com.android.telephony # TODO(b/210694291): include tethering module in the build # com.android.tethering com.android.tzdata @@ -67,8 +68,8 @@ readonly -a DEFAULT_MODULES=( CaptivePortalLogin DocumentsUI ExtServices + NetworkPermissionConfig NetworkStack - NetworkStackNext PermissionController ) diff --git a/build/mainline_modules_sdks.py b/build/mainline_modules_sdks.py index 734b44fe..626dee03 100755 --- a/build/mainline_modules_sdks.py +++ b/build/mainline_modules_sdks.py @@ -20,9 +20,7 @@ the APEXes in it are built, otherwise all configured SDKs are built. """ import argparse import dataclasses -import functools import io -import json import os import re import shutil @@ -163,29 +161,25 @@ class SoongConfigBoilerplateInserter(FileTransformation): }}, }},""") - # Add the module type to the list of module types that need to - # have corresponding config module types. - config_module_types.add(module_type) - # Change the module type to the corresponding soong config # module type by adding the prefix. module_type = self.configModuleTypePrefix + module_type + # Add the module type to the list of module types that need to + # be imported into the bp file. + config_module_types.add(module_type) # Generate the module, possibly with the new module type and - # containing the soong config variables entry. + # containing the content_lines.append(module_type + " {") content_lines.extend(module_content) content_lines.append("}") - if self.configBpDefFile: - # Add the soong_config_module_type_import module definition that - # imports the soong config module types into this bp file to the - # header lines so that they appear before any uses. - module_types = "\n".join([ - f' "{self.configModuleTypePrefix}{mt}",' - for mt in sorted(config_module_types) - ]) - header_lines.append(f""" + # Add the soong_config_module_type_import module definition that imports + # the soong config module types into this bp file to the header lines so + # that they appear before any uses. + module_types = "\n".join( + [f' "{mt}",' for mt in sorted(config_module_types)]) + header_lines.append(f""" // Soong config variable stanza added by {producer.script}. soong_config_module_type_import {{ from: "{self.configBpDefFile}", @@ -194,24 +188,6 @@ soong_config_module_type_import {{ ], }} """) - else: - # Add the soong_config_module_type module definitions to the header - # lines so that they appear before any uses. - header_lines.append("") - for module_type in sorted(config_module_types): - # Create the corresponding soong config module type name by - # adding the prefix. - config_module_type = self.configModuleTypePrefix + module_type - header_lines.append(f""" -// Soong config variable module type added by {producer.script}. -soong_config_module_type {{ - name: "{config_module_type}", - module_type: "{module_type}", - config_namespace: "{self.configVar.namespace}", - bool_variables: ["{self.configVar.name}"], - properties: ["prefer"], -}} -""".lstrip()) # Overwrite the file with the updated contents. file.seek(0) @@ -245,16 +221,6 @@ def sdk_snapshot_zip_file(snapshots_dir, sdk_name, sdk_version): return os.path.join(snapshots_dir, f"{sdk_name}-{sdk_version}.zip") -def sdk_snapshot_info_file(snapshots_dir, sdk_name, sdk_version): - """Get the path to the sdk snapshot info file.""" - return os.path.join(snapshots_dir, f"{sdk_name}-{sdk_version}.info") - - -def sdk_snapshot_api_diff_file(snapshots_dir, sdk_name, sdk_version): - """Get the path to the sdk snapshot api diff file.""" - return os.path.join(snapshots_dir, f"{sdk_name}-{sdk_version}-api-diff.txt") - - @dataclasses.dataclass() class SnapshotBuilder: """Builds sdk snapshots""" @@ -280,41 +246,6 @@ class SnapshotBuilder: return os.path.join(self.mainline_sdks_dir, f"{sdk_name}-{sdk_version}.zip") - def build_target_paths(self, build_release, sdk_version, target_paths): - # Extra environment variables to pass to the build process. - extraEnv = { - # TODO(ngeoffray): remove SOONG_ALLOW_MISSING_DEPENDENCIES, but - # we currently break without it. - "SOONG_ALLOW_MISSING_DEPENDENCIES": "true", - # Set SOONG_SDK_SNAPSHOT_USE_SRCJAR to generate .srcjars inside - # sdk zip files as expected by prebuilt drop. - "SOONG_SDK_SNAPSHOT_USE_SRCJAR": "true", - # Set SOONG_SDK_SNAPSHOT_VERSION to generate the appropriately - # tagged version of the sdk. - "SOONG_SDK_SNAPSHOT_VERSION": sdk_version, - } - extraEnv.update(build_release.soong_env) - - # Unless explicitly specified in the calling environment set - # TARGET_BUILD_VARIANT=user. - # This MUST be identical to the TARGET_BUILD_VARIANT used to build - # the corresponding APEXes otherwise it could result in different - # hidden API flags, see http://b/202398851#comment29 for more info. - target_build_variant = os.environ.get("TARGET_BUILD_VARIANT", "user") - cmd = [ - "build/soong/soong_ui.bash", - "--make-mode", - "--soong-only", - f"TARGET_BUILD_VARIANT={target_build_variant}", - "TARGET_PRODUCT=mainline_sdk", - "MODULE_BUILD_FROM_SOURCE=true", - "out/soong/apex/depsinfo/new-allowed-deps.txt.check", - ] + target_paths - print_command(extraEnv, cmd) - env = os.environ.copy() - env.update(extraEnv) - self.subprocess_runner.run(cmd, env=env) - def build_snapshots(self, build_release, sdk_versions, modules): # Build the SDKs once for each version. for sdk_version in sdk_versions: @@ -326,7 +257,40 @@ class SnapshotBuilder: for sdk in module.sdks ] - self.build_target_paths(build_release, sdk_version, paths) + # Extra environment variables to pass to the build process. + extraEnv = { + # TODO(ngeoffray): remove SOONG_ALLOW_MISSING_DEPENDENCIES, but + # we currently break without it. + "SOONG_ALLOW_MISSING_DEPENDENCIES": "true", + # Set SOONG_SDK_SNAPSHOT_USE_SRCJAR to generate .srcjars inside + # sdk zip files as expected by prebuilt drop. + "SOONG_SDK_SNAPSHOT_USE_SRCJAR": "true", + # Set SOONG_SDK_SNAPSHOT_VERSION to generate the appropriately + # tagged version of the sdk. + "SOONG_SDK_SNAPSHOT_VERSION": sdk_version, + } + extraEnv.update(build_release.soong_env) + + # Unless explicitly specified in the calling environment set + # TARGET_BUILD_VARIANT=user. + # This MUST be identical to the TARGET_BUILD_VARIANT used to build + # the corresponding APEXes otherwise it could result in different + # hidden API flags, see http://b/202398851#comment29 for more info. + target_build_variant = os.environ.get("TARGET_BUILD_VARIANT", + "user") + cmd = [ + "build/soong/soong_ui.bash", + "--make-mode", + "--soong-only", + f"TARGET_BUILD_VARIANT={target_build_variant}", + "TARGET_PRODUCT=mainline_sdk", + "MODULE_BUILD_FROM_SOURCE=true", + "out/soong/apex/depsinfo/new-allowed-deps.txt.check", + ] + paths + print_command(extraEnv, cmd) + env = os.environ.copy() + env.update(extraEnv) + self.subprocess_runner.run(cmd, env=env) return self.mainline_sdks_dir def build_snapshots_for_build_r(self, build_release, sdk_versions, modules): @@ -415,112 +379,6 @@ java_sdk_library_import {{ return r_snapshot_dir - @staticmethod - def does_sdk_library_support_latest_api(sdk_library): - # TODO(b/235330409): remove service art from the exception list once - # this bug is fixed. - if sdk_library == "service-art" or \ - sdk_library == "conscrypt.module.platform.api": - return False - return True - - def latest_api_file_targets(self, sdk_info_file): - # Read the sdk info file and fetch the latest scope targets. - with open(sdk_info_file, "r") as sdk_info_file_object: - sdk_info_file_json = json.loads(sdk_info_file_object.read()) - - target_paths = [] - target_dict = dict() - for jsonItem in sdk_info_file_json: - if not jsonItem["@type"] == "java_sdk_library": - continue - - sdk_library = jsonItem["@name"] - if not self.does_sdk_library_support_latest_api(sdk_library): - continue - - target_dict[sdk_library] = dict() - for scope in jsonItem["scopes"]: - scope_json = jsonItem["scopes"][scope] - target_dict[sdk_library][scope] = dict() - target_list = [ - "current_api", "latest_api", "removed_api", - "latest_removed_api" - ] - for target in target_list: - target_dict[sdk_library][scope][target] = scope_json[target] - target_paths.append(scope_json["latest_api"]) - target_paths.append(scope_json["latest_removed_api"]) - - return target_paths, target_dict - - def build_sdk_scope_targets(self, build_release, sdk_version, modules): - # Build the latest scope targets for each module sdk - # Compute the paths to all the latest scope targets for each module sdk. - target_paths = [] - target_dict = dict() - for module in modules: - for sdk in module.sdks: - if "host-exports" in sdk or "test-exports" in sdk: - continue - - sdk_info_file = sdk_snapshot_info_file(self.mainline_sdks_dir, - sdk, sdk_version) - paths, dict_item = self.latest_api_file_targets(sdk_info_file) - target_paths.extend(paths) - target_dict[sdk_info_file] = dict_item - self.build_target_paths(build_release, sdk_version, target_paths) - return target_dict - - def appendDiffToFile(self, file_object, sdk_zip_file, current_api, - latest_api, snapshots_dir): - """Extract current api and find its diff with the latest api.""" - with zipfile.ZipFile(sdk_zip_file, "r") as zipObj: - extracted_current_api = zipObj.extract( - member=current_api, path=snapshots_dir) - diff = subprocess.run( - ["diff", "-u0", latest_api, extracted_current_api], - capture_output=True).stdout.decode("utf-8") - file_object.write(diff) - - def create_snapshot_api_diff(self, sdk, sdk_version, target_dict, - snapshots_dir): - """Creates api diff files for each module sdk. - - For each module sdk, the scope targets are obtained for each java sdk - library and the api diff files are generated by performing a diff - operation between the current api file vs the latest api file. - """ - sdk_info_file = sdk_snapshot_info_file(snapshots_dir, sdk, sdk_version) - sdk_zip_file = sdk_snapshot_zip_file(snapshots_dir, sdk, sdk_version) - sdk_api_diff_file = sdk_snapshot_api_diff_file(snapshots_dir, sdk, - sdk_version) - with open(sdk_api_diff_file, "w") as sdk_api_diff_file_object: - for sdk_library in target_dict[sdk_info_file]: - for scope in target_dict[sdk_info_file][sdk_library]: - scope_json = target_dict[sdk_info_file][sdk_library][scope] - current_api = scope_json["current_api"] - latest_api = scope_json["latest_api"] - self.appendDiffToFile(sdk_api_diff_file_object, - sdk_zip_file, current_api, latest_api, - snapshots_dir) - - removed_api = scope_json["removed_api"] - latest_removed_api = scope_json["latest_removed_api"] - self.appendDiffToFile(sdk_api_diff_file_object, - sdk_zip_file, removed_api, - latest_removed_api, snapshots_dir) - - def build_snapshot_api_diff(self, sdk_version, modules, target_dict, - snapshots_dir): - """For each module sdk, create the api diff file.""" - for module in modules: - for sdk in module.sdks: - if "host-exports" in sdk or "test-exports" in sdk: - continue - self.create_snapshot_api_diff(sdk, sdk_version, target_dict, - snapshots_dir) - # A list of the sdk versions to build. Usually just current but can include a # numeric version too. @@ -538,7 +396,6 @@ ALL_BUILD_RELEASES = [] @dataclasses.dataclass(frozen=True) -@functools.total_ordering class BuildRelease: """Represents a build release""" @@ -596,9 +453,6 @@ class BuildRelease: "SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": self.name, }) - def __eq__(self, other): - return self.ordinal == other.ordinal - def __le__(self, other): return self.ordinal <= other.ordinal @@ -631,6 +485,36 @@ def create_latest_sdk_snapshots(build_release: BuildRelease, producer.produce_bundled_dist_for_build_release(build_release, modules) +def create_legacy_dist_structures(build_release: BuildRelease, + producer: "SdkDistProducer", + modules: List["MainlineModule"]): + """Creates legacy file structures.""" + + # Only put unbundled modules in the legacy dist and stubs structures. + modules = [m for m in modules if not m.is_bundled()] + + snapshots_dir = producer.produce_unbundled_dist_for_build_release( + build_release, modules) + + # Create the out/dist/mainline-sdks/stubs structure. + # TODO(b/199759953): Remove stubs once it is no longer used by gantry. + # Clear and populate the stubs directory. + dist_dir = producer.dist_dir + stubs_dir = os.path.join(dist_dir, "stubs") + shutil.rmtree(stubs_dir, ignore_errors=True) + + for module in modules: + apex = module.apex + dest_dir = os.path.join(dist_dir, "stubs", apex) + for sdk in module.sdks: + # If the sdk's name ends with -sdk then extract sdk library + # related files from its zip file. + if sdk.endswith("-sdk"): + sdk_file = sdk_snapshot_zip_file(snapshots_dir, sdk, "current") + extract_matching_files_from_zip(sdk_file, dest_dir, + sdk_library_files_pattern()) + + Q = BuildRelease( name="Q", # At the moment we do not generate a snapshot for Q. @@ -662,7 +546,8 @@ Tiramisu = BuildRelease( # before LATEST. # The build release for the latest build supported by this build, i.e. the -# current build. This must be the last BuildRelease defined in this script. +# current build. This must be the last BuildRelease defined in this script, +# before LEGACY_BUILD_RELEASE. LATEST = BuildRelease( name="latest", creator=create_latest_sdk_snapshots, @@ -671,6 +556,20 @@ LATEST = BuildRelease( soong_env={}, ) +# The build release to populate the legacy dist structure that does not specify +# a particular build release. This MUST come after LATEST so that it includes +# all the modules for which sdk snapshot source is available. +LEGACY_BUILD_RELEASE = BuildRelease( + name="legacy", + # There is no build release specific sub directory. + sub_dir="", + # Create snapshots needed for legacy tools. + creator=create_legacy_dist_structures, + # There are no build release specific environment variables to pass to + # Soong. + soong_env={}, +) + @dataclasses.dataclass(frozen=True) class SdkLibrary: @@ -712,7 +611,11 @@ class MainlineModule: # source was first included. So, a module that was added in build T # could potentially be used in an S release and so its SDK will need # to be made available for S builds. - first_release: BuildRelease + # + # Defaults to the latest build, i.e. the build on which this script is run + # as the snapshot is assumed to be needed in the build containing the sdk + # source. + first_release: BuildRelease = LATEST # The configuration variable, defaults to ANDROID:module_build_from_source configVar: ConfigVar = ConfigVar( @@ -729,30 +632,6 @@ class MainlineModule: for_r_build: typing.Optional[ForRBuild] = None - # The last release on which this module was optional. - # - # Some modules are optional when they are first released, usually because - # some vendors of Android devices have their own customizations of the - # module that they would like to preserve and which cannot yet be achieved - # through the existing APIs. Once those issues have been resolved then they - # will become mandatory. - # - # This field records the last build release in which they are optional. It - # defaults to None which indicates that the module was never optional. - last_optional_release: typing.Optional[BuildRelease] = None - - # The short name for the module. - # - # Defaults to the last part of the apex name. - short_name: str = "" - - def __post_init__(self): - # If short_name is not set then set it to the last component of the apex - # name. - if not self.short_name: - short_name = self.apex.rsplit(".", 1)[-1] - object.__setattr__(self, "short_name", short_name) - def is_bundled(self): """Returns true for bundled modules. See BundledMainlineModule.""" return False @@ -761,29 +640,11 @@ class MainlineModule: """Returns the transformations to apply to this module's snapshot(s).""" transformations = [] if build_release.supports_soong_config_boilerplate: - - config_var = self.configVar - config_module_type_prefix = self.configModuleTypePrefix - config_bp_def_file = self.configBpDefFile - - # If the module is optional then it needs its own Soong config - # variable to allow it to be managed separately from other modules. - if (self.last_optional_release and - self.last_optional_release > build_release): - config_var = ConfigVar( - namespace=f"{self.short_name}_module", - name="source_build", - ) - config_module_type_prefix = f"{self.short_name}_prebuilt_" - # Optional modules don't have their own config_bp_def_file so - # they have to generate the soong_config_module_types inline. - config_bp_def_file = "" - inserter = SoongConfigBoilerplateInserter( "Android.bp", - configVar=config_var, - configModuleTypePrefix=config_module_type_prefix, - configBpDefFile=config_bp_def_file) + configVar=self.configVar, + configModuleTypePrefix=self.configModuleTypePrefix, + configBpDefFile=self.configBpDefFile) transformations.append(inserter) return transformations @@ -799,10 +660,6 @@ class BundledMainlineModule(MainlineModule): A bundled module is always preloaded into the platform images. """ - # Defaults to the latest build, i.e. the build on which this script is run - # as bundled modules are, by definition, only needed in this build. - first_release: BuildRelease = LATEST - def is_bundled(self): return True @@ -816,16 +673,6 @@ class BundledMainlineModule(MainlineModule): # List of mainline modules. MAINLINE_MODULES = [ MainlineModule( - apex="com.android.adservices", - sdks=["adservices-module-sdk"], - first_release=Tiramisu, - ), - MainlineModule( - apex="com.android.appsearch", - sdks=["appsearch-sdk"], - first_release=Tiramisu, - ), - MainlineModule( apex="com.android.art", sdks=[ "art-module-sdk", @@ -842,13 +689,6 @@ MAINLINE_MODULES = [ configModuleTypePrefix="art_prebuilt_", ), MainlineModule( - apex="com.android.bluetooth", - sdks=["bluetooth-module-sdk"], - first_release=Tiramisu, - # Bluetooth has always been and is still optional. - last_optional_release=LATEST, - ), - MainlineModule( apex="com.android.conscrypt", sdks=[ "conscrypt-module-sdk", @@ -889,11 +729,6 @@ MAINLINE_MODULES = [ ]), ), MainlineModule( - apex="com.android.ondevicepersonalization", - sdks=["ondevicepersonalization-module-sdk"], - first_release=Tiramisu, - ), - MainlineModule( apex="com.android.permission", sdks=["permission-module-sdk"], first_release=R, @@ -907,7 +742,6 @@ MAINLINE_MODULES = [ MainlineModule( apex="com.android.scheduling", sdks=["scheduling-sdk"], - first_release=S, ), MainlineModule( apex="com.android.sdkext", @@ -934,25 +768,16 @@ MAINLINE_MODULES = [ ]), ), MainlineModule( - apex="com.android.uwb", - sdks=["uwb-module-sdk"], - first_release=Tiramisu, - # Uwb has always been and is still optional. - last_optional_release=LATEST, - ), - MainlineModule( apex="com.android.wifi", sdks=["wifi-module-sdk"], first_release=R, for_r_build=ForRBuild(sdk_libraries=[ SdkLibrary(name="framework-wifi"), ]), - # Wifi has always been and is still optional. - last_optional_release=LATEST, ), ] -# List of Mainline modules that currently are never built unbundled. They must +# List of Mainline modules that currently are never built unbundled. They should # not specify first_release, and they don't have com.google.android # counterparts. BUNDLED_MAINLINE_MODULES = [ @@ -1073,11 +898,6 @@ class SdkDistProducer: sdk_versions = build_release.sdk_versions snapshots_dir = self.snapshot_builder.build_snapshots( build_release, sdk_versions, modules) - if build_release == LATEST: - target_dict = self.snapshot_builder.build_sdk_scope_targets( - build_release, "current", modules) - self.snapshot_builder.build_snapshot_api_diff( - "current", modules, target_dict, snapshots_dir) self.populate_unbundled_dist(build_release, sdk_versions, modules, snapshots_dir) return snapshots_dir @@ -1090,18 +910,6 @@ class SdkDistProducer: build_release, sdk_versions, modules) self.populate_bundled_dist(build_release, modules, snapshots_dir) - def dist_sdk_snapshot_api_diff(self, sdk_dist_dir, sdk, sdk_version, module, - snapshots_dir): - """Copy the sdk snapshot api diff file to a dist directory.""" - if "host-exports" in sdk or "test-exports" in sdk: - return - - sdk_dist_subdir = os.path.join(sdk_dist_dir, module.apex, "sdk") - os.makedirs(sdk_dist_subdir, exist_ok=True) - sdk_api_diff_path = sdk_snapshot_api_diff_file(snapshots_dir, sdk, - sdk_version) - shutil.copy(sdk_api_diff_path, sdk_dist_subdir) - def populate_unbundled_dist(self, build_release, sdk_versions, modules, snapshots_dir): build_release_dist_dir = os.path.join(self.mainline_sdks_dir, @@ -1111,10 +919,6 @@ class SdkDistProducer: for sdk in module.sdks: sdk_dist_dir = os.path.join(build_release_dist_dir, sdk_version) - if build_release == LATEST: - self.dist_sdk_snapshot_api_diff(sdk_dist_dir, sdk, - sdk_version, module, - snapshots_dir) self.populate_dist_snapshot(build_release, module, sdk, sdk_dist_dir, sdk_version, snapshots_dir) @@ -1149,7 +953,7 @@ class SdkDistProducer: and then a new zip file is created in the dist directory with the original files replaced by the newly transformed files. """ - os.makedirs(sdk_dist_dir, exist_ok=True) + os.makedirs(sdk_dist_dir) dest_sdk_zip = os.path.join(sdk_dist_dir, os.path.basename(src_sdk_zip)) print(f"Copying sdk snapshot {src_sdk_zip} to {dest_sdk_zip}") diff --git a/build/mainline_modules_sdks_test.py b/build/mainline_modules_sdks_test.py index 5dcd29a9..6d06303c 100644 --- a/build/mainline_modules_sdks_test.py +++ b/build/mainline_modules_sdks_test.py @@ -15,6 +15,7 @@ # limitations under the License. """Unit tests for mainline_modules_sdks.py.""" import dataclasses +import pathlib import re import typing from pathlib import Path @@ -47,8 +48,7 @@ class FakeSnapshotBuilder(mm.SnapshotBuilder): z.writestr(f"sdk_library/public/{name}-removed.txt", "") z.writestr(f"sdk_library/public/{name}.srcjar", "") z.writestr(f"sdk_library/public/{name}-stubs.jar", "") - z.writestr(f"sdk_library/public/{name}.txt", - "method public int testMethod(int);") + z.writestr(f"sdk_library/public/{name}.txt", "") def create_snapshot_file(self, out_dir, name, version, for_r_build): zip_file = Path(mm.sdk_snapshot_zip_file(out_dir, name, version)) @@ -75,63 +75,6 @@ class FakeSnapshotBuilder(mm.SnapshotBuilder): module.for_r_build) return sdks_out_dir - def get_art_module_info_file_data(self, sdk): - info_file_data = f"""[ - {{ - "@type": "java_sdk_library", - "@name": "art.module.public.api", - "@deps": [ - "libcore_license" - ], - "dist_stem": "art", - "scopes": {{ - "public": {{ - "current_api": "sdk_library/public/{re.sub(r"-.*$", "", sdk)}.txt", - "latest_api": "{Path(self.mainline_sdks_dir).joinpath("test")}/prebuilts/sdk/art.api.public.latest/gen/art.api.public.latest", - "latest_removed_api": "{Path(self.mainline_sdks_dir).joinpath("test")}/prebuilts/sdk/art-removed.api.public.latest/gen/art-removed.api.public.latest", - "removed_api": "sdk_library/public/{re.sub(r"-.*$", "", sdk)}-removed.txt" - }} - }} - }} -] -""" - return info_file_data - - @staticmethod - def write_data_to_file(file, data): - with open(file, "w") as file: - file.write(data) - - def create_snapshot_info_file(self, module, sdk_info_file, sdk): - if module == MAINLINE_MODULES_BY_APEX["com.android.art"]: - self.write_data_to_file(sdk_info_file, - self.get_art_module_info_file_data(sdk)) - else: - # For rest of the modules, generate an empty .info file. - self.write_data_to_file(sdk_info_file, "[]") - - def build_sdk_scope_targets(self, build_release, sdk_version, modules): - target_paths = [] - target_dict = dict() - for module in modules: - for sdk in module.sdks: - if "host-exports" in sdk or "test-exports" in sdk: - continue - - sdk_info_file = mm.sdk_snapshot_info_file( - Path(self.mainline_sdks_dir).joinpath("test"), sdk, - sdk_version) - self.create_snapshot_info_file(module, sdk_info_file, sdk) - paths, dict_item = self.latest_api_file_targets(sdk_info_file) - target_paths.extend(paths) - target_dict[sdk_info_file] = dict_item - - for target_path in target_paths: - os.makedirs(os.path.split(target_path)[0]) - self.write_data_to_file(target_path, "") - - return target_dict - class TestProduceDist(unittest.TestCase): @@ -185,12 +128,19 @@ class TestProduceDist(unittest.TestCase): mm.R, mm.S, mm.LATEST, + mm.LEGACY_BUILD_RELEASE, ] self.produce_dist(modules, build_releases) # pylint: disable=line-too-long self.assertEqual( [ + # Legacy copy of the snapshots, for use by tools that don't support build specific snapshots. + "mainline-sdks/current/com.android.art/host-exports/art-module-host-exports-current.zip", + "mainline-sdks/current/com.android.art/sdk/art-module-sdk-current.zip", + "mainline-sdks/current/com.android.art/test-exports/art-module-test-exports-current.zip", + "mainline-sdks/current/com.android.ipsec/sdk/ipsec-module-sdk-current.zip", + "mainline-sdks/current/com.google.android.wifi/sdk/wifi-module-sdk-current.zip", # Build specific snapshots. "mainline-sdks/for-R-build/current/com.android.ipsec/sdk/ipsec-module-sdk-current.zip", "mainline-sdks/for-R-build/current/com.google.android.wifi/sdk/wifi-module-sdk-current.zip", @@ -200,13 +150,23 @@ class TestProduceDist(unittest.TestCase): "mainline-sdks/for-S-build/current/com.android.ipsec/sdk/ipsec-module-sdk-current.zip", "mainline-sdks/for-S-build/current/com.google.android.wifi/sdk/wifi-module-sdk-current.zip", "mainline-sdks/for-latest-build/current/com.android.art/host-exports/art-module-host-exports-current.zip", - "mainline-sdks/for-latest-build/current/com.android.art/sdk/art-module-sdk-current-api-diff.txt", "mainline-sdks/for-latest-build/current/com.android.art/sdk/art-module-sdk-current.zip", "mainline-sdks/for-latest-build/current/com.android.art/test-exports/art-module-test-exports-current.zip", - "mainline-sdks/for-latest-build/current/com.android.ipsec/sdk/ipsec-module-sdk-current-api-diff.txt", "mainline-sdks/for-latest-build/current/com.android.ipsec/sdk/ipsec-module-sdk-current.zip", - "mainline-sdks/for-latest-build/current/com.google.android.wifi/sdk/wifi-module-sdk-current-api-diff.txt", "mainline-sdks/for-latest-build/current/com.google.android.wifi/sdk/wifi-module-sdk-current.zip", + # Legacy stubs directory containing unpacked java_sdk_library artifacts. + "stubs/com.android.art/sdk_library/public/art-removed.txt", + "stubs/com.android.art/sdk_library/public/art-stubs.jar", + "stubs/com.android.art/sdk_library/public/art.srcjar", + "stubs/com.android.art/sdk_library/public/art.txt", + "stubs/com.android.ipsec/sdk_library/public/android.net.ipsec.ike-removed.txt", + "stubs/com.android.ipsec/sdk_library/public/android.net.ipsec.ike-stubs.jar", + "stubs/com.android.ipsec/sdk_library/public/android.net.ipsec.ike.srcjar", + "stubs/com.android.ipsec/sdk_library/public/android.net.ipsec.ike.txt", + "stubs/com.google.android.wifi/sdk_library/public/framework-wifi-removed.txt", + "stubs/com.google.android.wifi/sdk_library/public/framework-wifi-stubs.jar", + "stubs/com.google.android.wifi/sdk_library/public/framework-wifi.srcjar", + "stubs/com.google.android.wifi/sdk_library/public/framework-wifi.txt", ], sorted(self.list_files_in_dir(self.tmp_dist_dir))) @@ -281,20 +241,34 @@ class TestProduceDist(unittest.TestCase): "bundled-mainline-sdks/platform-mainline/test-exports/platform-mainline-test-exports-current.zip", # Unbundled (normal) modules. "mainline-sdks/for-latest-build/current/com.android.art/host-exports/art-module-host-exports-current.zip", - "mainline-sdks/for-latest-build/current/com.android.art/sdk/art-module-sdk-current-api-diff.txt", "mainline-sdks/for-latest-build/current/com.android.art/sdk/art-module-sdk-current.zip", "mainline-sdks/for-latest-build/current/com.android.art/test-exports/art-module-test-exports-current.zip", ], sorted(self.list_files_in_dir(self.tmp_dist_dir))) - art_api_diff_file = os.path.join( - self.tmp_dist_dir, - "mainline-sdks/for-latest-build/current/com.android.art/sdk/art-module-sdk-current-api-diff.txt" - ) - self.assertNotEqual( - os.path.getsize(art_api_diff_file), - 0, - msg="Api diff file should not be empty for the art module") + def test_legacy_release(self): + modules = [ + MAINLINE_MODULES_BY_APEX["com.android.art"], # An unnbundled module + MAINLINE_MODULES_BY_APEX["com.android.runtime"], # A bundled module + MAINLINE_MODULES_BY_APEX["platform-mainline"], # Platform SDK + ] + build_releases = [mm.LEGACY_BUILD_RELEASE] + self.produce_dist(modules, build_releases) + + # pylint: disable=line-too-long + self.assertEqual( + [ + # Legacy copy of the snapshots. + "mainline-sdks/current/com.android.art/host-exports/art-module-host-exports-current.zip", + "mainline-sdks/current/com.android.art/sdk/art-module-sdk-current.zip", + "mainline-sdks/current/com.android.art/test-exports/art-module-test-exports-current.zip", + # Legacy stubs directory containing unpacked java_sdk_library artifacts. + "stubs/com.android.art/sdk_library/public/art-removed.txt", + "stubs/com.android.art/sdk_library/public/art-stubs.jar", + "stubs/com.android.art/sdk_library/public/art.srcjar", + "stubs/com.android.art/sdk_library/public/art.txt", + ], + sorted(self.list_files_in_dir(self.tmp_dist_dir))) def create_build_number_file(self): soong_dir = os.path.join(self.tmp_out_dir, "soong") @@ -331,6 +305,7 @@ class TestProduceDist(unittest.TestCase): mm.R, mm.S, mm.LATEST, + mm.LEGACY_BUILD_RELEASE, ] producer.produce_dist(modules, build_releases) @@ -353,6 +328,15 @@ class TestProduceDist(unittest.TestCase): ], ), ( + "legacy", + {}, + ["current"], + [ + "com.android.art", "com.android.ipsec", + "com.google.android.wifi" + ], + ), + ( "S", { "SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE": "S" @@ -429,36 +413,6 @@ class TestSoongConfigBoilerplateInserter(unittest.TestCase): self.apply_transformations(src, transformations, expected) - # Check that Tiramisu provides the same transformations as S. - tiramisu_transformations = module.transformations(mm.Tiramisu) - self.assertEqual( - transformations, - tiramisu_transformations, - msg="Tiramisu must use the same transformations as S") - - def test_optional_mainline_module(self): - """Tests the transformations applied to an optional mainline module. - - This uses wifi as an example of a optional mainline module. This checks - that the module specific Soong config module types and variables are - used. - """ - src = read_test_data("wifi_Android.bp.input") - - expected = read_test_data("wifi_Android.bp.expected") - - module = MAINLINE_MODULES_BY_APEX["com.android.wifi"] - transformations = module.transformations(mm.S) - - self.apply_transformations(src, transformations, expected) - - # Check that Tiramisu provides the same transformations as S. - tiramisu_transformations = module.transformations(mm.Tiramisu) - self.assertEqual( - transformations, - tiramisu_transformations, - msg="Tiramisu must use the same transformations as S") - def test_art(self): """Tests the transformations applied to a the ART mainline module. diff --git a/build/mainline_modules_sdks_test_data/wifi_Android.bp.expected b/build/mainline_modules_sdks_test_data/wifi_Android.bp.expected deleted file mode 100644 index d68abfef..00000000 --- a/build/mainline_modules_sdks_test_data/wifi_Android.bp.expected +++ /dev/null @@ -1,168 +0,0 @@ -// This is auto-generated. DO NOT EDIT. - -// Soong config variable module type added by test_optional_mainline_module. -soong_config_module_type { - name: "wifi_prebuilt_java_import", - module_type: "java_import", - config_namespace: "wifi_module", - bool_variables: ["source_build"], - properties: ["prefer"], -} - -// Soong config variable module type added by test_optional_mainline_module. -soong_config_module_type { - name: "wifi_prebuilt_java_sdk_library_import", - module_type: "java_sdk_library_import", - config_namespace: "wifi_module", - bool_variables: ["source_build"], - properties: ["prefer"], -} - -// Soong config variable module type added by test_optional_mainline_module. -soong_config_module_type { - name: "wifi_prebuilt_prebuilt_bootclasspath_fragment", - module_type: "prebuilt_bootclasspath_fragment", - config_namespace: "wifi_module", - bool_variables: ["source_build"], - properties: ["prefer"], -} - -// Soong config variable module type added by test_optional_mainline_module. -soong_config_module_type { - name: "wifi_prebuilt_prebuilt_systemserverclasspath_fragment", - module_type: "prebuilt_systemserverclasspath_fragment", - config_namespace: "wifi_module", - bool_variables: ["source_build"], - properties: ["prefer"], -} - -package { - // A default list here prevents the license LSC from adding its own list which would - // be unnecessary as every module in the sdk already has its own licenses property. - default_applicable_licenses: ["Android-Apache-2.0"], -} - -wifi_prebuilt_prebuilt_bootclasspath_fragment { - name: "com.android.wifi-bootclasspath-fragment", - // Do not prefer prebuilt if the Soong config variable "source_build" in namespace "wifi_module" is true. - prefer: true, - soong_config_variables: { - source_build: { - prefer: false, - }, - }, - visibility: ["//visibility:public"], - apex_available: ["com.android.wifi"], - licenses: ["wifi-module-sdk_Android-Apache-2.0"], - contents: ["framework-wifi"], - fragments: [ - { - apex: "com.android.art", - module: "art-bootclasspath-fragment", - }, - ], - hidden_api: { - unsupported: ["hiddenapi/hiddenapi-unsupported.txt"], - max_target_r_low_priority: ["hiddenapi/hiddenapi-max-target-r-low-priority.txt"], - max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"], - annotation_flags: "hiddenapi/annotation-flags.csv", - metadata: "hiddenapi/metadata.csv", - index: "hiddenapi/index.csv", - signature_patterns: "hiddenapi/signature-patterns.csv", - filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv", - filtered_flags: "hiddenapi/filtered-flags.csv", - }, -} - -wifi_prebuilt_java_sdk_library_import { - name: "framework-wifi", - // Do not prefer prebuilt if the Soong config variable "source_build" in namespace "wifi_module" is true. - prefer: true, - soong_config_variables: { - source_build: { - prefer: false, - }, - }, - visibility: ["//visibility:public"], - apex_available: [ - "com.android.wifi", - "test_com.android.wifi", - ], - licenses: ["wifi-module-sdk_Android-Apache-2.0"], - shared_library: false, - permitted_packages: [ - "android.hardware.wifi", - "android.net.wifi", - "com.android.wifi.x", - ], - public: { - jars: ["sdk_library/public/framework-wifi-stubs.jar"], - stub_srcs: ["sdk_library/public/framework-wifi_stub_sources"], - current_api: "sdk_library/public/framework-wifi.txt", - removed_api: "sdk_library/public/framework-wifi-removed.txt", - annotations: "sdk_library/public/framework-wifi_annotations.zip", - sdk_version: "module_current", - }, - system: { - jars: ["sdk_library/system/framework-wifi-stubs.jar"], - stub_srcs: ["sdk_library/system/framework-wifi_stub_sources"], - current_api: "sdk_library/system/framework-wifi.txt", - removed_api: "sdk_library/system/framework-wifi-removed.txt", - annotations: "sdk_library/system/framework-wifi_annotations.zip", - sdk_version: "module_current", - }, - module_lib: { - jars: ["sdk_library/module-lib/framework-wifi-stubs.jar"], - stub_srcs: ["sdk_library/module-lib/framework-wifi_stub_sources"], - current_api: "sdk_library/module-lib/framework-wifi.txt", - removed_api: "sdk_library/module-lib/framework-wifi-removed.txt", - annotations: "sdk_library/module-lib/framework-wifi_annotations.zip", - sdk_version: "module_current", - }, -} - -wifi_prebuilt_java_import { - name: "service-wifi", - // Do not prefer prebuilt if the Soong config variable "source_build" in namespace "wifi_module" is true. - prefer: true, - soong_config_variables: { - source_build: { - prefer: false, - }, - }, - visibility: [ - "//frameworks/opt/net/wifi/service/apex", - "//frameworks/opt/net/wifi/tests/wifitests/apex", - "//packages/modules/Wifi/apex", - "//packages/modules/Wifi/service", - "//packages/modules/Wifi/service/tests/wifitests/apex", - ], - apex_available: [ - "com.android.wifi", - "test_com.android.wifi", - ], - licenses: ["wifi-module-sdk_Android-Apache-2.0"], - jars: ["java_systemserver_libs/snapshot/jars/are/invalid/service-wifi.jar"], -} - -license { - name: "wifi-module-sdk_Android-Apache-2.0", - visibility: ["//visibility:private"], - license_kinds: ["SPDX-license-identifier-Apache-2.0"], - license_text: ["licenses/build/soong/licenses/LICENSE"], -} - -wifi_prebuilt_prebuilt_systemserverclasspath_fragment { - name: "com.android.wifi-systemserverclasspath-fragment", - // Do not prefer prebuilt if the Soong config variable "source_build" in namespace "wifi_module" is true. - prefer: true, - soong_config_variables: { - source_build: { - prefer: false, - }, - }, - visibility: ["//visibility:public"], - apex_available: ["com.android.wifi"], - licenses: ["wifi-module-sdk_Android-Apache-2.0"], - standalone_contents: ["service-wifi"], -} diff --git a/build/mainline_modules_sdks_test_data/wifi_Android.bp.input b/build/mainline_modules_sdks_test_data/wifi_Android.bp.input deleted file mode 100644 index 29ce3987..00000000 --- a/build/mainline_modules_sdks_test_data/wifi_Android.bp.input +++ /dev/null @@ -1,108 +0,0 @@ -// This is auto-generated. DO NOT EDIT. - -package { - // A default list here prevents the license LSC from adding its own list which would - // be unnecessary as every module in the sdk already has its own licenses property. - default_applicable_licenses: ["Android-Apache-2.0"], -} - -prebuilt_bootclasspath_fragment { - name: "com.android.wifi-bootclasspath-fragment", - prefer: false, - visibility: ["//visibility:public"], - apex_available: ["com.android.wifi"], - licenses: ["wifi-module-sdk_Android-Apache-2.0"], - contents: ["framework-wifi"], - fragments: [ - { - apex: "com.android.art", - module: "art-bootclasspath-fragment", - }, - ], - hidden_api: { - unsupported: ["hiddenapi/hiddenapi-unsupported.txt"], - max_target_r_low_priority: ["hiddenapi/hiddenapi-max-target-r-low-priority.txt"], - max_target_o_low_priority: ["hiddenapi/hiddenapi-max-target-o-low-priority.txt"], - annotation_flags: "hiddenapi/annotation-flags.csv", - metadata: "hiddenapi/metadata.csv", - index: "hiddenapi/index.csv", - signature_patterns: "hiddenapi/signature-patterns.csv", - filtered_stub_flags: "hiddenapi/filtered-stub-flags.csv", - filtered_flags: "hiddenapi/filtered-flags.csv", - }, -} - -java_sdk_library_import { - name: "framework-wifi", - prefer: false, - visibility: ["//visibility:public"], - apex_available: [ - "com.android.wifi", - "test_com.android.wifi", - ], - licenses: ["wifi-module-sdk_Android-Apache-2.0"], - shared_library: false, - permitted_packages: [ - "android.hardware.wifi", - "android.net.wifi", - "com.android.wifi.x", - ], - public: { - jars: ["sdk_library/public/framework-wifi-stubs.jar"], - stub_srcs: ["sdk_library/public/framework-wifi_stub_sources"], - current_api: "sdk_library/public/framework-wifi.txt", - removed_api: "sdk_library/public/framework-wifi-removed.txt", - annotations: "sdk_library/public/framework-wifi_annotations.zip", - sdk_version: "module_current", - }, - system: { - jars: ["sdk_library/system/framework-wifi-stubs.jar"], - stub_srcs: ["sdk_library/system/framework-wifi_stub_sources"], - current_api: "sdk_library/system/framework-wifi.txt", - removed_api: "sdk_library/system/framework-wifi-removed.txt", - annotations: "sdk_library/system/framework-wifi_annotations.zip", - sdk_version: "module_current", - }, - module_lib: { - jars: ["sdk_library/module-lib/framework-wifi-stubs.jar"], - stub_srcs: ["sdk_library/module-lib/framework-wifi_stub_sources"], - current_api: "sdk_library/module-lib/framework-wifi.txt", - removed_api: "sdk_library/module-lib/framework-wifi-removed.txt", - annotations: "sdk_library/module-lib/framework-wifi_annotations.zip", - sdk_version: "module_current", - }, -} - -java_import { - name: "service-wifi", - prefer: false, - visibility: [ - "//frameworks/opt/net/wifi/service/apex", - "//frameworks/opt/net/wifi/tests/wifitests/apex", - "//packages/modules/Wifi/apex", - "//packages/modules/Wifi/service", - "//packages/modules/Wifi/service/tests/wifitests/apex", - ], - apex_available: [ - "com.android.wifi", - "test_com.android.wifi", - ], - licenses: ["wifi-module-sdk_Android-Apache-2.0"], - jars: ["java_systemserver_libs/snapshot/jars/are/invalid/service-wifi.jar"], -} - -license { - name: "wifi-module-sdk_Android-Apache-2.0", - visibility: ["//visibility:private"], - license_kinds: ["SPDX-license-identifier-Apache-2.0"], - license_text: ["licenses/build/soong/licenses/LICENSE"], -} - -prebuilt_systemserverclasspath_fragment { - name: "com.android.wifi-systemserverclasspath-fragment", - prefer: false, - visibility: ["//visibility:public"], - apex_available: ["com.android.wifi"], - licenses: ["wifi-module-sdk_Android-Apache-2.0"], - standalone_contents: ["service-wifi"], -} diff --git a/generate_ml_bundle.sh b/generate_ml_bundle.sh new file mode 100755 index 00000000..06fd6c47 --- /dev/null +++ b/generate_ml_bundle.sh @@ -0,0 +1,150 @@ +#!/bin/bash -ex + +# Usage: +# generate_ml_bundle.sh [args] source_tree dest_tree api_level +# +# Args: +# -p Sets prefer=true in generated java_sdk_library_import rules +# -a Also update artifects; default behaviour is just to generate build rules. + +PREFER=false +UPDATE_ARTIFACTS=false +while getopts "pa" opt; do + case ${opt} in + p ) PREFER=true;; + a ) UPDATE_ARTIFACTS=true;; + \? ) echo "Invalid option." + exit + ;; + esac +done +shift $((OPTIND -1)) + +SOURCE_TREE=$1 +DESTINATION_TREE=$2 +API_LEVEL=$3 +SOURCE_TREE_TYPE=$(test -e ${DESTINATION_TREE}/vendor/unbundled_google/modules && echo GOOGLE || echo PARTNER) + +function sdk_lib_bp() { + modulename=$1 + apexname=$2 + shared_library=$(test \( "$apexname" == com.android.ipsec \) -a \( "$API_LEVEL" -lt 31 \) && echo true || echo false) + cat << EOF +java_sdk_library_import { + name: "${modulename}", + owner: "google", + prefer: ${PREFER}, + shared_library: ${shared_library}, + apex_available: [ + "${apexname}", + "test_${apexname}", + ], + public: { + jars: ["current/public/${modulename}.jar"], + stub_srcs: ["current/public/${modulename}.srcjar"], + current_api: "current/public/${modulename}.txt", + removed_api: "current/public/${modulename}-removed.txt", + sdk_version: "module_current", + }, + system: { + jars: ["current/system/${modulename}.jar"], + stub_srcs: ["current/system/${modulename}.srcjar"], + current_api: "current/system/${modulename}.txt", + removed_api: "current/system/${modulename}-removed.txt", + sdk_version: "module_current", + }, + module_lib: { + jars: ["current/module_lib/${modulename}.jar"], + stub_srcs: ["current/module_lib/${modulename}.srcjar"], + current_api: "current/module_lib/${modulename}.txt", + removed_api: "current/module_lib/${modulename}-removed.txt", + sdk_version: "module_current", + }, +} +EOF +} + +function make_sdk_library() { + libnames=$1 + destdir=$2 + apexname=$3 + bp=${destdir}/Android.bp + + #test -e "$bp" + mkdir -p "$(dirname "$bp")" + + # Remove existing java_sdk_library_import and double newlines + existing_bp="$(sed -e '/java_sdk_library_import {/,/^}/d' "$bp" | tr -s \\n)" + echo "$existing_bp" > "$bp" + for libname in $libnames; do + echo >> "$bp" + echo "$(sdk_lib_bp ${libname} ${apexname})" | grep -v test_com.android.tethering >> "$bp" + done + #echo >> "$bp" + + if [ "${UPDATE_ARTIFACTS}" == "true" ] ; then + rm -rf "${destdir}/current" + mkdir -p "${destdir}/current/"{public,system,module_lib} + for libname in $libnames; do + cp public/{${libname}.jar,api/${libname}.txt,api/${libname}-removed.txt} "${destdir}/current/public" + cp system/{${libname}.jar,api/${libname}.txt,api/${libname}-removed.txt} "${destdir}/current/system" + cp module-lib/{${libname}.jar,api/${libname}.txt,api/${libname}-removed.txt} "${destdir}/current/module_lib" + done + fi +} + +function copy_notices() { + destdir=$1 + apks=$(find $destdir -name '*.apks' | head -1) + if [[ -z "$apks" ]]; then + echo "no apks found in $destdir" >&2 + exit + fi + filename=$(zipinfo -1 "$apks" *.apex */base-master.apk | head -1) + # com.android.ipsec is not expected to have a LICENSE, so don't fail if it doesn't. + unzip -p "$apks" "$filename" | bsdtar -xOf- assets/NOTICE.html.gz > "${destdir}/NOTICE.html.gz" || test "$2" == "com.android.ipsec" +} + +function get_dest_dir() { + if [[ "$SOURCE_TREE_TYPE" == "PARTNER" ]]; then + echo "${DESTINATION_TREE}/vendor/partner_modules/${1}" + elif [[ "$SOURCE_TREE_TYPE" == "GOOGLE" ]]; then + echo -n "${DESTINATION_TREE}/prebuilts/module_sdk/" + case "$1" in + "IKEPrebuilt") echo "IPsec";; + "MediaFrameworkPrebuilt") echo "Media";; + "MediaProviderPrebuilt") echo "MediaProvider";; + "PermissionControllerPrebuilt") echo "Permission";; + "SdkExtensionsPrebuilt") echo "SdkExtensions";; + "StatsdPrebuilt") echo "StatsD";; + "TetheringPrebuilt") echo "Connectivity";; + "WiFiPrebuilt") echo "Wifi";; + *) exit 1;; + esac + else + # Unknown tree type + exit 2 + fi + #ConscryptPrebuilt ??? +} + +function setup_stub_prebuilts() { + destdir=$(get_dest_dir $2) + + make_sdk_library "$1" "$destdir" "$3" + #copy_notices "$destdir" "$3" +} + +cd "$SOURCE_TREE/prebuilts/sdk/$API_LEVEL" +setup_stub_prebuilts android.net.ipsec.ike IKEPrebuilt com.android.ipsec +setup_stub_prebuilts framework-media MediaFrameworkPrebuilt com.android.media +setup_stub_prebuilts framework-mediaprovider MediaProviderPrebuilt com.android.mediaprovider +if [[ "$API_LEVEL" -ge 31 ]]; then + setup_stub_prebuilts 'framework-permission framework-permission-s' PermissionControllerPrebuilt com.android.permission +else + setup_stub_prebuilts framework-permission PermissionControllerPrebuilt com.android.permission +fi +setup_stub_prebuilts framework-sdkextensions SdkExtensionsPrebuilt com.android.sdkext +setup_stub_prebuilts framework-statsd StatsdPrebuilt com.android.os.statsd +setup_stub_prebuilts framework-tethering TetheringPrebuilt com.android.tethering +setup_stub_prebuilts framework-wifi WiFiPrebuilt com.android.wifi diff --git a/javatests/com/android/modules/apkinapex/Android.bp b/javatests/com/android/modules/apkinapex/Android.bp deleted file mode 100644 index ea5e0a8d..00000000 --- a/javatests/com/android/modules/apkinapex/Android.bp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -java_test_host { - name: "ApkInApexTest", - srcs: [ - "ApkInApexTest.java" - ], - libs: ["tradefed"], - java_resources: [ - ":test_com.android.modules.apkinapex", - ], - static_libs: [ - "compatibility-host-util", - "cts-install-lib-host", - "frameworks-base-hostutils", - "modules-utils-build-testing", - "truth-prebuilt", - ], - test_suites: [ - "general-tests", - "mts-core", - ], -} diff --git a/javatests/com/android/modules/apkinapex/ApkInApexTest.java b/javatests/com/android/modules/apkinapex/ApkInApexTest.java deleted file mode 100644 index f5c28fa1..00000000 --- a/javatests/com/android/modules/apkinapex/ApkInApexTest.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.modules.apkinapex; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assume.assumeTrue; -import static org.junit.Assert.assertThrows; - -import com.android.modules.utils.build.testing.DeviceSdkLevel; -import com.android.tradefed.device.DeviceNotAvailableException; -import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; -import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; -import com.android.internal.util.test.SystemPreparer; - -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.RuleChain; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; - -import android.cts.install.lib.host.InstallUtilsHost; - -import java.util.Set; - -/** - * Collection of tests to test functionality of APKs in apexes. - * - * <p>This test installs an apex which contains APKs and then performs the tests. - */ -@RunWith(DeviceJUnit4ClassRunner.class) -public class ApkInApexTest extends BaseHostJUnit4Test { - - private final InstallUtilsHost mHostUtils = new InstallUtilsHost(this); - private final TemporaryFolder mTemporaryFolder = new TemporaryFolder(); - private final SystemPreparer mPreparer = new SystemPreparer(mTemporaryFolder, this::getDevice); - - @Rule - public final RuleChain ruleChain = RuleChain.outerRule(mTemporaryFolder).around(mPreparer); - - @Test - public void installApexAndRunTests() throws Exception { - if (!getDevice().isAdbRoot()) { - getDevice().enableAdbRoot(); - } - assumeTrue("Device does not support updating APEX", mHostUtils.isApexUpdateSupported()); - assumeTrue("Device requires root", getDevice().isAdbRoot()); - DeviceSdkLevel deviceSdkLevel = new DeviceSdkLevel(getDevice()); - assumeTrue("Test requires atLeastT", deviceSdkLevel.isDeviceAtLeastT()); - - String apex = "test_com.android.modules.apkinapex.apex"; - mPreparer.pushResourceFile(apex, "/system/apex/" + apex); - mPreparer.reboot(); - - Set<String> packages = getDevice().getInstalledPackageNames(); - - assertThat(packages) - .containsAtLeast( - "com.android.modules.apkinapex.apps.installable", - "com.android.modules.apkinapex.apps.futuretargetsdk" - ); - - assertThat(packages) - .containsNoneOf( - "com.android.modules.apkinapex.apps.futureminsdk", - "com.android.modules.apkinapex.apps.pastmaxsdk" - ); - } -} diff --git a/javatests/com/android/modules/apkinapex/OWNERS b/javatests/com/android/modules/apkinapex/OWNERS deleted file mode 100644 index 55f5b971..00000000 --- a/javatests/com/android/modules/apkinapex/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# Mainline modularization team - -andreionea@google.com -pedroql@google.com -satayev@google.com diff --git a/javatests/com/android/modules/apkinapex/TEST_MAPPING b/javatests/com/android/modules/apkinapex/TEST_MAPPING deleted file mode 100644 index 6db4d77f..00000000 --- a/javatests/com/android/modules/apkinapex/TEST_MAPPING +++ /dev/null @@ -1,7 +0,0 @@ -{ - "postsubmit": [ - { - "name": "ApkInApexTest" - } - ] -} diff --git a/javatests/com/android/modules/apkinapex/apex/Android.bp b/javatests/com/android/modules/apkinapex/apex/Android.bp deleted file mode 100644 index c57280eb..00000000 --- a/javatests/com/android/modules/apkinapex/apex/Android.bp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2022 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -apex_key { - name: "test_com.android.modules.apkinapex.key", - public_key: "test_com.android.modules.apkinapex.avbpubkey", - private_key: "test_com.android.modules.apkinapex.pem", -} - -android_app_certificate { - name: "test_com.android.modules.apkinapex.certificate", - certificate: "test_com.android.modules.apkinapex", -} - -apex_test { - name: "test_com.android.modules.apkinapex", - manifest: "manifest.json", - file_contexts: ":apex.test-file_contexts", - key: "test_com.android.modules.apkinapex.key", - certificate: ":test_com.android.modules.apkinapex.certificate", - updatable: false, - apps: [ - "com.android.modules.apkinapex.apps.installable", - "com.android.modules.apkinapex.apps.futureminsdk", - "com.android.modules.apkinapex.apps.futuretargetsdk", - "com.android.modules.apkinapex.apps.pastmaxsdk", - ], -} diff --git a/javatests/com/android/modules/apkinapex/apex/manifest.json b/javatests/com/android/modules/apkinapex/apex/manifest.json deleted file mode 100644 index e022bbcf..00000000 --- a/javatests/com/android/modules/apkinapex/apex/manifest.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "test_com.android.modules.apkinapex", - "version": 1 -} diff --git a/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.avbpubkey b/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.avbpubkey Binary files differdeleted file mode 100644 index 8048e32e..00000000 --- a/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.avbpubkey +++ /dev/null diff --git a/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.pem b/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.pem deleted file mode 100644 index b674ca5e..00000000 --- a/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.pem +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -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 ------END RSA PRIVATE KEY----- diff --git a/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.pk8 b/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.pk8 Binary files differdeleted file mode 100644 index a7fdf218..00000000 --- a/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.pk8 +++ /dev/null diff --git a/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.x509.pem b/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.x509.pem deleted file mode 100644 index 250ca497..00000000 --- a/javatests/com/android/modules/apkinapex/apex/test_com.android.modules.apkinapex.x509.pem +++ /dev/null @@ -1,34 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF6TCCA9ECFD53ZcG0C3ytBE7VKpvEYvgrm30+MA0GCSqGSIb3DQEBCwUAMIGv -MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91 -bnRhaW4gVmlldzEQMA4GA1UECgwHQW5kcm9pZDEQMA4GA1UECwwHQW5kcm9pZDEi -MCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTErMCkGA1UEAwwidGVz -dF9jb20uYW5kcm9pZC5tb2R1bGVzLmFwa2luYXBleDAgFw0yMjA0MjAxMzI4MjNa -GA80NzYwMDMxNjEzMjgyM1owga8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxp -Zm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdBbmRyb2lk -MRAwDgYDVQQLDAdBbmRyb2lkMSIwIAYJKoZIhvcNAQkBFhNhbmRyb2lkQGFuZHJv -aWQuY29tMSswKQYDVQQDDCJ0ZXN0X2NvbS5hbmRyb2lkLm1vZHVsZXMuYXBraW5h -cGV4MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAyKYGS+TPbDsOAMi/ -BIuOmWteJ1JvbLHVRYdXvLQuaT/x8Y6DCvaHbkh0WTOdytP3+ggJBcHW2SaRtvZg -bjoluXLVsNkyKSCHo/oBZbsL6Fcba/fePcEfQgJSwMPfMZPTfxn6e6f6QgpWPYiY -EF4XoJB0d48Im2Vj6kVSmngiGV93EVs+hJgaKdmt81LzrQyIuHmPP+LOS80KB2YS -V5wNkSViX9UKEXjG0IejJGsG+5FXiZI06NIERM4lAJ8OBuGTPXRNrej+N8YsaOIb -gPOMUJnEOyUeds4C6hTDZ+hqKbMBdLtXL3c3Jv/xYqXgB552HWS7jD/TdaHD9OmP -mAE9VLFFMmChUcW3/fCzrPG/jU9YE1TJlhjvwWKueL1topHTMy684Finb01I1wPi -gSNxBCnb58ejp2fbd6igR4J5GJomXxAOnWZjIjW4Xvq/LbCF+UrHoppdGUBVCr7Q -sKd2ErnW5bu/6PCdTXNuUj1TstBOi0fM0mMHFawRhJmxwPzW2N4DjwtHoFOt1gEm -OHZg85G7CVddA1rqzpU0y0GU8nDNGFvM04lxEuyJjXoT4ttVm9ye9YV+B6D+xE2B -0PxAVMZPXHgriA2hUuCHX6Wq3tgR+pYYCyZIzHHgkHrGobYanc6WyaBVYKrIoO4z -07c3VWDF5CK9+Sr2rY4eOYERCNECAwEAATANBgkqhkiG9w0BAQsFAAOCAgEAZcOG -fle0l9KLwzDGXNYo5XaLppF891uphE2JaaHKrWIXNpKqFkg8iC0+Rxc4vpEGOj3x -DwBQElB2dCYLlfsTdlszATSf3EeKfKFFnF7yf82zjqDyBiTnYn9V+oi85gBC/DCl -PenCeTIv43qWAW660iR4wHVV87WLxlSPNo9HnV2ANwCfth4GBFmz9Shb54T9PiGJ -GPjOzZU9yaNOt7XaScL4AFS9CSF6npkpUXpZ1Zo8jjLdk/JGkDbLbm9fVLPmpHq4 -ObkYAzIaApx5Oq0aVXQGAd1woDwT7EXpodv3swY3fSIc3rVkc9PmYAZZEH/X/7Ne -oVS7xMRWQTowrxrtypeshKtu6S2+8ioJa1g6sVM5k0B9qnhJTDnCJFzqGwdb2gLv -H8o1ZoRrp+w3CLFDySuy/4ty2Hv4kggyVO/ivhO7inMRDH0BVyFO6oKs5I2aVvQB -kOxzPy6Isln3gdEW2Ckrd5Cg2QfpidJ7catDpnbN979F+YVM8v0gIyKOb4gEGFQU -ZfjELGJZ2UNQdpmlcvrPJfvRS0g85szgISr5K+bO2g6DUcSbCpgnvvZh4javt1Cv -Nmba1fpWvL+J8QdXtYYHFtCt/qc3M9WOgNmFNHqpSj+qQAMVG0O+Y3pXzX4crBqR -h+Xiai9DFq4fJJoRGD6xp+j+5s6g3UcF2zA8Mv0= ------END CERTIFICATE----- diff --git a/javatests/com/android/modules/apkinapex/apps/Android.bp b/javatests/com/android/modules/apkinapex/apps/Android.bp deleted file mode 100644 index 04b56f29..00000000 --- a/javatests/com/android/modules/apkinapex/apps/Android.bp +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (C) 2022 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -android_test_helper_app { - name: "com.android.modules.apkinapex.apps.futureminsdk", - target_sdk_version: "Tiramisu", - - // min sdk is overridden in the AndroidManifest.xml - but it is required to have a value here - // so the build system uses the value from the manifest! - min_sdk_version: "23", - apex_available: [ "test_com.android.modules.apkinapex" ], - manifest: "FutureMinSdkAndroidManifest.xml" -} - -android_test_helper_app { - name: "com.android.modules.apkinapex.apps.futuretargetsdk", - target_sdk_version: "Tiramisu", - apex_available: [ "test_com.android.modules.apkinapex" ], - manifest: "FutureTargetSdkAndroidManifest.xml" -} - -android_test_helper_app { - name: "com.android.modules.apkinapex.apps.pastmaxsdk", - target_sdk_version: "Tiramisu", - apex_available: [ "test_com.android.modules.apkinapex" ], - manifest: "PastMaxSdkAndroidManifest.xml" -} - -android_test_helper_app { - name: "com.android.modules.apkinapex.apps.installable", - target_sdk_version: "Tiramisu", - min_sdk_version: "23", - apex_available: [ "test_com.android.modules.apkinapex" ], - manifest: "InstallableAndroidManifest.xml" -} diff --git a/javatests/com/android/modules/apkinapex/apps/FutureMinSdkAndroidManifest.xml b/javatests/com/android/modules/apkinapex/apps/FutureMinSdkAndroidManifest.xml deleted file mode 100644 index b81e3587..00000000 --- a/javatests/com/android/modules/apkinapex/apps/FutureMinSdkAndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2022 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.modules.apkinapex.apps.futureminsdk"> - <!-- on purpose we use a non-existing minSdkVersion to simulate a future API codename that - was not known when this system image was compiled --> - <uses-sdk - android:minSdkVersion="FutureSdkCodename" - /> -</manifest> diff --git a/javatests/com/android/modules/apkinapex/apps/FutureTargetSdkAndroidManifest.xml b/javatests/com/android/modules/apkinapex/apps/FutureTargetSdkAndroidManifest.xml deleted file mode 100644 index 962d846c..00000000 --- a/javatests/com/android/modules/apkinapex/apps/FutureTargetSdkAndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2022 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.modules.apkinapex.apps.futuretargetsdk"> - <!-- on purpose we use a non-existing targetSdkVersion to simulate a future API codename that - was not known when this system image was compiled --> - <uses-sdk - android:targetSdkVersion="FutureSdkCodename" - /> -</manifest> diff --git a/javatests/com/android/modules/apkinapex/apps/InstallableAndroidManifest.xml b/javatests/com/android/modules/apkinapex/apps/InstallableAndroidManifest.xml deleted file mode 100644 index ee8ef927..00000000 --- a/javatests/com/android/modules/apkinapex/apps/InstallableAndroidManifest.xml +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2022 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.modules.apkinapex.apps.installable"> -</manifest> diff --git a/javatests/com/android/modules/apkinapex/apps/PastMaxSdkAndroidManifest.xml b/javatests/com/android/modules/apkinapex/apps/PastMaxSdkAndroidManifest.xml deleted file mode 100644 index 720a9b4f..00000000 --- a/javatests/com/android/modules/apkinapex/apps/PastMaxSdkAndroidManifest.xml +++ /dev/null @@ -1,22 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2022 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.modules.apkinapex.apps.pastmaxsdk"> - <uses-sdk - android:maxSdkVersion="30" - /> -</manifest> diff --git a/javatests/com/android/modules/updatablesharedlibs/Android.bp b/javatests/com/android/modules/updatablesharedlibs/Android.bp deleted file mode 100644 index f469f95e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/Android.bp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -java_test_host { - name: "UpdatableSharedLibsTest", - srcs: [ - "UpdatableSharedLibsTest.java" - ], - libs: ["tradefed"], - java_resources: [ - ":test_com.android.modules.updatablesharedlibs", - ], - data: [ - ":com.android.modules.updatablesharedlibs.apps.targetS", - ":com.android.modules.updatablesharedlibs.apps.targetT", - ":com.android.modules.updatablesharedlibs.apps.targetTWithLib", - ], - static_libs: [ - "compatibility-host-util", - "cts-install-lib-host", - "frameworks-base-hostutils", - "modules-utils-build-testing", - "truth-prebuilt", - ], - test_suites: [ - "general-tests", - "mts-core", - ], -} diff --git a/javatests/com/android/modules/updatablesharedlibs/OWNERS b/javatests/com/android/modules/updatablesharedlibs/OWNERS deleted file mode 100644 index 55f5b971..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# Mainline modularization team - -andreionea@google.com -pedroql@google.com -satayev@google.com diff --git a/javatests/com/android/modules/updatablesharedlibs/TEST_MAPPING b/javatests/com/android/modules/updatablesharedlibs/TEST_MAPPING deleted file mode 100644 index 71bf5cc8..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/TEST_MAPPING +++ /dev/null @@ -1,7 +0,0 @@ -{ - "postsubmit": [ - { - "name": "UpdatableSharedLibsTest" - } - ] -} diff --git a/javatests/com/android/modules/updatablesharedlibs/UpdatableSharedLibsTest.java b/javatests/com/android/modules/updatablesharedlibs/UpdatableSharedLibsTest.java deleted file mode 100644 index 05295f61..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/UpdatableSharedLibsTest.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.modules.updatablesharedlibs; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assume.assumeTrue; -import static org.junit.Assert.assertThrows; - -import com.android.tradefed.targetprep.TargetSetupError; -import com.android.tradefed.testtype.DeviceJUnit4ClassRunner; -import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test; -import com.android.tradefed.testtype.junit4.DeviceTestRunOptions; -import com.android.internal.util.test.SystemPreparer; - -import com.android.modules.utils.build.testing.DeviceSdkLevel; - -import org.junit.Assert; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.RuleChain; -import org.junit.rules.TemporaryFolder; -import org.junit.runner.RunWith; - -import android.cts.install.lib.host.InstallUtilsHost; - -@RunWith(DeviceJUnit4ClassRunner.class) -public class UpdatableSharedLibsTest extends BaseHostJUnit4Test { - - private final InstallUtilsHost mHostUtils = new InstallUtilsHost(this); - private final TemporaryFolder mTemporaryFolder = new TemporaryFolder(); - private final SystemPreparer mPreparer = new SystemPreparer(mTemporaryFolder, this::getDevice); - - @Rule - public final RuleChain ruleChain = RuleChain.outerRule(mTemporaryFolder).around(mPreparer); - - @Test - public void callOnDeviceApiFromHost() throws Exception { - if (!getDevice().isAdbRoot()) { - getDevice().enableAdbRoot(); - } - assumeTrue("Device needs to run on at least T", isAtLeastT()); - assumeTrue("Device does not support updating APEX", mHostUtils.isApexUpdateSupported()); - assumeTrue("Device requires root", getDevice().isAdbRoot()); - - // install app requiring lib before the lib is installed - assertInstalationFails(); - - String apex = "test_com.android.modules.updatablesharedlibs.apex"; - mPreparer.pushResourceFile(apex, "/system/apex/" + apex); - mPreparer.reboot(); - getDevice().disableAdbRoot(); - - installPackage("com.android.modules.updatablesharedlibs.apps.targetS.apk"); - installPackage("com.android.modules.updatablesharedlibs.apps.targetT.apk"); - installPackage("com.android.modules.updatablesharedlibs.apps.targetTWithLib.apk"); - - runDeviceTests("com.android.modules.updatablesharedlibs.apps.targetS", null); - runDeviceTests("com.android.modules.updatablesharedlibs.apps.targetT", null); - runDeviceTests("com.android.modules.updatablesharedlibs.apps.targetTWithLib", null); - } - - private void assertInstalationFails() throws Exception { - String packageName = "com.android.modules.updatablesharedlibs.apps.targetTWithLib"; - Exception e = assertThrows( - TargetSetupError.class, - () -> installPackage(packageName + ".apk")); - assertThat(e).hasMessageThat().contains( - "Package " + packageName + " requires " - + "unavailable shared library " - + "com.android.modules.updatablesharedlibs.libs.since.t"); - } - - protected boolean isAtLeastT() throws Exception { - DeviceSdkLevel deviceSdkLevel = new DeviceSdkLevel(getDevice()); - return deviceSdkLevel.isDeviceAtLeastT(); - } -} diff --git a/javatests/com/android/modules/updatablesharedlibs/apex/Android.bp b/javatests/com/android/modules/updatablesharedlibs/apex/Android.bp deleted file mode 100644 index db56f356..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apex/Android.bp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2021 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -apex_key { - name: "com.android.modules.updatablesharedlibs.key", - public_key: "com.android.modules.updatablesharedlibs.avbpubkey", - private_key: "com.android.modules.updatablesharedlibs.pem", -} - -android_app_certificate { - name: "com.android.modules.updatablesharedlibs.certificate", - certificate: "com.android.modules.updatablesharedlibs", -} - -apex_test { - name: "test_com.android.modules.updatablesharedlibs", - manifest: "manifest.json", - file_contexts: ":apex.test-file_contexts", - key: "com.android.modules.updatablesharedlibs.key", - java_libs: [ - "com.android.modules.updatablesharedlibs.libs.before.t", - "com.android.modules.updatablesharedlibs.libs.since.t", - ], - updatable: false, -} diff --git a/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.avbpubkey b/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.avbpubkey Binary files differdeleted file mode 100644 index e95ecbe8..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.avbpubkey +++ /dev/null diff --git a/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.pem b/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.pem deleted file mode 100644 index ef30766f..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.pem +++ /dev/null @@ -1,51 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -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 ------END RSA PRIVATE KEY----- diff --git a/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.pk8 b/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.pk8 Binary files differdeleted file mode 100644 index db1a90fe..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.pk8 +++ /dev/null diff --git a/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.x509.pem b/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.x509.pem deleted file mode 100644 index 6d9143fc..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apex/com.android.modules.updatablesharedlibs.x509.pem +++ /dev/null @@ -1,34 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIF8zCCA9sCFF/jvwHjBgaxHaamJyRxH88j4704MA0GCSqGSIb3DQEBCwUAMIG0 -MQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNTW91 -bnRhaW4gVmlldzEQMA4GA1UECgwHQW5kcm9pZDEQMA4GA1UECwwHQW5kcm9pZDEi -MCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTEwMC4GA1UEAwwnY29t -LmFuZHJvaWQubW9kdWxlcy51cGRhdGFibGVzaGFyZWRsaWJzMCAXDTIxMTAyNzEy -NTU0OFoYDzQ3NTkwOTIzMTI1NTQ4WjCBtDELMAkGA1UEBhMCVVMxEzARBgNVBAgM -CkNhbGlmb3JuaWExFjAUBgNVBAcMDU1vdW50YWluIFZpZXcxEDAOBgNVBAoMB0Fu -ZHJvaWQxEDAOBgNVBAsMB0FuZHJvaWQxIjAgBgkqhkiG9w0BCQEWE2FuZHJvaWRA -YW5kcm9pZC5jb20xMDAuBgNVBAMMJ2NvbS5hbmRyb2lkLm1vZHVsZXMudXBkYXRh -Ymxlc2hhcmVkbGliczCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK1C -8OSduZta1sNA/3eKcj/IU5dtOUWFSB21dKIlzOqEBOO9meCBiU5IYKGIjEpktsEH -CaIn3PZ8iqUNU30myjgugqQbdoo7GyYHj9px23s5L+DRoOyDlk6WEfLpNei74POz -wisii5MJMN3SEPVbMFhwYJnfPOOxLl1hLpkKD0I/bDKrjKnVCqpDB3YfOZrwk32h -Og1fI7G7/kCBD2KZPyjXghJMVs0ohRrl7KLFSYCGIvrUH8WUQ3iQGGmTYTJmwUMu -BshlY/xt2EIqjzU2s3R9uzPibzDfaWgzmHVEV1fmXwUEryiKSza8lPnUhaH2fNsi -SPUHYPG19qEoQueHchBNpxFFJPipTGH00XLKAQATqmCL2Dwxu02HY4mxdUKFc5TS -AKre9e7GjUv+P6RNuqMXOUmdTcN8xXy2wfIFeVa1JA9IAdRz9OlkXiB/l7GLjb0x -WEAIG0cmikrPsgKe9GT+OjKKKwhKrE/oCp+qc4Y9BnPoo1Q538BbEp0jYyYpKOVQ -7nGUbPI6Km6f+RzyzqEKB10EmUREApinEl0j05CVbf/WNl5ubRgo70MlyXdaQS2L -U6XF+HgwIOySLHL0opQgbgapZIGaOQv3/baa4R7DaJ8oVNQwSCpieLW+MzsTk3hJ -MyJAJf7iRlNcRx7NoJy5JWL9kmXiWAffYo+Dr8ldAgMBAAEwDQYJKoZIhvcNAQEL -BQADggIBAGQ5m+rrDvOQUfeOfRdfuU+XyhJ1zaOmyi1Br8ARuUrG5m3H6o8D1DyW -zmv09YgkcXt4iTSFG5WcxXtu6mA57f9KuiXaRtA4wzmcnSgUpZrhRamltv1xfo8P -h5vW9EKU67+437CuFBKlyjRLC+MD1GyMgNJwbHBqkIDUIfio+soIBVKgdANshSq7 -Cgc1dLAg7DvJkRg+WyjhBRmmregopXmfJfs73zxt2Jif5QQEZfLG27JkE7Ae06+9 -1FKvotlabdT3LMXjlX6miaJhPV8WPCmGyF2sZ8rOvI8OIKjWfWdf2S5269OnOrpg -IMRJTnXzsIDNk/nVdbvI50V0/STIKyCj+HYMjlGjyFqs9XOSoWtv7Y41bYDp+eoF -tfau5WOmVALWQ/M3sSIeBGkpzoq33wkyoqYNrlLRnA8FSNCOahKZpgAZyd7Cs9Fu -EzK1+35F+5HdxgJaK29cmiaBsx3acTUr4UZrPewsmnYTU+xUtnbOKaLniUxkf/WT -8qPhdg8n/1Hks5iWRzvKSHmFYMzx/efbz7PcB4UEyzKyaYW5mpX9xPLZ0Du6Je3X -JIk2t6WEGnMDHWS2fa1KpUfhsiRKkxNP7tMMuAwZ/2OnCiFmZ2/Tzy6bp4EFPsa6 -zXcvJSf7eAe5jJkKrWkoMoKp+SBGoCKXzoMRCAbLSEdnSpr5EZXF ------END CERTIFICATE----- diff --git a/javatests/com/android/modules/updatablesharedlibs/apex/manifest.json b/javatests/com/android/modules/updatablesharedlibs/apex/manifest.json deleted file mode 100644 index ffe9a73f..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apex/manifest.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "test_com.android.modules.updatablesharedlibs", - "version": 1 -} diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetS/Android.bp b/javatests/com/android/modules/updatablesharedlibs/apps/targetS/Android.bp deleted file mode 100644 index 24c495b0..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetS/Android.bp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2021 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -android_test_helper_app { - name: "com.android.modules.updatablesharedlibs.apps.targetS", - srcs: ["UpdatableSharedLibraryTargetSTest.java"], - static_libs: [ - "androidx.test.rules", - "androidx.test.core", - "truth-prebuilt", - ], - sdk_version: "current", - target_sdk_version: "31", -} diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetS/AndroidManifest.xml b/javatests/com/android/modules/updatablesharedlibs/apps/targetS/AndroidManifest.xml deleted file mode 100644 index e0c0ec98..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetS/AndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2021 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.modules.updatablesharedlibs.apps.targetS"> - <application> - </application> - - <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" - android:targetPackage="com.android.modules.updatablesharedlibs.apps.targetS" - ></instrumentation> -</manifest> diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetS/UpdatableSharedLibraryTargetSTest.java b/javatests/com/android/modules/updatablesharedlibs/apps/targetS/UpdatableSharedLibraryTargetSTest.java deleted file mode 100644 index d881ce80..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetS/UpdatableSharedLibraryTargetSTest.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.modules.updatablesharedlibs.apps.targetS; - -import static com.google.common.truth.Truth.assertThat; - -import org.junit.Test; -import org.junit.runner.RunWith; -import junit.framework.Assert; - -import com.google.common.truth.Correspondence; - -import android.content.Context; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import androidx.test.platform.app.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; - -/** - * Tests an app targeting S. - * - * <p>One of the shared libraries included in this test claims to be in the - * BOOTCLASSPATH before T so it should be added transparently to this app. - */ -@RunWith(AndroidJUnit4.class) -public class UpdatableSharedLibraryTargetSTest { - private static String SHARED_LIB_PATH = "/apex/test_com.android.modules.updatablesharedlibs" - + "/javalib/com.android.modules.updatablesharedlibs.libs.before.t.jar"; - - private static final Context sContext = InstrumentationRegistry.getInstrumentation() - .getContext(); - - @Test - public void checkSharedLibrary() throws Exception { - String packageName = sContext.getPackageName(); - ApplicationInfo appInfo = sContext.getPackageManager().getApplicationInfo(packageName, - PackageManager.GET_SHARED_LIBRARY_FILES); - - assertThat(appInfo.sharedLibraryFiles) - .asList() - .contains(SHARED_LIB_PATH); - } - - @Test - public void callApi() throws Exception { - Object api = Class.forName("com.android.modules.updatablesharedlibs.libs.before.t.Api") - .getDeclaredConstructor() - .newInstance(); - - String actual = (String) api.getClass().getDeclaredMethod("methodBeforeT").invoke(api); - assertThat(actual).isEqualTo("Success"); - } - - @Test - public void testGetSystemSharedLibraryNames() { - String[] libraries = sContext.getPackageManager().getSystemSharedLibraryNames(); - assertThat(libraries) - .asList() - .containsAtLeast( - "com.android.modules.updatablesharedlibs.libs.before.t", - "com.android.modules.updatablesharedlibs.libs.since.t"); - } -} diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetT/Android.bp b/javatests/com/android/modules/updatablesharedlibs/apps/targetT/Android.bp deleted file mode 100644 index 70a549e5..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetT/Android.bp +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2021 The Android Open Source Project -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -android_test_helper_app { - name: "com.android.modules.updatablesharedlibs.apps.targetT", - srcs: ["UpdatableSharedLibraryTargetTTest.java"], - static_libs: [ - "androidx.test.rules", - "androidx.test.core", - "truth-prebuilt", - ], - sdk_version: "current", - target_sdk_version: "Tiramisu", -} diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetT/AndroidManifest.xml b/javatests/com/android/modules/updatablesharedlibs/apps/targetT/AndroidManifest.xml deleted file mode 100644 index 17f52e7f..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetT/AndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2021 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.modules.updatablesharedlibs.apps.targetT"> - <application> - </application> - - <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" - android:targetPackage="com.android.modules.updatablesharedlibs.apps.targetT" - ></instrumentation> -</manifest> diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetT/UpdatableSharedLibraryTargetTTest.java b/javatests/com/android/modules/updatablesharedlibs/apps/targetT/UpdatableSharedLibraryTargetTTest.java deleted file mode 100644 index 20078a59..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetT/UpdatableSharedLibraryTargetTTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.modules.updatablesharedlibs.apps.targetT; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.Assert.assertThrows; - -import org.junit.Test; -import org.junit.runner.RunWith; -import junit.framework.Assert; - -import com.google.common.truth.Correspondence; - -import android.content.Context; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import androidx.test.platform.app.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; - -/** - * Tests an app targeting T. - * - * <p>With the shared libraries included in this test, none of the shared libraries present in this - * test should be included for this app. - */ -@RunWith(AndroidJUnit4.class) -public class UpdatableSharedLibraryTargetTTest { - private static final Correspondence<String, String> CONTAINS_SUBSTRING = - Correspondence.from(String::contains, "contains"); - private static final Context sContext = InstrumentationRegistry.getInstrumentation() - .getContext(); - - @Test - public void checkHasNoSharedLibrary() throws Exception { - String packageName = sContext.getPackageName(); - ApplicationInfo appInfo = sContext.getPackageManager().getApplicationInfo(packageName, - PackageManager.GET_SHARED_LIBRARY_FILES); - - assertThat(appInfo.sharedLibraryFiles) - .asList() - .comparingElementsUsing(CONTAINS_SUBSTRING) - .doesNotContain("com.android.modules.updatablesharedlibs"); - } - - @Test - public void checkHasNoApiAccess() throws Exception { - assertThrows( - ClassNotFoundException.class, - () -> Class.forName("com.android.modules.updatablesharedlibs.libs.before.t.Api") - ); - } -} diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/Android.bp b/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/Android.bp deleted file mode 100644 index 890af116..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/Android.bp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -android_test_helper_app { - name: "com.android.modules.updatablesharedlibs.apps.targetTWithLib", - srcs: ["UpdatableSharedLibraryTargetTWithLibraryTest.java"], - libs: [ - "com.android.modules.updatablesharedlibs.libs.since.t", - ], - static_libs: [ - "androidx.test.rules", - "androidx.test.core", - ], - sdk_version: "current", - target_sdk_version: "Tiramisu", -} diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/AndroidManifest.xml b/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/AndroidManifest.xml deleted file mode 100644 index f510ca6d..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/AndroidManifest.xml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2021 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> -<manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="com.android.modules.updatablesharedlibs.apps.targetTWithLib"> - <application> - </application> - - <instrumentation android:name="androidx.test.runner.AndroidJUnitRunner" - android:targetPackage="com.android.modules.updatablesharedlibs.apps.targetTWithLib" - ></instrumentation> -</manifest> diff --git a/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/UpdatableSharedLibraryTargetTWithLibraryTest.java b/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/UpdatableSharedLibraryTargetTWithLibraryTest.java deleted file mode 100644 index 425ed990..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/apps/targetTWithLib/UpdatableSharedLibraryTargetTWithLibraryTest.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.modules.updatablesharedlibs.apps.targetTWithLib; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import android.content.Context; -import android.content.pm.PackageManager; -import androidx.test.platform.app.InstrumentationRegistry; -import androidx.test.runner.AndroidJUnit4; - -/** - * Tests an app targeting T which also includes a shared library that is part of the BOOTCLASSPATH - * from T. - * - * <p>This means the shared library should not be explicitly in the shared libraries in order - * to avoid duplication of the BCP. - */ -@RunWith(AndroidJUnit4.class) -public class UpdatableSharedLibraryTargetTWithLibraryTest { - // private static final Context sContext = InstrumentationRegistry.getInstrumentation() - // .getContext(); - - @Test - public void checkHasNoSharedLibrary() throws Exception { - // TODO(b/205261027): not possible to test yet - - // This is the code we'd like to run. But because before API finalisation PM - // will see the shared library as - // having "on-bcp-since 9001" this means that it never considers that shared - // library to be in the BCP. - - // String packageName = getContext().getPackageName(); - // ApplicationInfo appInfo = getPackageManager().getApplicationInfo(packageName, - // PackageManager.GET_SHARED_LIBRARY_FILES); - // Log.d(TAG, "checkHasNoSharedLibrary in " + appInfo.sharedLibraryFiles.length - // + " libraries"); - // for (String path : appInfo.sharedLibraryFiles) { - // if (path.contains("com.android.modules.updatablesharedlibs")) { - // Assert.fail("Unexpectedly found a shared library: " + path); - // } - // } - } -} diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/Android.bp b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/Android.bp deleted file mode 100644 index 8f0565ec..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/Android.bp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -java_sdk_library { - name: "com.android.modules.updatablesharedlibs.libs.before.t", - srcs: [ - "Api.java" - ], - permitted_packages: [ "com.android.modules.updatablesharedlibs.libs"], - apex_available: [ "test_com.android.modules.updatablesharedlibs" ], - min_sdk_version: "Tiramisu", - sdk_version: "current", - on_bootclasspath_before: "Tiramisu", - - // Output the api files to a special directory that won't trigger an API - // review as it is a test only API. - api_dir: "api_dir", - // Testing only. - no_dist: true, - unsafe_ignore_missing_latest_api: true, -} diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/Api.java b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/Api.java deleted file mode 100644 index a01d0f00..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/Api.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.modules.updatablesharedlibs.libs.before.t; - -/** - * Basic class to pretend we have one API. - */ -public class Api { - - public String methodBeforeT() { - return "Success"; - } -} diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/current.txt b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/current.txt deleted file mode 100644 index 2b3339c1..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/current.txt +++ /dev/null @@ -1,10 +0,0 @@ -// Signature format: 2.0 -package com.android.modules.updatablesharedlibs.libs.before.t { - - public class Api { - ctor public Api(); - method public String methodBeforeT(); - } - -} - diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/module-lib-current.txt b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/module-lib-current.txt deleted file mode 100644 index e69de29b..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/module-lib-current.txt +++ /dev/null diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/module-lib-removed.txt b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/module-lib-removed.txt deleted file mode 100644 index e69de29b..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/module-lib-removed.txt +++ /dev/null diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/removed.txt b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/removed.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/removed.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/system-current.txt b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/system-current.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/system-current.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/system-removed.txt b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/system-removed.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/system-removed.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/test-current.txt b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/test-current.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/test-current.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/test-removed.txt b/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/test-removed.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/before/t/api_dir/test-removed.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/Android.bp b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/Android.bp deleted file mode 100644 index 553dca6d..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/Android.bp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package { - default_applicable_licenses: ["Android-Apache-2.0"], -} - -java_sdk_library { - name: "com.android.modules.updatablesharedlibs.libs.since.t", - srcs: [ - "Api.java" - ], - permitted_packages: [ "com.android.modules.updatablesharedlibs.libs.since"], - apex_available: [ "test_com.android.modules.updatablesharedlibs" ], - min_sdk_version: "Tiramisu", - sdk_version: "current", - on_bootclasspath_since: "Tiramisu", - - // Output the api files to a special directory that won't trigger an API - // review as it is a test only API. - api_dir: "api_dir", - // Testing only. - no_dist: true, - unsafe_ignore_missing_latest_api: true, -} diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/Api.java b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/Api.java deleted file mode 100644 index 53dde680..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/Api.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.modules.updatablesharedlibs.libs.since.t; - -/** - * Basic class to pretend we have one API. - */ -public class Api { - - public String methodSinceT() { - return "Success"; - } -} diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/current.txt b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/current.txt deleted file mode 100644 index c459c1a3..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/current.txt +++ /dev/null @@ -1,10 +0,0 @@ -// Signature format: 2.0 -package com.android.modules.updatablesharedlibs.libs.since.t { - - public class Api { - ctor public Api(); - method public String methodSinceT(); - } - -} - diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/module-lib-current.txt b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/module-lib-current.txt deleted file mode 100644 index e69de29b..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/module-lib-current.txt +++ /dev/null diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/module-lib-removed.txt b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/module-lib-removed.txt deleted file mode 100644 index e69de29b..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/module-lib-removed.txt +++ /dev/null diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/removed.txt b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/removed.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/removed.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/system-current.txt b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/system-current.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/system-current.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/system-removed.txt b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/system-removed.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/system-removed.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/test-current.txt b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/test-current.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/test-current.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/test-removed.txt b/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/test-removed.txt deleted file mode 100644 index d802177e..00000000 --- a/javatests/com/android/modules/updatablesharedlibs/libs/since/t/api_dir/test-removed.txt +++ /dev/null @@ -1 +0,0 @@ -// Signature format: 2.0 diff --git a/proto/sdk.proto b/proto/sdk.proto index 850b31b4..4fddf8df 100644 --- a/proto/sdk.proto +++ b/proto/sdk.proto @@ -38,11 +38,6 @@ enum SdkModule { // S modules ART = 8; SCHEDULING = 9; - - // T modules - AD_SERVICES = 11; - APPSEARCH = 12; - ON_DEVICE_PERSONALIZATION = 13; } // A single extension version. diff --git a/sdk/ModuleDefaults.bp b/sdk/ModuleDefaults.bp index d9e3af53..d4d8a188 100644 --- a/sdk/ModuleDefaults.bp +++ b/sdk/ModuleDefaults.bp @@ -102,6 +102,7 @@ java_defaults { // Hide impl library and stub sources impl_library_visibility: [ ":__pkg__", + "//frameworks/base", // For framework-all "//frameworks/base/api", // For framework-all ], stubs_source_visibility: ["//visibility:private"], @@ -111,11 +112,6 @@ java_defaults { // Collates API usages from each module for further analysis. plugins: ["java_api_finder"], - // Disallow disabling the NewApi lint check. - lint: { - strict_updatability_linting: true, - }, - dist_group: "android", } @@ -213,29 +209,6 @@ apex_defaults { defaults_visibility: ["//visibility:public"], } -DCLA_MIN_SDK_VERSION = "31" - -soong_config_module_type_import { - from: "system/apex/Android.bp", - module_types: ["library_linking_strategy_apex_defaults"], -} - -library_linking_strategy_apex_defaults { - name: "r-launched-dcla-enabled-apex-module", - defaults_visibility: ["//packages/modules/adb:__subpackages__"], - defaults: ["r-launched-apex-module"], - soong_config_variables: { - library_linking_strategy: { - // Use the R min_sdk_version - prefer_static: {}, - // Override the R min_sdk_version to min_sdk_version that supports dcla - conditions_default: { - min_sdk_version: DCLA_MIN_SDK_VERSION, - }, - }, - }, -} - apex_defaults { name: "s-launched-apex-module", min_sdk_version: "31", diff --git a/tools/Android.bp b/tools/Android.bp index 1bb33fa9..642c2f8a 100644 --- a/tools/Android.bp +++ b/tools/Android.bp @@ -65,12 +65,9 @@ prebuilt_etc { "//art:__subpackages__", "//external/conscrypt:__subpackages__", "//frameworks/av/apex:__subpackages__", - "//packages/modules/AdServices:__subpackages__", - "//packages/modules/AppSearch:__subpackages__", "//packages/modules/Connectivity:__subpackages__", "//packages/modules/IPsec/apex:__subpackages__", "//packages/modules/Permission:__subpackages__", - "//packages/modules/OnDevicePersonalization:__subpackages__", "//packages/modules/Scheduling:__subpackages__", "//packages/modules/SdkExtensions:__subpackages__", "//packages/modules/StatsD:__subpackages__", diff --git a/tools/finalize_sdk.py b/tools/finalize_sdk.py index 32b2fb7c..84fd762e 100755 --- a/tools/finalize_sdk.py +++ b/tools/finalize_sdk.py @@ -16,13 +16,12 @@ from pathlib import Path # See go/fetch_artifact for details on this script. FETCH_ARTIFACT = '/google/data/ro/projects/android/fetch_artifact' COMPAT_REPO = Path('prebuilts/sdk') -COMPAT_README = Path('extensions/README.md') # This build target is used when fetching from a train build (TXXXXXXXX) BUILD_TARGET_TRAIN = 'train_build' # This build target is used when fetching from a non-train build (XXXXXXXX) BUILD_TARGET_CONTINUOUS = 'mainline_modules-user' # The glob of sdk artifacts to fetch -ARTIFACT_PATTERN = 'mainline-sdks/for-latest-build/current/{module_name}/sdk/*.zip' +ARTIFACT_PATTERN = 'mainline-sdks/current/{module_name}/sdk/*.zip' COMMIT_TEMPLATE = """Finalize artifacts for extension SDK %d Import from build id %s. @@ -82,7 +81,6 @@ if not os.path.isdir('build/soong'): parser = argparse.ArgumentParser(description=('Finalize an extension SDK with prebuilts')) parser.add_argument('-f', '--finalize_sdk', type=int, required=True, help='The numbered SDK to finalize.') parser.add_argument('-b', '--bug', type=int, required=True, help='The bug number to add to the commit message.') -parser.add_argument('-r', '--readme', required=True, help='Version history entry to add to %s' % (COMPAT_REPO / COMPAT_README)) parser.add_argument('-a', '--amend_last_commit', action="store_true", help='Amend current HEAD commits instead of making new commits.') parser.add_argument('-m', '--modules', action='append', help='Modules to include. Can be provided multiple times, or not at all for all modules.') parser.add_argument('bid', help='Build server build ID') @@ -92,7 +90,9 @@ build_target = BUILD_TARGET_TRAIN if args.bid[0] == 'T' else BUILD_TARGET_CONTIN branch_name = 'finalize-%d' % args.finalize_sdk cmdline = " ".join([x for x in sys.argv if x not in ['-a', '--amend_last_commit']]) commit_message = COMMIT_TEMPLATE % (args.finalize_sdk, args.bid, cmdline, args.bug) -module_names = args.modules or ['*'] +module_names = args.modules +if not module_names: + module_names = ['*'] compat_dir = COMPAT_REPO.joinpath('extensions/%d' % args.finalize_sdk) if compat_dir.is_dir(): @@ -112,8 +112,8 @@ for m in module_names: with zipfile.ZipFile(tmpdir.joinpath(f)) as zipFile: zipFile.extractall(target_dir) - # Disable the Android.bp, but keep it for reference / potential future use. - shutil.move(target_dir.joinpath('Android.bp'), target_dir.joinpath('Android.bp.auto')) + # Just capture the artifacts, not the bp files of finalized versions + os.remove(target_dir.joinpath('Android.bp')) print('Created %s' % target_dir) created_dirs[repo].add(dir) @@ -132,12 +132,6 @@ print('Running git commit') for repo in created_dirs: git = ['git', '-C', str(repo)] subprocess.check_output(git + ['add'] + list(created_dirs[repo])) - - if repo == COMPAT_REPO: - with open(COMPAT_REPO / COMPAT_README, "a") as readme: - readme.write(f"- {args.finalize_sdk}: {args.readme}\n") - subprocess.check_output(git + ['add', COMPAT_README]) - if args.amend_last_commit: change_id = '\n' + re.search(r'Change-Id: [^\\n]+', str(subprocess.check_output(git + ['log', '-1']))).group(0) subprocess.check_output(git + ['commit', '--amend', '-m', commit_message + change_id]) |