package E2;

import android.app.Activity;
import android.os.IBinder;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import androidx.compose.runtime.Recomposer;
import java.lang.ref.WeakReference;
import kotlin.jvm.internal.o;

/* JADX INFO: loaded from: classes.dex */
public final class i implements View.OnAttachStateChangeListener {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f1123a = 0;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Object f1124b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final Object f1125c;

    public i(j sidecarCompat, Activity activity) {
        o.h(sidecarCompat, "sidecarCompat");
        this.f1124b = sidecarCompat;
        this.f1125c = new WeakReference(activity);
    }

    @Override // android.view.View.OnAttachStateChangeListener
    public final void onViewAttachedToWindow(View view) {
        Window window;
        WindowManager.LayoutParams attributes;
        switch (this.f1123a) {
            case 0:
                o.h(view, "view");
                view.removeOnAttachStateChangeListener(this);
                Activity activity = (Activity) ((WeakReference) this.f1125c).get();
                IBinder iBinder = (activity == null || (window = activity.getWindow()) == null || (attributes = window.getAttributes()) == null) ? null : attributes.token;
                if (activity != null && iBinder != null) {
                    ((j) this.f1124b).c(iBinder, activity);
                }
                break;
        }
    }

    @Override // android.view.View.OnAttachStateChangeListener
    public final void onViewDetachedFromWindow(View view) {
        switch (this.f1123a) {
            case 0:
                o.h(view, "view");
                break;
            default:
                ((View) this.f1124b).removeOnAttachStateChangeListener(this);
                ((Recomposer) this.f1125c).cancel();
                break;
        }
    }

    public i(View view, Recomposer recomposer) {
        this.f1124b = view;
        this.f1125c = recomposer;
    }

    private final void a(View view) {
    }
}
