package defpackage; import defpackage.TaskEventReporter; import io.flutter.plugin.common.BasicMessageChannel; import io.flutter.plugin.common.BinaryMessenger; import io.flutter.plugin.common.MessageCodec; import io.flutter.plugin.common.StandardMessageCodec; import java.util.List; import kotlin.Lazy; import kotlin.LazyKt; import kotlin.Metadata; import kotlin.collections.CollectionsKt; import kotlin.jvm.functions.Function0; import kotlin.jvm.internal.Intrinsics; /* compiled from: Device.kt */ @Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0004\bf\u0018\u0000 \n2\u00020\u0001:\u0001\nJ\u0018\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00032\u0006\u0010\u0005\u001a\u00020\u0003H&J\u0018\u0010\u0006\u001a\u00020\u00072\u0006\u0010\b\u001a\u00020\u00032\u0006\u0010\t\u001a\u00020\u0003H&¨\u0006\u000b"}, d2 = {"LTaskEventReporter;", "", "getTaskInfo", "", "task", "name", "sendEvent", "", "eventName", "payload", "Companion", "app_productionEnvRelease"}, k = 1, mv = {1, 9, 0}, xi = 48) /* loaded from: classes.dex */ public interface TaskEventReporter { /* renamed from: Companion, reason: from kotlin metadata */ public static final Companion INSTANCE = Companion.$$INSTANCE; String getTaskInfo(String task, String name); void sendEvent(String eventName, String payload); /* compiled from: Device.kt */ @Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0018\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\b\u0010\r\u001a\u0004\u0018\u00010\u000eR#\u0010\u0003\u001a\n\u0012\u0006\u0012\u0004\u0018\u00010\u00010\u00048FX\u0086\u0084\u0002¢\u0006\f\n\u0004\b\u0007\u0010\b\u001a\u0004\b\u0005\u0010\u0006¨\u0006\u000f"}, d2 = {"LTaskEventReporter$Companion;", "", "()V", "codec", "Lio/flutter/plugin/common/MessageCodec;", "getCodec", "()Lio/flutter/plugin/common/MessageCodec;", "codec$delegate", "Lkotlin/Lazy;", "setUp", "", "binaryMessenger", "Lio/flutter/plugin/common/BinaryMessenger;", "api", "LTaskEventReporter;", "app_productionEnvRelease"}, k = 1, mv = {1, 9, 0}, xi = 48) /* loaded from: classes.dex */ public static final class Companion { static final /* synthetic */ Companion $$INSTANCE = new Companion(); /* renamed from: codec$delegate, reason: from kotlin metadata */ private static final Lazy codec = LazyKt.lazy(new Function0() { // from class: TaskEventReporter$Companion$codec$2 /* JADX WARN: Can't rename method to resolve collision */ @Override // kotlin.jvm.functions.Function0 public final StandardMessageCodec invoke() { return new StandardMessageCodec(); } }); private Companion() { } public final MessageCodec getCodec() { return codec.getValue(); } public final void setUp(BinaryMessenger binaryMessenger, final TaskEventReporter api) { Intrinsics.checkNotNullParameter(binaryMessenger, "binaryMessenger"); BasicMessageChannel basicMessageChannel = new BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.r1_flutter.TaskEventReporter.sendEvent", getCodec()); if (api != null) { basicMessageChannel.setMessageHandler(new BasicMessageChannel.MessageHandler() { // from class: TaskEventReporter$Companion$$ExternalSyntheticLambda0 @Override // io.flutter.plugin.common.BasicMessageChannel.MessageHandler public final void onMessage(Object obj, BasicMessageChannel.Reply reply) { TaskEventReporter.Companion.setUp$lambda$1$lambda$0(TaskEventReporter.this, obj, reply); } }); } else { basicMessageChannel.setMessageHandler(null); } BasicMessageChannel basicMessageChannel2 = new BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.r1_flutter.TaskEventReporter.getTaskInfo", getCodec()); if (api != null) { basicMessageChannel2.setMessageHandler(new BasicMessageChannel.MessageHandler() { // from class: TaskEventReporter$Companion$$ExternalSyntheticLambda1 @Override // io.flutter.plugin.common.BasicMessageChannel.MessageHandler public final void onMessage(Object obj, BasicMessageChannel.Reply reply) { TaskEventReporter.Companion.setUp$lambda$3$lambda$2(TaskEventReporter.this, obj, reply); } }); } else { basicMessageChannel2.setMessageHandler(null); } } /* JADX INFO: Access modifiers changed from: private */ public static final void setUp$lambda$1$lambda$0(TaskEventReporter taskEventReporter, Object obj, BasicMessageChannel.Reply reply) { List wrapError; Intrinsics.checkNotNullParameter(reply, "reply"); Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlin.collections.List"); List list = (List) obj; Object obj2 = list.get(0); Intrinsics.checkNotNull(obj2, "null cannot be cast to non-null type kotlin.String"); String str = (String) obj2; Object obj3 = list.get(1); Intrinsics.checkNotNull(obj3, "null cannot be cast to non-null type kotlin.String"); try { taskEventReporter.sendEvent(str, (String) obj3); wrapError = CollectionsKt.listOf((Object) null); } catch (Throwable th) { wrapError = createConnectionError.wrapError(th); } reply.reply(wrapError); } /* JADX INFO: Access modifiers changed from: private */ public static final void setUp$lambda$3$lambda$2(TaskEventReporter taskEventReporter, Object obj, BasicMessageChannel.Reply reply) { List wrapError; Intrinsics.checkNotNullParameter(reply, "reply"); Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type kotlin.collections.List"); List list = (List) obj; Object obj2 = list.get(0); Intrinsics.checkNotNull(obj2, "null cannot be cast to non-null type kotlin.String"); String str = (String) obj2; Object obj3 = list.get(1); Intrinsics.checkNotNull(obj3, "null cannot be cast to non-null type kotlin.String"); try { wrapError = CollectionsKt.listOf(taskEventReporter.getTaskInfo(str, (String) obj3)); } catch (Throwable th) { wrapError = createConnectionError.wrapError(th); } reply.reply(wrapError); } } }