Commit ce14e58b authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Increase default_min_sdk_version 19 -> 21

Cronet is the only project that requires a lower minSdkVersion. To
continue supporting building of their targets, this change enabled
proguard on all of their apks in order to have all files desugared at
the proper minApiVersion.

This change should speed up compiles somewhat, as it removes the need to
generate main-dex-lists for legacy multidex purposes.

Bug: 1091919
Change-Id: Ifd8089bbf4965b55a13dea11464ccda979fd5028
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2233581Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#776166}
parent d1bd3ffb
......@@ -46,9 +46,8 @@ if (is_android || is_chromeos) {
enable_chrome_android_internal = has_chrome_android_internal
# The default to use for android:minSdkVersion for targets that do
# not explicitly set it. This can generally be set higher than the
# default, but not lower.
default_min_sdk_version = 19
# not explicitly set it.
default_min_sdk_version = 21
# Android API level for 32 bits platforms
android32_ndk_api_level = 16
......
......@@ -1306,6 +1306,9 @@ if (enable_java_templates) {
}
}
# It's not safe to dex merge with libraries dex'ed at higher api versions.
assert(!_is_dex_merging || _min_sdk_version >= default_min_sdk_version)
# For D8's backported method desugaring to work properly, the dex merge step
# must not be set to a higher minSdkVersion than it was for the libraries.
if (_enable_desugar && _is_dex_merging) {
......@@ -3254,8 +3257,6 @@ if (enable_java_templates) {
# from the final .jar file.
# jar_included_patterns: Optional list of .class file patterns to include
# in the final .jar file. jar_excluded_patterns take precedence over this.
# min_sdk_version: Optional. The minimum Android SDK version this target
# supports.
#
# For 'android_apk' and 'android_app_bundle_module' targets only:
#
......
......@@ -2430,9 +2430,7 @@ if (enable_java_templates) {
_final_deps = []
_enable_main_dex_list =
_enable_multidex &&
(!defined(invoker.min_sdk_version) || invoker.min_sdk_version < 21)
_enable_main_dex_list = _enable_multidex && _min_sdk_version < 21
if (_enable_main_dex_list) {
_generated_proguard_main_dex_config =
"$_base_path.resources.main-dex-proguard.txt"
......@@ -2927,12 +2925,16 @@ if (enable_java_templates) {
deps += _deps + [ ":$_compile_resources_target" ]
proguard_mapping_path = _proguard_mapping_path
proguard_sourcefile_suffix = "$android_channel-$_version_code"
} else {
} else if (_min_sdk_version >= default_min_sdk_version) {
# Enable dex merging only when min_sdk_version is >= what the library
# .dex files were created with.
input_dex_filearg =
"@FileArg(${_rebased_build_config}:final_dex:all_dex_files)"
if (_enable_main_dex_list) {
main_dex_list_input_classes_filearg = "@FileArg(${_rebased_build_config}:deps_info:java_runtime_classpath)"
}
} else {
input_classes_filearg = "@FileArg($_rebased_build_config:deps_info:java_runtime_classpath)"
}
if (_is_static_library_provider) {
......
......@@ -10,7 +10,6 @@
xmlns:tools="http://schemas.android.com/tools"
package="org.chromium.android_browsertests_apk">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="23" />
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment