package com.google.android.gms.internal.ads;

import android.content.Context;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import android.widget.FrameLayout;
import androidx.annotation.Nullable;
import com.google.android.gms.dynamic.RemoteCreator$RemoteCreatorException;
import com.google.android.gms.dynamite.descriptors.com.google.android.gms.ads.dynamite.ModuleDescriptor;

/* JADX INFO: loaded from: classes2.dex */
public final class fs extends k8.c {
    @Override // k8.c
    public final /* synthetic */ Object getRemoteCreator(IBinder iBinder) {
        if (iBinder == null) {
            return null;
        }
        IInterface iInterfaceQueryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.ads.internal.formats.client.INativeAdViewDelegateCreator");
        return iInterfaceQueryLocalInterface instanceof zq ? (zq) iInterfaceQueryLocalInterface : new xq(iBinder);
    }

    @Nullable
    public final wq zza(Context context, FrameLayout frameLayout, FrameLayout frameLayout2) {
        try {
            k8.b bVar = new k8.b(context);
            k8.b bVar2 = new k8.b(frameLayout);
            k8.b bVar3 = new k8.b(frameLayout2);
            xq xqVar = (xq) ((zq) getRemoteCreatorInstance(context));
            Parcel parcelO = xqVar.O();
            aj.d(parcelO, bVar);
            aj.d(parcelO, bVar2);
            aj.d(parcelO, bVar3);
            parcelO.writeInt(ModuleDescriptor.MODULE_VERSION);
            Parcel parcelB0 = xqVar.B0(1, parcelO);
            IBinder strongBinder = parcelB0.readStrongBinder();
            parcelB0.recycle();
            if (strongBinder == null) {
                return null;
            }
            IInterface iInterfaceQueryLocalInterface = strongBinder.queryLocalInterface("com.google.android.gms.ads.internal.formats.client.INativeAdViewDelegate");
            return iInterfaceQueryLocalInterface instanceof wq ? (wq) iInterfaceQueryLocalInterface : new uq(strongBinder);
        } catch (RemoteException | RemoteCreator$RemoteCreatorException unused) {
            return null;
        }
    }
}
