diff --git a/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java b/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java index 35200a22ed1c5..ae21e897363ec 100644 --- a/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java +++ b/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java @@ -42,13 +42,13 @@ public final class BasicMessageChannel { public BasicMessageChannel(BinaryMessenger messenger, String name, MessageCodec codec) { if (BuildConfig.DEBUG) { if (messenger == null) { - throw new AssertionError("Parameter messenger must not be null."); + Log.e(TAG, "Parameter messenger must not be null."); } if (name == null) { - throw new AssertionError("Parameter name must not be null."); + Log.e(TAG, "Parameter name must not be null."); } if (codec == null) { - throw new AssertionError("Parameter codec must not be null."); + Log.e(TAG, "Parameter codec must not be null."); } } this.messenger = messenger; diff --git a/shell/platform/android/io/flutter/plugin/common/EventChannel.java b/shell/platform/android/io/flutter/plugin/common/EventChannel.java index 72fd371296cd0..2866691275fa4 100644 --- a/shell/platform/android/io/flutter/plugin/common/EventChannel.java +++ b/shell/platform/android/io/flutter/plugin/common/EventChannel.java @@ -59,13 +59,13 @@ public EventChannel(BinaryMessenger messenger, String name) { public EventChannel(BinaryMessenger messenger, String name, MethodCodec codec) { if (BuildConfig.DEBUG) { if (messenger == null) { - throw new AssertionError("Parameter messenger must not be null."); + Log.e(TAG, "Parameter messenger must not be null."); } if (name == null) { - throw new AssertionError("Parameter name must not be null."); + Log.e(TAG, "Parameter name must not be null."); } if (codec == null) { - throw new AssertionError("Parameter codec must not be null."); + Log.e(TAG, "Parameter codec must not be null."); } } this.messenger = messenger; diff --git a/shell/platform/android/io/flutter/plugin/common/FlutterException.java b/shell/platform/android/io/flutter/plugin/common/FlutterException.java index 5b643c7561e21..6d116464520a2 100644 --- a/shell/platform/android/io/flutter/plugin/common/FlutterException.java +++ b/shell/platform/android/io/flutter/plugin/common/FlutterException.java @@ -4,19 +4,23 @@ package io.flutter.plugin.common; +import android.util.Log; + import io.flutter.BuildConfig; /** * Thrown to indicate that a Flutter method invocation failed on the Flutter side. */ public class FlutterException extends RuntimeException { + private static final String TAG = "FlutterException#"; + public final String code; public final Object details; FlutterException(String code, String message, Object details) { super(message); if (BuildConfig.DEBUG && code == null) { - throw new AssertionError("Parameter code must not be null."); + Log.e(TAG, "Parameter code must not be null."); } this.code = code; this.details = details; diff --git a/shell/platform/android/io/flutter/plugin/common/MethodChannel.java b/shell/platform/android/io/flutter/plugin/common/MethodChannel.java index 9ffcdaa2074a7..1c8c8636faf44 100644 --- a/shell/platform/android/io/flutter/plugin/common/MethodChannel.java +++ b/shell/platform/android/io/flutter/plugin/common/MethodChannel.java @@ -58,13 +58,13 @@ public MethodChannel(BinaryMessenger messenger, String name) { public MethodChannel(BinaryMessenger messenger, String name, MethodCodec codec) { if (BuildConfig.DEBUG) { if (messenger == null) { - throw new AssertionError("Parameter messenger must not be null."); + Log.e(TAG, "Parameter messenger must not be null."); } if (name == null) { - throw new AssertionError("Parameter name must not be null."); + Log.e(TAG, "Parameter name must not be null."); } if (codec == null) { - throw new AssertionError("Parameter codec must not be null."); + Log.e(TAG, "Parameter codec must not be null."); } } this.messenger = messenger; diff --git a/shell/platform/android/io/flutter/plugin/common/StandardMessageCodec.java b/shell/platform/android/io/flutter/plugin/common/StandardMessageCodec.java index dfe11e86c49ae..20c4f392ea5de 100644 --- a/shell/platform/android/io/flutter/plugin/common/StandardMessageCodec.java +++ b/shell/platform/android/io/flutter/plugin/common/StandardMessageCodec.java @@ -4,6 +4,8 @@ package io.flutter.plugin.common; +import android.util.Log; + import io.flutter.BuildConfig; import java.io.ByteArrayOutputStream; @@ -60,6 +62,7 @@ *

To extend the codec, overwrite the writeValue and readValueOfType methods.

*/ public class StandardMessageCodec implements MessageCodec { + private static final String TAG = "StandardMessageCodec#"; public static final StandardMessageCodec INSTANCE = new StandardMessageCodec(); @Override @@ -110,7 +113,7 @@ public Object decodeMessage(ByteBuffer message) { */ protected static final void writeSize(ByteArrayOutputStream stream, int value) { if (BuildConfig.DEBUG && 0 > value) { - throw new AssertionError("Attempted to write a negative size."); + Log.e(TAG, "Attempted to write a negative size."); } if (value < 254) { stream.write(value); diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index b2e3a5b47aa16..1d295404862cd 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -1330,9 +1330,6 @@ void updateSemantics(@NonNull ByteBuffer buffer, @NonNull String[] strings) { if (object.scrollIndex + visibleChildren > object.scrollChildren) { Log.e(TAG, "Scroll index is out of bounds."); } - if (object.childrenInHitTestOrder.get(object.scrollIndex).hasFlag(Flag.IS_HIDDEN)) { - Log.e(TAG, "Attempted to move Accessibility Focus to hidden child."); - } } // The setToIndex should be the index of the last visible child. Because we counted all // children, including the first index we need to subtract one. diff --git a/shell/platform/android/io/flutter/view/ResourceExtractor.java b/shell/platform/android/io/flutter/view/ResourceExtractor.java index a25e5b43ae98f..bbdcbf9e8786d 100644 --- a/shell/platform/android/io/flutter/view/ResourceExtractor.java +++ b/shell/platform/android/io/flutter/view/ResourceExtractor.java @@ -172,7 +172,7 @@ ResourceExtractor addResources(@NonNull Collection resources) { ResourceExtractor start() { if (BuildConfig.DEBUG && mExtractTask != null) { - throw new AssertionError("Attempted to start resource extraction while another extraction was in progress."); + Log.e(TAG, "Attempted to start resource extraction while another extraction was in progress."); } mExtractTask = new ExtractTask(mDataDirPath, mResources, mPackageName, mPackageManager, mAssetManager); mExtractTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);