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
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ public final class BasicMessageChannel<T> {
public BasicMessageChannel(BinaryMessenger messenger, String name, MessageCodec<T> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package io.flutter.plugin.common;

import android.util.Log;

import io.flutter.BuildConfig;

import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -60,6 +62,7 @@
* <p>To extend the codec, overwrite the writeValue and readValueOfType methods.</p>
*/
public class StandardMessageCodec implements MessageCodec<Object> {
private static final String TAG = "StandardMessageCodec#";
public static final StandardMessageCodec INSTANCE = new StandardMessageCodec();

@Override
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ ResourceExtractor addResources(@NonNull Collection<String> 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);
Expand Down