diff --git a/engine/src/flutter/ci/licenses_golden/licenses_flutter b/engine/src/flutter/ci/licenses_golden/licenses_flutter index 55a5f63693..6c669632c5 100644 --- a/engine/src/flutter/ci/licenses_golden/licenses_flutter +++ b/engine/src/flutter/ci/licenses_golden/licenses_flutter @@ -467,16 +467,16 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterActivityEven FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterApplication.java FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java +FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/AndroidKeyProcessor.java +FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java +FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java +FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java +FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java +FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterTextureView.java +FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/android/FlutterView.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterShellArgs.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/android/AndroidKeyProcessor.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/android/AndroidTouchProcessor.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterActivity.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterFragment.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterSurfaceView.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterTextureView.java -FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterView.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/DartExecutor.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/DartMessenger.java FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/PlatformMessageHandler.java diff --git a/engine/src/flutter/shell/platform/android/BUILD.gn b/engine/src/flutter/shell/platform/android/BUILD.gn index bb5b74c05e..e26d71a30e 100644 --- a/engine/src/flutter/shell/platform/android/BUILD.gn +++ b/engine/src/flutter/shell/platform/android/BUILD.gn @@ -109,16 +109,16 @@ java_library("flutter_shell_java") { "io/flutter/app/FlutterApplication.java", "io/flutter/app/FlutterFragmentActivity.java", "io/flutter/app/FlutterPluginRegistry.java", + "io/flutter/embedding/android/AndroidKeyProcessor.java", + "io/flutter/embedding/android/AndroidTouchProcessor.java", + "io/flutter/embedding/android/FlutterActivity.java", + "io/flutter/embedding/android/FlutterFragment.java", + "io/flutter/embedding/android/FlutterSurfaceView.java", + "io/flutter/embedding/android/FlutterTextureView.java", + "io/flutter/embedding/android/FlutterView.java", "io/flutter/embedding/engine/FlutterEngine.java", "io/flutter/embedding/engine/FlutterJNI.java", "io/flutter/embedding/engine/FlutterShellArgs.java", - "io/flutter/embedding/engine/android/AndroidKeyProcessor.java", - "io/flutter/embedding/engine/android/AndroidTouchProcessor.java", - "io/flutter/embedding/engine/android/FlutterActivity.java", - "io/flutter/embedding/engine/android/FlutterFragment.java", - "io/flutter/embedding/engine/android/FlutterSurfaceView.java", - "io/flutter/embedding/engine/android/FlutterTextureView.java", - "io/flutter/embedding/engine/android/FlutterView.java", "io/flutter/embedding/engine/dart/DartExecutor.java", "io/flutter/embedding/engine/dart/DartMessenger.java", "io/flutter/embedding/engine/dart/PlatformMessageHandler.java", diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/AndroidKeyProcessor.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/AndroidKeyProcessor.java similarity index 98% rename from engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/AndroidKeyProcessor.java rename to engine/src/flutter/shell/platform/android/io/flutter/embedding/android/AndroidKeyProcessor.java index 09f992de7c..9ceb390050 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/AndroidKeyProcessor.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/AndroidKeyProcessor.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package io.flutter.embedding.engine.android; +package io.flutter.embedding.android; import android.support.annotation.NonNull; import android.support.annotation.Nullable; diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/AndroidTouchProcessor.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java similarity index 98% rename from engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/AndroidTouchProcessor.java rename to engine/src/flutter/shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java index 8598b8a8df..ce69702143 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/AndroidTouchProcessor.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/AndroidTouchProcessor.java @@ -1,4 +1,4 @@ -package io.flutter.embedding.engine.android; +package io.flutter.embedding.android; import android.os.Build; import android.support.annotation.IntDef; @@ -164,7 +164,9 @@ public class AndroidTouchProcessor { // ACTION_HOVER_MOVE always applies to a single pointer only. addPointerForIndex(event, event.getActionIndex(), pointerChange, 0, packet); - assert(packet.position() % (POINTER_DATA_FIELD_COUNT * BYTES_PER_FIELD) != 0); + if (packet.position() % (POINTER_DATA_FIELD_COUNT * BYTES_PER_FIELD) != 0) { + throw new AssertionError("Packet position is not on field boundary."); + } renderer.dispatchPointerDataPacket(packet, packet.position()); return true; } diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterActivity.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java similarity index 99% rename from engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterActivity.java rename to engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java index cdaab64827..0b75d129c6 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterActivity.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterActivity.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package io.flutter.embedding.engine.android; +package io.flutter.embedding.android; import android.content.Context; import android.content.Intent; diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterFragment.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java similarity index 99% rename from engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterFragment.java rename to engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java index bc19348f7f..53c283d934 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterFragment.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package io.flutter.embedding.engine.android; +package io.flutter.embedding.android; import android.content.Context; import android.content.Intent; diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterSurfaceView.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java similarity index 98% rename from engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterSurfaceView.java rename to engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java index 944e26b7c8..c28eac9c5d 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterSurfaceView.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterSurfaceView.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package io.flutter.embedding.engine.android; +package io.flutter.embedding.android; import android.content.Context; import android.support.annotation.NonNull; @@ -12,8 +12,6 @@ import android.util.Log; import android.view.SurfaceHolder; import android.view.SurfaceView; -import java.nio.ByteBuffer; - import io.flutter.embedding.engine.renderer.FlutterRenderer; /** diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterTextureView.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterTextureView.java similarity index 98% rename from engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterTextureView.java rename to engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterTextureView.java index 048fc71a44..32850ff17e 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterTextureView.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterTextureView.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package io.flutter.embedding.engine.android; +package io.flutter.embedding.android; import android.content.Context; import android.graphics.SurfaceTexture; @@ -13,8 +13,6 @@ import android.util.Log; import android.view.Surface; import android.view.TextureView; -import java.nio.ByteBuffer; - import io.flutter.embedding.engine.renderer.FlutterRenderer; /** diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterView.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterView.java similarity index 99% rename from engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterView.java rename to engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterView.java index 3c104b32c6..8469519b3e 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/android/FlutterView.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterView.java @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -package io.flutter.embedding.engine.android; +package io.flutter.embedding.android; import android.annotation.TargetApi; import android.content.Context; @@ -10,7 +10,6 @@ import android.content.res.Configuration; import android.graphics.Rect; import android.os.Build; import android.os.LocaleList; -import android.provider.Settings; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.RequiresApi; @@ -20,7 +19,6 @@ import android.util.Log; import android.view.KeyEvent; import android.view.MotionEvent; import android.view.WindowInsets; -import android.view.WindowManager; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeProvider; import android.view.inputmethod.EditorInfo; @@ -33,10 +31,8 @@ import java.util.Locale; import io.flutter.embedding.engine.FlutterEngine; import io.flutter.embedding.engine.renderer.FlutterRenderer; -import io.flutter.embedding.engine.systemchannels.AccessibilityChannel; import io.flutter.plugin.editing.TextInputPlugin; import io.flutter.view.AccessibilityBridge; -import io.flutter.view.VsyncWaiter; /** * Displays a Flutter UI on an Android device. diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java index dd0e198c1f..5fd3521e54 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java @@ -15,6 +15,7 @@ import android.view.Surface; import java.nio.ByteBuffer; import java.util.concurrent.atomic.AtomicLong; +import io.flutter.embedding.android.FlutterView; import io.flutter.embedding.engine.FlutterJNI; import io.flutter.view.TextureRegistry; @@ -29,7 +30,7 @@ import io.flutter.view.TextureRegistry; * code via JNI. The corresponding {@link RenderSurface} is used as a delegate to carry out * certain actions on behalf of this {@code FlutterRenderer} within an Android view hierarchy. * - * {@link io.flutter.embedding.engine.android.FlutterView} is an implementation of a {@link RenderSurface}. + * {@link FlutterView} is an implementation of a {@link RenderSurface}. */ @TargetApi(Build.VERSION_CODES.JELLY_BEAN) public class FlutterRenderer implements TextureRegistry { diff --git a/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterView.java b/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterView.java index 0935ab6af2..4faef7d518 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterView.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/view/FlutterView.java @@ -15,7 +15,6 @@ import android.graphics.SurfaceTexture; import android.os.Build; import android.os.Handler; import android.os.LocaleList; -import android.provider.Settings; import android.support.annotation.RequiresApi; import android.text.format.DateFormat; import android.util.AttributeSet; @@ -28,8 +27,8 @@ import android.view.inputmethod.InputConnection; import android.view.inputmethod.InputMethodManager; import io.flutter.app.FlutterPluginRegistry; import io.flutter.embedding.engine.FlutterJNI; -import io.flutter.embedding.engine.android.AndroidKeyProcessor; -import io.flutter.embedding.engine.android.AndroidTouchProcessor; +import io.flutter.embedding.android.AndroidKeyProcessor; +import io.flutter.embedding.android.AndroidTouchProcessor; import io.flutter.embedding.engine.dart.DartExecutor; import io.flutter.embedding.engine.renderer.FlutterRenderer; import io.flutter.embedding.engine.systemchannels.AccessibilityChannel; diff --git a/engine/src/flutter/tools/android_lint/baseline.xml b/engine/src/flutter/tools/android_lint/baseline.xml index 8bf5af53ea..bc6c463610 100644 --- a/engine/src/flutter/tools/android_lint/baseline.xml +++ b/engine/src/flutter/tools/android_lint/baseline.xml @@ -480,7 +480,7 @@ errorLine1=" public boolean onTouchEvent(MotionEvent event) {" errorLine2=" ~~~~~~~~~~~~">