Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit b3af521

Browse files
YugueEmmanuel Garciachristopherfujinokeyonghan
authored
[flutter_releases] Flutter stable 2.5.1 Engine Cherrypicks (#28665)
* 'Update Dart SDK to 3300f32' * Don't use rFD in pre-Q versions (#28593) * updated 3rd party license golden * hard-code Build.VERSION_CODE.S * renew cirrus key (#28584) Co-authored-by: Emmanuel Garcia <egarciad@google.com> Co-authored-by: Christopher Fujino <christopherfujino@gmail.com> Co-authored-by: keyonghan <54558023+keyonghan@users.noreply.github.com>
1 parent f0826da commit b3af521

5 files changed

Lines changed: 55 additions & 7 deletions

File tree

.cirrus.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gcp_credentials: ENCRYPTED[!0e63b52bd7e4fda1cd7b7bf2b4fe515a27fadbeaced01f5ad8b699b81d3611ed64c5d3271bcd8426dd914ef41cba48a0!]
1+
gcp_credentials: ENCRYPTED[!48cff44dd32e9cc412d4d381c7fe68d373ca04cf2639f8192d21cb1a9ab5e21129651423a1cf88f3fd7fe2125c1cabd9!]
22

33
# LINUX
44
task:

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ vars = {
3535
# Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS.
3636
# You can use //tools/dart/create_updated_flutter_deps.py to produce
3737
# updated revision list of existing dependencies.
38-
'dart_revision': '4c8a4f0d7ad055fa7dea5e80862cd2074f4454d3',
38+
'dart_revision': '3300f32fdc5432f40bc00f4179529cbd7449c93a',
3939

4040
# WARNING: DO NOT EDIT MANUALLY
4141
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py

ci/licenses_golden/licenses_third_party

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: 988f1584a445473114bc2516f591f26b
1+
Signature: 433ebc3230469097aefe40d80a56dd3f
22

33
UNUSED LICENSES:
44

shell/platform/android/io/flutter/embedding/android/FlutterActivity.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,10 +1054,13 @@ public void onFlutterTextureViewCreated(@NonNull FlutterTextureView flutterTextu
10541054
@Override
10551055
public void onFlutterUiDisplayed() {
10561056
// Notifies Android that we're fully drawn so that performance metrics can be collected by
1057-
// Flutter performance tests.
1058-
// This was supported in KitKat (API 19), but has a bug around requiring
1059-
// permissions. See https://github.com/flutter/flutter/issues/46172
1060-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
1057+
// Flutter performance tests. A few considerations:
1058+
// * reportFullyDrawn was supported in KitKat (API 19), but has a bug around requiring
1059+
// permissions in some Android versions.
1060+
// * reportFullyDrawn behavior isn't tested on pre-Q versions.
1061+
// See https://github.com/flutter/flutter/issues/46172, and
1062+
// https://github.com/flutter/flutter/issues/88767.
1063+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
10611064
reportFullyDrawn();
10621065
}
10631066
}

shell/platform/android/test/io/flutter/embedding/android/FlutterActivityTest.java

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import android.content.Intent;
2121
import android.content.pm.ActivityInfo;
2222
import android.content.pm.PackageManager;
23+
import android.os.Build;
2324
import android.os.Bundle;
2425
import androidx.annotation.NonNull;
2526
import androidx.annotation.Nullable;
@@ -436,6 +437,33 @@ public void itWithMetadataWithoutSplashScreenResourceKeyDoesNotProvideSplashScre
436437
assertNull(splashScreen);
437438
}
438439

440+
@Test
441+
public void fullyDrawn() {
442+
Intent intent =
443+
FlutterActivityWithReportFullyDrawn.createDefaultIntent(RuntimeEnvironment.application);
444+
ActivityController<FlutterActivityWithReportFullyDrawn> activityController =
445+
Robolectric.buildActivity(FlutterActivityWithReportFullyDrawn.class, intent);
446+
FlutterActivityWithReportFullyDrawn flutterActivity = activityController.get();
447+
448+
// See https://github.com/flutter/flutter/issues/46172, and
449+
// https://github.com/flutter/flutter/issues/88767.
450+
for (int version = Build.VERSION_CODES.JELLY_BEAN; version < Build.VERSION_CODES.Q; version++) {
451+
TestUtils.setApiVersion(version);
452+
flutterActivity.onFlutterUiDisplayed();
453+
assertFalse(
454+
"reportFullyDrawn isn't used in API level " + version, flutterActivity.isFullyDrawn());
455+
}
456+
457+
final int versionCodeS = 31;
458+
for (int version = Build.VERSION_CODES.Q; version < versionCodeS; version++) {
459+
TestUtils.setApiVersion(version);
460+
flutterActivity.onFlutterUiDisplayed();
461+
assertTrue(
462+
"reportFullyDrawn is used in API level " + version, flutterActivity.isFullyDrawn());
463+
flutterActivity.resetFullyDrawn();
464+
}
465+
}
466+
439467
static class FlutterActivityWithProvidedEngine extends FlutterActivity {
440468
@Override
441469
protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -475,6 +503,23 @@ public RenderMode getRenderMode() {
475503
}
476504
}
477505

506+
private static class FlutterActivityWithReportFullyDrawn extends FlutterActivity {
507+
private boolean fullyDrawn = false;
508+
509+
@Override
510+
public void reportFullyDrawn() {
511+
fullyDrawn = true;
512+
}
513+
514+
public boolean isFullyDrawn() {
515+
return fullyDrawn;
516+
}
517+
518+
public void resetFullyDrawn() {
519+
fullyDrawn = false;
520+
}
521+
}
522+
478523
private static final class FakeFlutterPlugin
479524
implements FlutterPlugin,
480525
ActivityAware,

0 commit comments

Comments
 (0)