package com.google.android.gms.ads.nativead; import android.annotation.TargetApi; import android.content.Context; import android.os.RemoteException; import android.util.AttributeSet; import android.widget.FrameLayout; import android.widget.ImageView; import com.google.android.gms.ads.MediaContent; import com.google.android.gms.ads.RequestConfiguration; import com.google.android.gms.dynamic.ObjectWrapper; import com.google.android.gms.internal.ads.zzbfl; import com.google.android.gms.internal.ads.zzbzr; /* loaded from: classes.dex */ public class MediaView extends FrameLayout { private MediaContent zza; private boolean zzb; private ImageView.ScaleType zzc; private boolean zzd; private zzb zze; private zzc zzf; public MediaView(Context context) { super(context); } public MediaContent getMediaContent() { return this.zza; } public void setImageScaleType(ImageView.ScaleType scaleType) { this.zzd = true; this.zzc = scaleType; zzc zzcVar = this.zzf; if (zzcVar != null) { zzcVar.zza.zzc(scaleType); } } public void setMediaContent(MediaContent mediaContent) { boolean zzr; this.zzb = true; this.zza = mediaContent; zzb zzbVar = this.zze; if (zzbVar != null) { zzbVar.zza.zzb(mediaContent); } if (mediaContent == null) { return; } try { zzbfl zza = mediaContent.zza(); if (zza != null) { if (!mediaContent.hasVideoContent()) { if (mediaContent.zzb()) { zzr = zza.zzr(ObjectWrapper.wrap(this)); } removeAllViews(); } zzr = zza.zzs(ObjectWrapper.wrap(this)); if (zzr) { return; } removeAllViews(); } } catch (RemoteException e10) { removeAllViews(); zzbzr.zzh(RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, e10); } } protected final synchronized void zza(zzb zzbVar) { this.zze = zzbVar; if (this.zzb) { zzbVar.zza.zzb(this.zza); } } protected final synchronized void zzb(zzc zzcVar) { this.zzf = zzcVar; if (this.zzd) { zzcVar.zza.zzc(this.zzc); } } public MediaView(Context context, AttributeSet attributeSet) { super(context, attributeSet); } public MediaView(Context context, AttributeSet attributeSet, int i10) { super(context, attributeSet, i10); } @TargetApi(21) public MediaView(Context context, AttributeSet attributeSet, int i10, int i11) { super(context, attributeSet, i10, i11); } }