package androidx.activity.compose; import androidx.activity.result.ActivityResultCallback; import androidx.activity.result.ActivityResultRegistry; import androidx.activity.result.contract.ActivityResultContract; import androidx.compose.runtime.DisposableEffectResult; import androidx.compose.runtime.DisposableEffectScope; import androidx.compose.runtime.State; import kotlin.Metadata; import kotlin.Unit; import kotlin.jvm.functions.Function1; import kotlin.jvm.internal.Lambda; /* compiled from: ActivityResultRegistry.kt */ @Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0003*\u00020\u0004H\n¢\u0006\u0002\b\u0005"}, d2 = {"", "Landroidx/compose/runtime/DisposableEffectResult;", "I", "O", "Landroidx/compose/runtime/DisposableEffectScope;", "invoke"}, k = 3, mv = {1, 8, 0}, xi = 48) /* loaded from: classes.dex */ final class ActivityResultRegistryKt$rememberLauncherForActivityResult$1 extends Lambda implements Function1 { final /* synthetic */ ActivityResultRegistry $activityResultRegistry; final /* synthetic */ ActivityResultContract $contract; final /* synthetic */ State> $currentOnResult; final /* synthetic */ String $key; final /* synthetic */ ActivityResultLauncherHolder $realLauncher; /* JADX INFO: Access modifiers changed from: package-private */ /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ /* JADX WARN: Multi-variable type inference failed */ public ActivityResultRegistryKt$rememberLauncherForActivityResult$1(ActivityResultLauncherHolder activityResultLauncherHolder, ActivityResultRegistry activityResultRegistry, String str, ActivityResultContract activityResultContract, State> state) { super(1); this.$realLauncher = activityResultLauncherHolder; this.$activityResultRegistry = activityResultRegistry; this.$key = str; this.$contract = activityResultContract; this.$currentOnResult = state; } @Override // kotlin.jvm.functions.Function1 public final DisposableEffectResult invoke(DisposableEffectScope disposableEffectScope) { ActivityResultLauncherHolder activityResultLauncherHolder = this.$realLauncher; ActivityResultRegistry activityResultRegistry = this.$activityResultRegistry; String str = this.$key; Object obj = this.$contract; final State> state = this.$currentOnResult; activityResultLauncherHolder.setLauncher(activityResultRegistry.register(str, obj, new ActivityResultCallback() { // from class: androidx.activity.compose.ActivityResultRegistryKt$rememberLauncherForActivityResult$1$$ExternalSyntheticLambda0 @Override // androidx.activity.result.ActivityResultCallback public final void onActivityResult(Object obj2) { ActivityResultRegistryKt$rememberLauncherForActivityResult$1.invoke$lambda$0(State.this, obj2); } })); final ActivityResultLauncherHolder activityResultLauncherHolder2 = this.$realLauncher; return new DisposableEffectResult() { // from class: androidx.activity.compose.ActivityResultRegistryKt$rememberLauncherForActivityResult$1$invoke$$inlined$onDispose$1 @Override // androidx.compose.runtime.DisposableEffectResult public void dispose() { ActivityResultLauncherHolder.this.unregister(); } }; } /* JADX INFO: Access modifiers changed from: private */ public static final void invoke$lambda$0(State state, Object obj) { ((Function1) state.getValue()).invoke(obj); } }