Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
SuppressWarnings
  • Loading branch information
hamdikahloun committed Dec 3, 2020
commit 68ca9c3a60d4f8c60c68946056c65261248953e3
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,13 @@ public String getName() {
return FlutterViewRenderedIdlingResource.class.getSimpleName();
}

@SuppressWarnings("deprecation")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put the lint on the specific lines that accesses io.flutter.view.FlutterView

@Override
public boolean isIdleNow() {
boolean isIdle = false;
if (flutterView instanceof FlutterView) {
isIdle = ((FlutterView) flutterView).hasRenderedFirstFrame();
} else //noinspection deprecation
if (flutterView instanceof io.flutter.view.FlutterView) {
//noinspection deprecation
} else if (flutterView instanceof io.flutter.view.FlutterView) {
isIdle = ((io.flutter.view.FlutterView) flutterView).hasRenderedFirstFrame();
} else {
throw new FlutterProtocolException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,12 @@ public static String getDartIsolateId(View flutterView) {
}

/** Gets the Dart executor for the given {@code flutterView}. */
@SuppressWarnings("deprecation")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Updated with requested changes . Thank you

public static DartExecutor getDartExecutor(View flutterView) {
checkNotNull(flutterView, "The Flutter View instance cannot be null.");
// Flutter's embedding is in the phase of rewriting/refactoring. Let's be compatible with both
// the old and the new FlutterView classes.
//noinspection deprecation
if (flutterView instanceof io.flutter.view.FlutterView) {
//noinspection deprecation
return ((io.flutter.view.FlutterView) flutterView).getDartExecutor();
} else if (flutterView instanceof io.flutter.embedding.android.FlutterView) {
FlutterEngine flutterEngine =
Expand Down