diff --git a/.cirrus.yml b/.cirrus.yml index da0e3ed875472..a4fc4a3145a34 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,4 +1,4 @@ -gcp_credentials: ENCRYPTED[!0e63b52bd7e4fda1cd7b7bf2b4fe515a27fadbeaced01f5ad8b699b81d3611ed64c5d3271bcd8426dd914ef41cba48a0!] +gcp_credentials: ENCRYPTED[!48cff44dd32e9cc412d4d381c7fe68d373ca04cf2639f8192d21cb1a9ab5e21129651423a1cf88f3fd7fe2125c1cabd9!] # LINUX task: diff --git a/DEPS b/DEPS index 483a9969ebae7..367882647b73a 100644 --- a/DEPS +++ b/DEPS @@ -35,7 +35,7 @@ vars = { # Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS. # You can use //tools/dart/create_updated_flutter_deps.py to produce # updated revision list of existing dependencies. - 'dart_revision': '4c8a4f0d7ad055fa7dea5e80862cd2074f4454d3', + 'dart_revision': '3300f32fdc5432f40bc00f4179529cbd7449c93a', # WARNING: DO NOT EDIT MANUALLY # The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py diff --git a/ci/licenses_golden/licenses_third_party b/ci/licenses_golden/licenses_third_party index 3f26332fc7f6e..5cfe7658679a6 100644 --- a/ci/licenses_golden/licenses_third_party +++ b/ci/licenses_golden/licenses_third_party @@ -1,4 +1,4 @@ -Signature: 988f1584a445473114bc2516f591f26b +Signature: 433ebc3230469097aefe40d80a56dd3f UNUSED LICENSES: diff --git a/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java b/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java index 16497674240de..bed4a8bc5f9bd 100644 --- a/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java +++ b/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java @@ -1054,10 +1054,13 @@ public void onFlutterTextureViewCreated(@NonNull FlutterTextureView flutterTextu @Override public void onFlutterUiDisplayed() { // Notifies Android that we're fully drawn so that performance metrics can be collected by - // Flutter performance tests. - // This was supported in KitKat (API 19), but has a bug around requiring - // permissions. See https://github.com/flutter/flutter/issues/46172 - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + // Flutter performance tests. A few considerations: + // * reportFullyDrawn was supported in KitKat (API 19), but has a bug around requiring + // permissions in some Android versions. + // * reportFullyDrawn behavior isn't tested on pre-Q versions. + // See https://github.com/flutter/flutter/issues/46172, and + // https://github.com/flutter/flutter/issues/88767. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { reportFullyDrawn(); } } diff --git a/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityTest.java b/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityTest.java index b88460b3cb423..7eea699d8b41b 100644 --- a/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityTest.java +++ b/shell/platform/android/test/io/flutter/embedding/android/FlutterActivityTest.java @@ -20,6 +20,7 @@ import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; +import android.os.Build; import android.os.Bundle; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -436,6 +437,33 @@ public void itWithMetadataWithoutSplashScreenResourceKeyDoesNotProvideSplashScre assertNull(splashScreen); } + @Test + public void fullyDrawn() { + Intent intent = + FlutterActivityWithReportFullyDrawn.createDefaultIntent(RuntimeEnvironment.application); + ActivityController activityController = + Robolectric.buildActivity(FlutterActivityWithReportFullyDrawn.class, intent); + FlutterActivityWithReportFullyDrawn flutterActivity = activityController.get(); + + // See https://github.com/flutter/flutter/issues/46172, and + // https://github.com/flutter/flutter/issues/88767. + for (int version = Build.VERSION_CODES.JELLY_BEAN; version < Build.VERSION_CODES.Q; version++) { + TestUtils.setApiVersion(version); + flutterActivity.onFlutterUiDisplayed(); + assertFalse( + "reportFullyDrawn isn't used in API level " + version, flutterActivity.isFullyDrawn()); + } + + final int versionCodeS = 31; + for (int version = Build.VERSION_CODES.Q; version < versionCodeS; version++) { + TestUtils.setApiVersion(version); + flutterActivity.onFlutterUiDisplayed(); + assertTrue( + "reportFullyDrawn is used in API level " + version, flutterActivity.isFullyDrawn()); + flutterActivity.resetFullyDrawn(); + } + } + static class FlutterActivityWithProvidedEngine extends FlutterActivity { @Override protected void onCreate(@Nullable Bundle savedInstanceState) { @@ -475,6 +503,23 @@ public RenderMode getRenderMode() { } } + private static class FlutterActivityWithReportFullyDrawn extends FlutterActivity { + private boolean fullyDrawn = false; + + @Override + public void reportFullyDrawn() { + fullyDrawn = true; + } + + public boolean isFullyDrawn() { + return fullyDrawn; + } + + public void resetFullyDrawn() { + fullyDrawn = false; + } + } + private static final class FakeFlutterPlugin implements FlutterPlugin, ActivityAware,