From 4d4a42b63c79b1519ce297f750b96ea97aa281fb Mon Sep 17 00:00:00 2001 From: Mehmet Fidanboylu Date: Fri, 1 Jun 2018 10:16:50 -0700 Subject: [PATCH] Fix lint errors to prepare for building Android files in Google (flutter/engine#5440) --- .../android/io/flutter/app/FlutterActivityDelegate.java | 4 ++-- .../android/io/flutter/plugin/common/StandardMethodCodec.java | 1 + .../io/flutter/plugin/editing/InputConnectionAdaptor.java | 3 +-- .../platform/android/io/flutter/view/AccessibilityBridge.java | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java b/engine/src/flutter/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java index 601926ac0b..7771e90514 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/app/FlutterActivityDelegate.java @@ -205,7 +205,7 @@ public final class FlutterActivityDelegate Application app = (Application) activity.getApplicationContext(); if (app instanceof FlutterApplication) { FlutterApplication flutterApp = (FlutterApplication) app; - if (this.equals(flutterApp.getCurrentActivity())) { + if (activity.equals(flutterApp.getCurrentActivity())) { Log.i(TAG, "onPause setting current activity to null"); flutterApp.setCurrentActivity(null); } @@ -251,7 +251,7 @@ public final class FlutterActivityDelegate Application app = (Application) activity.getApplicationContext(); if (app instanceof FlutterApplication) { FlutterApplication flutterApp = (FlutterApplication) app; - if (this.equals(flutterApp.getCurrentActivity())) { + if (activity.equals(flutterApp.getCurrentActivity())) { Log.i(TAG, "onDestroy setting current activity to null"); flutterApp.setCurrentActivity(null); } diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/StandardMethodCodec.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/StandardMethodCodec.java index 82cf512672..1284c11390 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/StandardMethodCodec.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/common/StandardMethodCodec.java @@ -84,6 +84,7 @@ public final class StandardMethodCodec implements MethodCodec { return result; } } + // Falls through intentionally. case 1: { final Object code = messageCodec.readValue(envelope); final Object message = messageCodec.readValue(envelope); diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java index af7da838a3..c77524dfa0 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/InputConnectionAdaptor.java @@ -91,8 +91,7 @@ class InputConnectionAdaptor extends BaseInputConnection { @Override public boolean deleteSurroundingText(int beforeLength, int afterLength) { - if (Selection.getSelectionStart(mEditable) == -1 || - Selection.getSelectionStart(mEditable) == -1) + if (Selection.getSelectionStart(mEditable) == -1) return true; boolean result = super.deleteSurroundingText(beforeLength, afterLength); diff --git a/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java index ebf19111b6..322e113f62 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -424,6 +424,7 @@ class AccessibilityBridge extends AccessibilityNodeProvider implements BasicMess if (mInputFocusedObject != null) return createAccessibilityNodeInfo(mInputFocusedObject.id); } + // Fall through to check FOCUS_ACCESSIBILITY case AccessibilityNodeInfo.FOCUS_ACCESSIBILITY: { if (mA11yFocusedObject != null) return createAccessibilityNodeInfo(mA11yFocusedObject.id);