Upgrade Engine Android SDK to 35 (flutter/engine#53574)

**REVIEW BUT DO NOT MERGE:** Will merge after https://github.com/flutter/buildroot/pull/870 lands.

1: Updates engine to use Android 35. Part of https://github.com/flutter/flutter/issues/150215.
Engine step of https://github.com/flutter/flutter/blob/master/docs/platforms/android/Upgrading-Engine's-Android-API-version.md.

2: Updates test runner AGP version to 8.5, engine Gradle version to 8.9 to accommodate update.

3: Fixes lint and suppresses deprecation warnings caused by the update. None of the deprecations are unknown by the team (they are handled in the code), but the tests emitted warnings.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
Camille Simon 2024-07-24 09:54:38 -07:00 committed by GitHub
parent 5f3713cf2e
commit 0619de0107
14 changed files with 28 additions and 20 deletions

6
DEPS
View File

@ -277,7 +277,7 @@ allowed_hosts = [
]
deps = {
'src': 'https://github.com/flutter/buildroot.git' + '@' + '327906297b49980748ea1956019829e7c434a03e',
'src': 'https://github.com/flutter/buildroot.git' + '@' + '91c259d5ee56c24fb870cf7be7d041bb9b8e139f',
'src/flutter/third_party/depot_tools':
Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '580b4ff3f5cd0dcaa2eacda28cefe0f45320e8f7',
@ -734,7 +734,7 @@ deps = {
{
# See tools/gradle/README.md for update instructions.
# Version here means the CIPD tag.
'version': 'version:8.3',
'version': 'version:8.9',
'package': 'flutter/gradle'
}
],
@ -774,7 +774,7 @@ deps = {
'packages': [
{
'package': 'flutter/android/sdk/all/${{platform}}',
'version': 'version:34v7'
'version': 'version:35v1'
}
],
'condition': 'download_android_deps',

View File

@ -59,8 +59,8 @@ trap cleanup EXIT
echo "PASS: ban_generated_plugin_registrant_java failed as expected"
# Create a file in SRC_DIR/third_party, that should be OK.
echo "Creating file ./src/third_party/GeneratedPluginRegistrant.java"
touch "$SRC_DIR/third_party/GeneratedPluginRegistrant.java"
echo "Creating file ./src/flutter/third_party/GeneratedPluginRegistrant.java"
touch "$SRC_DIR/flutter/third_party/GeneratedPluginRegistrant.java"
# Run the ban script, expecting it to succeed.
"$FLUTTER_DIR/ci/ban_generated_plugin_registrant_java.sh" > /dev/null 2>&1 || {

View File

@ -5,7 +5,7 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="io.flutter.app" android:versionCode="1" android:versionName="0.0.1">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="34" />
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="35" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="true" />

View File

@ -20,7 +20,7 @@ repositories {
apply plugin: "com.android.library"
android {
compileSdkVersion 34
compileSdk 35
defaultConfig {
minSdkVersion 21

View File

@ -290,7 +290,7 @@ public class PlatformViewsChannel {
* The ID returned by {@code createForTextureLayer} to indicate that the requested texture mode
* was not available and the view creation fell back to {@code PlatformViewLayer} mode.
*
* This can only be returned if the {@link PlatformViewCreationRequest} sets
* This can only be returned if the {@code PlatformViewCreationRequest} sets
* {@code TEXTURE_WITH_HYBRID_FALLBACK} as the requested display mode.
*/
static final long NON_TEXTURE_FALLBACK = -2;

View File

@ -1048,6 +1048,9 @@ public class FlutterActivityAndFragmentDelegateTest {
}
@Test
@SuppressWarnings("deprecation")
// TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_LOW,
// TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL
public void itNotifiesDartExecutorAndSendsMessageOverSystemChannelWhenToldToTrimMemory() {
// Create the real object that we're testing.
FlutterActivityAndFragmentDelegate delegate = new FlutterActivityAndFragmentDelegate(mockHost);

View File

@ -381,6 +381,8 @@ public class FlutterRendererTest {
}
@Test
@SuppressWarnings("deprecation")
// TRIM_MEMORY_COMPLETE
public void itNotifySurfaceTextureEntryWhenMemoryPressureWarning() {
// Setup the test.
FlutterRenderer flutterRenderer = engineRule.getFlutterEngine().getRenderer();

View File

@ -263,6 +263,9 @@ public class PlatformPluginTest {
}
@Config(sdk = API_LEVELS.API_29)
@SuppressWarnings("deprecation")
// setStatusBarColor, setNavigationBarColor, setNavigationBarDividerColor,
// setStatusBarContrastEnforced, setNavigationBarContrastEnforced
@Test
public void setNavigationBarDividerColor() {
View fakeDecorView = mock(View.class);

View File

@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.0.1"
classpath "com.android.tools.build:gradle:8.5.0"
}
}
@ -33,7 +33,7 @@ println "=========================================="
android {
namespace 'io.flutter.app.test'
compileSdkVersion 34
compileSdk 35
defaultConfig {
minSdkVersion 21

View File

@ -6,12 +6,12 @@ import("//build/config/android/config.gni")
import("//flutter/tools/templater/templater.gni")
android_buildtools =
"//flutter/third_party/android_tools/sdk/build-tools/34.0.0"
"//flutter/third_party/android_tools/sdk/build-tools/35.0.0-rc4"
aapt2 = "$android_buildtools/aapt2"
zipalign = "$android_buildtools/zipalign"
apksigner = "$android_buildtools/apksigner"
android_jar =
"//flutter/third_party/android_tools/sdk/platforms/android-34/android.jar"
"//flutter/third_party/android_tools/sdk/platforms/android-35/android.jar"
src_root = "//flutter/testing/android/native_activity"
# A drop in replacement for an executable or shared library target. Providing a

View File

@ -19,8 +19,8 @@ android {
// The others are irrelevant for a test application.
disable 'UnpackedNativeCode','MissingApplicationIcon','GoogleAppIndexingApiWarning','GoogleAppIndexingWarning','GradleDependency','NewerVersionAvailable','Registered'
}
buildToolsVersion = '34.0.0'
compileSdkVersion 34
buildToolsVersion = '35.0.0-rc4'
compileSdk 35
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
@ -28,7 +28,7 @@ android {
defaultConfig {
applicationId 'dev.flutter.scenarios'
minSdkVersion 21
targetSdkVersion 34
targetSdkVersion 35
versionCode 1
versionName '1.0'
testInstrumentationRunner 'dev.flutter.TestRunner'

View File

@ -1,6 +1,6 @@
platforms;android-34:platforms
platforms;android-35:platforms
cmdline-tools;latest:cmdline-tools
build-tools;34.0.0:build-tools
build-tools;35.0.0-rc4:build-tools
platform-tools:platform-tools
tools:tools
ndk;26.1.10909125:ndk
ndk;26.3.11579264:ndk

View File

@ -33,7 +33,7 @@ allprojects {
apply plugin: "com.android.application"
android {
compileSdkVersion 34
compileSdk 35
}
configurations {

View File

@ -48,7 +48,7 @@ def main():
os.makedirs(args.out_dir)
android_jar_path = os.path.join(
args.src_dir, 'flutter', 'third_party', 'android_tools', 'sdk', 'platforms', 'android-34',
args.src_dir, 'flutter', 'third_party', 'android_tools', 'sdk', 'platforms', 'android-35',
'android.jar'
)
if not os.path.exists(android_jar_path):