From c82a810842c7533801f0c44a5a81eb9fea744a15 Mon Sep 17 00:00:00 2001 From: Aurimas Liutikas Date: Mon, 9 Aug 2021 16:15:27 -0700 Subject: [PATCH 1/7] Add explicit exported tags Bug: 195988762 Test: make javac-check Change-Id: Ifd07672da0141c74ad32613a17691c6cd09e54de Merged-In: Ifd07672da0141c74ad32613a17691c6cd09e54de (cherry picked from commit 7512a62755e44e1156fa13df55df3d7b4124a6ef) --- samples/MultiDisplay/AndroidManifest.xml | 8 +++++--- samples/ShortcutDemo/launcher/AndroidManifest.xml | 3 ++- samples/WiFiDirectDemo/AndroidManifest.xml | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/samples/MultiDisplay/AndroidManifest.xml b/samples/MultiDisplay/AndroidManifest.xml index 81aa43b9a..18f9f8854 100644 --- a/samples/MultiDisplay/AndroidManifest.xml +++ b/samples/MultiDisplay/AndroidManifest.xml @@ -27,7 +27,8 @@ android:label="@string/md_launcher" android:theme="@style/LauncherTheme" android:launchMode="singleTop" - android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|colorMode|density"> + android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|colorMode|density" + android:exported="true"> @@ -39,7 +40,8 @@ + android:permission="android.permission.BIND_WALLPAPER" + android:exported="true"> @@ -52,4 +54,4 @@ - \ No newline at end of file + diff --git a/samples/ShortcutDemo/launcher/AndroidManifest.xml b/samples/ShortcutDemo/launcher/AndroidManifest.xml index 581079a52..b024385b3 100644 --- a/samples/ShortcutDemo/launcher/AndroidManifest.xml +++ b/samples/ShortcutDemo/launcher/AndroidManifest.xml @@ -21,7 +21,8 @@ - + diff --git a/samples/WiFiDirectDemo/AndroidManifest.xml b/samples/WiFiDirectDemo/AndroidManifest.xml index 759c4cc38..eb2a90f51 100644 --- a/samples/WiFiDirectDemo/AndroidManifest.xml +++ b/samples/WiFiDirectDemo/AndroidManifest.xml @@ -22,6 +22,7 @@ android:theme="@android:style/Theme.Holo"> Date: Tue, 24 Aug 2021 10:45:13 -0700 Subject: [PATCH 2/7] emulator: disable setting NR as network type It appears to be blocking and prevents sdksetup app from responding. Disable it for now. Bug: 193418404 Bug: 197422016 Change-Id: I605f1abf8d3981fd9e962acbb0a9bcdd8c420c1c Merged-In: I605f1abf8d3981fd9e962acbb0a9bcdd8c420c1c (cherry picked from commit fe83c41c1d7fd53861620655aa9cf1ca53f7cbd6) --- apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java b/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java index 6dd69f9b0..365ecfed2 100644 --- a/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java +++ b/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java @@ -87,6 +87,10 @@ public class DefaultActivity extends Activity { // Disable offload wifi tethering Settings.Global.putInt(getContentResolver(), Settings.Global.TETHER_OFFLOAD_DISABLED, 1); + // b/193418404 + // the following blocks, TODO: find out why and fix it. disable this for now. + // TelephonyManager mTelephony = getApplicationContext().getSystemService(TelephonyManager.class); + // mTelephony.setPreferredNetworkTypeBitmask(TelephonyManager.NETWORK_TYPE_BITMASK_NR); TelephonyManager mTelephony = getApplicationContext().getSystemService(TelephonyManager.class); mTelephony.setPreferredNetworkTypeBitmask(TelephonyManager.NETWORK_TYPE_BITMASK_NR); if ("freeform".equals(displaySettingsName)) { From f38a7d0debe76739487e7407a213816f88e2ccc1 Mon Sep 17 00:00:00 2001 From: Neha Jain Date: Tue, 24 Aug 2021 23:48:21 +0000 Subject: [PATCH 3/7] Update release config and emulator files for Android S(API 31) Beta5 Bug: 197685598 Change-Id: I7144208678e4a485b2bf8616b82f5e6da0409247 --- sdk/build_tools_source.prop_template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/build_tools_source.prop_template b/sdk/build_tools_source.prop_template index 83bf78d20..36323fdfa 100644 --- a/sdk/build_tools_source.prop_template +++ b/sdk/build_tools_source.prop_template @@ -1,3 +1,3 @@ Pkg.UserSrc=false -Pkg.Revision=${PLATFORM_SDK_VERSION}.0.0 +Pkg.Revision=${PLATFORM_SDK_VERSION}.0.1 #Pkg.Revision=31.0.0 rc5 From 573495bdeb986b33035145ac00df00e20b2b98aa Mon Sep 17 00:00:00 2001 From: Bo Hu Date: Wed, 25 Aug 2021 22:22:20 +0000 Subject: [PATCH 4/7] Refix "emulator: disable setting NR as network type" original cl fe4b1d85fa9bd5c0542bde876577be0893d998c8 does not fix the issue Bug: 193418404 Bug: 197422016 Change-Id: I683b3d3057bcefc14a91ecbbd2e76700cc9c2872 --- apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java b/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java index 365ecfed2..2f7b3e0c4 100644 --- a/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java +++ b/apps/SdkSetup/src/com/android/sdksetup/DefaultActivity.java @@ -91,8 +91,6 @@ public class DefaultActivity extends Activity { // the following blocks, TODO: find out why and fix it. disable this for now. // TelephonyManager mTelephony = getApplicationContext().getSystemService(TelephonyManager.class); // mTelephony.setPreferredNetworkTypeBitmask(TelephonyManager.NETWORK_TYPE_BITMASK_NR); - TelephonyManager mTelephony = getApplicationContext().getSystemService(TelephonyManager.class); - mTelephony.setPreferredNetworkTypeBitmask(TelephonyManager.NETWORK_TYPE_BITMASK_NR); if ("freeform".equals(displaySettingsName)) { Settings.Global.putInt(getContentResolver(), "sf", 1); Settings.Global.putString(getContentResolver(), Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT, "1"); From bf2928fdc91ec6d324a784b77a381bb03f0cb4a0 Mon Sep 17 00:00:00 2001 From: Aurimas Liutikas Date: Tue, 17 Aug 2021 17:59:05 -0700 Subject: [PATCH 5/7] Convert DumpViewer to Android.bp Test: make DumpViewer Change-Id: I0f2fe63a3742888978cebd5bb9947d37291c5545 Merged-In: I0f2fe63a3742888978cebd5bb9947d37291c5545 (cherry picked from commit 57eeb31650588b47bfe27c097ea3b22409956a72) --- apps/DumpViewer/Android.mk | 2 -- apps/DumpViewer/app/src/main/Android.bp | 28 ++++++++++++++++++++++ apps/DumpViewer/app/src/main/Android.mk | 32 ------------------------- 3 files changed, 28 insertions(+), 34 deletions(-) delete mode 100644 apps/DumpViewer/Android.mk create mode 100644 apps/DumpViewer/app/src/main/Android.bp delete mode 100644 apps/DumpViewer/app/src/main/Android.mk diff --git a/apps/DumpViewer/Android.mk b/apps/DumpViewer/Android.mk deleted file mode 100644 index fafec335f..000000000 --- a/apps/DumpViewer/Android.mk +++ /dev/null @@ -1,2 +0,0 @@ -LOCAL_PATH := $(call my-dir) -include $(LOCAL_PATH)/app/src/main/Android.mk diff --git a/apps/DumpViewer/app/src/main/Android.bp b/apps/DumpViewer/app/src/main/Android.bp new file mode 100644 index 000000000..a67de47d9 --- /dev/null +++ b/apps/DumpViewer/app/src/main/Android.bp @@ -0,0 +1,28 @@ +package { + default_applicable_licenses: ["Android-Apache-2.0"], +} + +android_test { + name: "DumpViewer", + + srcs: ["**/*.java"], + + static_libs: [ + "androidx.annotation_annotation", + "androidx.collection_collection", + "androidx.arch.core_core-common", + "androidx.lifecycle_lifecycle-common", + "androidx.lifecycle_lifecycle-runtime", + "androidx.percentlayout_percentlayout", + "androidx.transition_transition", + "androidx.core_core", + "androidx.legacy_legacy-support-core-ui", + "androidx.media_media", + "androidx.legacy_legacy-support-v13", + "androidx.preference_preference", + "androidx.appcompat_appcompat", + "androidx.gridlayout_gridlayout", + "androidx.recyclerview_recyclerview", + ], + sdk_version: "31", +} diff --git a/apps/DumpViewer/app/src/main/Android.mk b/apps/DumpViewer/app/src/main/Android.mk deleted file mode 100644 index 92c0c296e..000000000 --- a/apps/DumpViewer/app/src/main/Android.mk +++ /dev/null @@ -1,32 +0,0 @@ -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := tests - -LOCAL_SRC_FILES := $(call all-subdir-java-files) - -LOCAL_STATIC_JAVA_LIBRARIES := \ - androidx.annotation_annotation \ - androidx.collection_collection \ - androidx.arch.core_core-common \ - androidx.lifecycle_lifecycle-common \ - -LOCAL_STATIC_ANDROID_LIBRARIES := \ - androidx.lifecycle_lifecycle-runtime \ - androidx.percentlayout_percentlayout \ - androidx.transition_transition \ - androidx.core_core \ - androidx.legacy_legacy-support-core-ui \ - androidx.media_media \ - androidx.legacy_legacy-support-v13 \ - androidx.preference_preference \ - androidx.appcompat_appcompat \ - androidx.gridlayout_gridlayout \ - androidx.recyclerview_recyclerview - -LOCAL_PACKAGE_NAME := DumpViewer -LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 -LOCAL_LICENSE_CONDITIONS := notice -LOCAL_SDK_VERSION := 26 - -include $(BUILD_PACKAGE) From 786bf26e3aba24fe64560cc5b28db627af5afa5b Mon Sep 17 00:00:00 2001 From: Anton Hansson Date: Thu, 26 Aug 2021 17:07:09 +0100 Subject: [PATCH 6/7] Add sdk extension version info to prop templates This adds two new properties alongside AndroidVersion.ApiLevel: - AndroidVersion.ExtensionLevel: The sdk extension version if the SDK - AndroidVersion.IsBaseSdk: Whether the extension level is the the one that the ApiLevel shipped with (true), or if is an extension SDK release (false). While we're here, dedupe the recipe that processes these templates. Bug: 195281582 Test: m out/host/linux-x86/development/sdk/platform_source.properties and inspect the substitution is working Change-Id: Ieea20731aed2e0f35bbe4cfd8ca596cf11f4b3bc (cherry picked from commit cf2f42c36b7997e9ce87682bb3a5511bdb72936f) --- build/Android.mk | 53 +++++++++---------- samples/samples_source.prop_template | 2 + sdk/doc_source.prop_template | 2 + sdk/platform_source.prop_template | 2 + sdk/source_source.prop_template | 2 + sys-img/images_arm64-v8a_source.prop_template | 2 + .../images_armeabi-v7a_source.prop_template | 2 + sys-img/images_armeabi_source.prop_template | 2 + sys-img/images_mips64_source.prop_template | 2 + sys-img/images_mips_source.prop_template | 2 + sys-img/images_x86_64_source.prop_template | 2 + sys-img/images_x86_source.prop_template | 2 + 12 files changed, 46 insertions(+), 29 deletions(-) diff --git a/build/Android.mk b/build/Android.mk index f548c3dce..49e1bef82 100644 --- a/build/Android.mk +++ b/build/Android.mk @@ -20,40 +20,35 @@ ALL_SDK_FILES += $(sdk_props) $(sample_props) $(sys_img_props) # Rule to convert a source.prop template into the desired source.property # This needs to vary based on the CPU ABI for the system-image files. # Rewritten variables: -# - ${PLATFORM_VERSION} e.g. "1.0" -# - ${PLATFORM_SDK_VERSION} e.g. "3", aka the API level -# - ${PLATFORM_VERSION_CODENAME} e.g. "REL" (transformed into "") or "Cupcake" -# - ${TARGET_ARCH} e.g. "arm", "x86", "mips" and their 64-bit variants. -# - ${TARGET_CPU_ABI} e.g. "armeabi", "x86", "mips" and their 64-bit variants. +# - ${PLATFORM_VERSION} e.g. "1.0" +# - ${PLATFORM_SDK_VERSION} e.g. "3", aka the API level +# - ${PLATFORM_EXTENSION_SDK_VERSION} e.g. "7" -- the extension sdk level +# - ${PLATFORM_IS_BASE_SDK} bool. -- whether the current extension sdk is the base extension for this api level +# - ${PLATFORM_VERSION_CODENAME} e.g. "REL" (transformed into "") or "Cupcake" +# - ${TARGET_ARCH} e.g. "arm", "x86", "mips" and their 64-bit variants. +# - ${TARGET_CPU_ABI} e.g. "armeabi", "x86", "mips" and their 64-bit variants. +define process_prop_template +@echo Generate $@ +$(hide) mkdir -p $(dir $@) +$(hide) sed \ + -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \ + -e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \ + -e 's/$${PLATFORM_SDK_EXTENSION_VERSION}/$(PLATFORM_SDK_EXTENSION_VERSION)/' \ + -e 's/$${PLATFORM_IS_BASE_SDK}/$(if $(filter $(PLATFORM_SDK_EXTENSION_VERSION),$(PLATFORM_BASE_SDK_EXTENSION_VERSION)),true,false)/' \ + -e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \ + -e 's/$${TARGET_ARCH}/$(TARGET_ARCH)/' \ + -e 's/$${TARGET_CPU_ABI}/$(TARGET_CPU_ABI)/' \ + $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@ +endef + $(sys_img_props) : $(HOST_OUT)/development/sys-img-$(TARGET_CPU_ABI)/%_source.properties : $(TOPDIR)development/sys-img/%_source.prop_template - @echo Generate $@ - $(hide) mkdir -p $(dir $@) - $(hide) sed \ - -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \ - -e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \ - -e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \ - -e 's/$${TARGET_ARCH}/$(TARGET_ARCH)/' \ - -e 's/$${TARGET_CPU_ABI}/$(TARGET_CPU_ABI)/' \ - $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@ + $(process_prop_template) $(sdk_props) : $(HOST_OUT)/development/sdk/%_source.properties : $(TOPDIR)development/sdk/%_source.prop_template - @echo Generate $@ - $(hide) mkdir -p $(dir $@) - $(hide) sed \ - -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \ - -e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \ - -e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \ - $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@ + $(process_prop_template) $(sample_props) : $(HOST_OUT)/development/samples/%_source.properties : $(TOPDIR)development/samples/%_source.prop_template - @echo Generate $@ - $(hide) mkdir -p $(dir $@) - $(hide) sed\ - -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \ - -e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \ - -e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \ - $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@ - + $(process_prop_template) # ===== SDK jar file of stubs ===== # A.k.a the "current" version of the public SDK (android.jar inside the SDK package). diff --git a/samples/samples_source.prop_template b/samples/samples_source.prop_template index 523d6bda8..1b08968c7 100644 --- a/samples/samples_source.prop_template +++ b/samples/samples_source.prop_template @@ -2,3 +2,5 @@ Pkg.UserSrc=false Pkg.Revision=2 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} diff --git a/sdk/doc_source.prop_template b/sdk/doc_source.prop_template index d3cdfd5ee..61a9923be 100644 --- a/sdk/doc_source.prop_template +++ b/sdk/doc_source.prop_template @@ -2,3 +2,5 @@ Pkg.UserSrc=false Pkg.Revision=1 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} diff --git a/sdk/platform_source.prop_template b/sdk/platform_source.prop_template index 35a00af81..fa996c7e3 100644 --- a/sdk/platform_source.prop_template +++ b/sdk/platform_source.prop_template @@ -5,6 +5,8 @@ Platform.CodeName= Pkg.Revision=1 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} Layoutlib.Api=15 Layoutlib.Revision=1 Platform.MinToolsRev=22 diff --git a/sdk/source_source.prop_template b/sdk/source_source.prop_template index d3cdfd5ee..61a9923be 100644 --- a/sdk/source_source.prop_template +++ b/sdk/source_source.prop_template @@ -2,3 +2,5 @@ Pkg.UserSrc=false Pkg.Revision=1 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} diff --git a/sys-img/images_arm64-v8a_source.prop_template b/sys-img/images_arm64-v8a_source.prop_template index e553746a5..decf56567 100644 --- a/sys-img/images_arm64-v8a_source.prop_template +++ b/sys-img/images_arm64-v8a_source.prop_template @@ -4,6 +4,8 @@ Pkg.Revision=2 Pkg.Dependencies=emulator#29.1.11 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} SystemImage.Abi=arm64-v8a SystemImage.GpuSupport=true SystemImage.TagId=default diff --git a/sys-img/images_armeabi-v7a_source.prop_template b/sys-img/images_armeabi-v7a_source.prop_template index 2851d28fb..87e606757 100644 --- a/sys-img/images_armeabi-v7a_source.prop_template +++ b/sys-img/images_armeabi-v7a_source.prop_template @@ -4,6 +4,8 @@ Pkg.Revision=2 Pkg.Dependencies=emulator#29.1.11 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} SystemImage.Abi=armeabi-v7a SystemImage.GpuSupport=true SystemImage.TagId=default diff --git a/sys-img/images_armeabi_source.prop_template b/sys-img/images_armeabi_source.prop_template index fb4e8088b..bbedcc0e5 100644 --- a/sys-img/images_armeabi_source.prop_template +++ b/sys-img/images_armeabi_source.prop_template @@ -4,6 +4,8 @@ Pkg.Revision=2 Pkg.Dependencies=emulator#29.1.11 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} SystemImage.Abi=armeabi SystemImage.GpuSupport=true SystemImage.TagId=default diff --git a/sys-img/images_mips64_source.prop_template b/sys-img/images_mips64_source.prop_template index 9778f9763..89a29ed5c 100644 --- a/sys-img/images_mips64_source.prop_template +++ b/sys-img/images_mips64_source.prop_template @@ -3,6 +3,8 @@ Pkg.UserSrc=false Pkg.Revision=1 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} SystemImage.Abi=mips64 SystemImage.GpuSupport=true SystemImage.TagId=default diff --git a/sys-img/images_mips_source.prop_template b/sys-img/images_mips_source.prop_template index 7c3ede315..617949ca0 100644 --- a/sys-img/images_mips_source.prop_template +++ b/sys-img/images_mips_source.prop_template @@ -3,6 +3,8 @@ Pkg.UserSrc=false Pkg.Revision=1 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} SystemImage.Abi=mips SystemImage.GpuSupport=true SystemImage.TagId=default diff --git a/sys-img/images_x86_64_source.prop_template b/sys-img/images_x86_64_source.prop_template index fe8ba6981..8329473bf 100644 --- a/sys-img/images_x86_64_source.prop_template +++ b/sys-img/images_x86_64_source.prop_template @@ -4,6 +4,8 @@ Pkg.Revision=2 Pkg.Dependencies=emulator#29.1.11 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} SystemImage.Abi=x86_64 SystemImage.GpuSupport=true SystemImage.TagId=default diff --git a/sys-img/images_x86_source.prop_template b/sys-img/images_x86_source.prop_template index 76daa9f48..af6b0e2d0 100644 --- a/sys-img/images_x86_source.prop_template +++ b/sys-img/images_x86_source.prop_template @@ -4,6 +4,8 @@ Pkg.Revision=2 Pkg.Dependencies=emulator#29.1.11 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION} AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME} +AndroidVersion.ExtensionLevel=${PLATFORM_SDK_EXTENSION_VERSION} +AndroidVersion.IsBaseSdk=${PLATFORM_IS_BASE_SDK} SystemImage.Abi=x86 SystemImage.GpuSupport=true SystemImage.TagId=default From 6547080f727fcf7194d2b0fac516c1d9ca4315e7 Mon Sep 17 00:00:00 2001 From: Inseob Kim Date: Fri, 24 Sep 2021 13:17:06 +0900 Subject: [PATCH 7/7] Rename soong outdir to generated-headers vndk snapshot captures exported headers as-is, but soong intermediates directory name is used as a result. It may confuse users, so this changes the intermediates directory name to "generated-headers". Bug: 200159267 Test: install snapshot and build Change-Id: I3da7ee98f53e460c448c05ad3456022888099888 --- vndk/snapshot/gen_buildfiles.py | 10 ++++++++-- vndk/snapshot/update.py | 7 +++++++ vndk/snapshot/utils.py | 3 ++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/vndk/snapshot/gen_buildfiles.py b/vndk/snapshot/gen_buildfiles.py index 336a9f988..56fe5959f 100644 --- a/vndk/snapshot/gen_buildfiles.py +++ b/vndk/snapshot/gen_buildfiles.py @@ -525,6 +525,10 @@ class GenBuildFile(object): dirs=dirs, name=name)) + def rename_generated_dirs(dirs): + # Reame out/soong/.intermedaites to generated-headers for better readability. + return [d.replace(utils.SOONG_INTERMEDIATES_DIR, utils.GENERATED_HEADERS_DIR, 1) for d in dirs] + for src in sorted(src_paths): include_dirs = '' system_include_dirs = '' @@ -541,10 +545,12 @@ class GenBuildFile(object): if prebuilt == 'android.hidl.memory@1.0-impl.so': props['RelativeInstallPath'] = 'hw' if 'ExportedDirs' in props: - l = ['include/%s' % d for d in props['ExportedDirs']] + dirs = rename_generated_dirs(props['ExportedDirs']) + l = ['include/%s' % d for d in dirs] include_dirs = list_to_prop_value(l, 'export_include_dirs') if 'ExportedSystemDirs' in props: - l = ['include/%s' % d for d in props['ExportedSystemDirs']] + dirs = rename_generated_dirs(props['ExportedSystemDirs']) + l = ['include/%s' % d for d in dirs] system_include_dirs = list_to_prop_value(l, 'export_system_include_dirs') if 'ExportedFlags' in props: flags = list_to_prop_value(props['ExportedFlags'], 'export_flags') diff --git a/vndk/snapshot/update.py b/vndk/snapshot/update.py index a4e625775..cb973ea51 100644 --- a/vndk/snapshot/update.py +++ b/vndk/snapshot/update.py @@ -95,6 +95,13 @@ def install_snapshot(branch, build, local_dir, install_dir, temp_artifact_dir): logging.info('Unzipping VNDK snapshot: {}'.format(artifact)) utils.check_call(['unzip', '-qn', artifact, '-d', install_dir]) + # rename {install_dir}/{arch}/include/out/soong/.intermediates + for soong_intermediates_dir in glob.glob(install_dir + '/*/include/' + utils.SOONG_INTERMEDIATES_DIR): + generated_headers_dir = soong_intermediates_dir.replace( + utils.SOONG_INTERMEDIATES_DIR, + utils.GENERATED_HEADERS_DIR + ) + os.rename(soong_intermediates_dir, generated_headers_dir) def gather_notice_files(install_dir): """Gathers all NOTICE files to a common NOTICE_FILES directory.""" diff --git a/vndk/snapshot/utils.py b/vndk/snapshot/utils.py index 7d3a94a37..a4e54c4da 100644 --- a/vndk/snapshot/utils.py +++ b/vndk/snapshot/utils.py @@ -37,7 +37,8 @@ NOTICE_FILES_DIR_NAME = 'NOTICE_FILES' NOTICE_FILES_DIR_PATH = os.path.join(COMMON_DIR_PATH, NOTICE_FILES_DIR_NAME) BINDER32 = 'binder32' MINIMUM_VNDK_VERSION = 28 - +SOONG_INTERMEDIATES_DIR = 'out/soong/.intermediates' +GENERATED_HEADERS_DIR = 'generated-headers' def set_logging_config(verbose_level): verbose_map = (logging.WARNING, logging.INFO, logging.DEBUG)