Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gcp_credentials: ENCRYPTED[!0e63b52bd7e4fda1cd7b7bf2b4fe515a27fadbeaced01f5ad8b699b81d3611ed64c5d3271bcd8426dd914ef41cba48a0!]
gcp_credentials: ENCRYPTED[!48cff44dd32e9cc412d4d381c7fe68d373ca04cf2639f8192d21cb1a9ab5e21129651423a1cf88f3fd7fe2125c1cabd9!]

# LINUX
task:
Expand Down
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_third_party
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: 988f1584a445473114bc2516f591f26b
Signature: 433ebc3230469097aefe40d80a56dd3f

UNUSED LICENSES:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -436,6 +437,33 @@ public void itWithMetadataWithoutSplashScreenResourceKeyDoesNotProvideSplashScre
assertNull(splashScreen);
}

@Test
public void fullyDrawn() {
Intent intent =
FlutterActivityWithReportFullyDrawn.createDefaultIntent(RuntimeEnvironment.application);
ActivityController<FlutterActivityWithReportFullyDrawn> 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) {
Expand Down Expand Up @@ -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,
Expand Down