package p7;

import android.app.Activity;
import android.view.View;
import android.view.ViewTreeObserver;
import android.view.Window;
import com.google.android.gms.internal.ads.g30;
import com.google.android.gms.internal.ads.l30;

/* JADX INFO: loaded from: classes2.dex */
public final class k0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final View f31709a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Activity f31710b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f31711c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public boolean f31712d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public boolean f31713e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final ViewTreeObserver.OnGlobalLayoutListener f31714f;

    public k0(Activity activity, View view, ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener) {
        this.f31710b = activity;
        this.f31709a = view;
        this.f31714f = onGlobalLayoutListener;
    }

    public final void a() {
        View decorView;
        if (this.f31711c) {
            return;
        }
        Activity activity = this.f31710b;
        ViewTreeObserver.OnGlobalLayoutListener onGlobalLayoutListener = this.f31714f;
        if (activity != null) {
            Window window = activity.getWindow();
            ViewTreeObserver viewTreeObserver = (window == null || (decorView = window.getDecorView()) == null) ? null : decorView.getViewTreeObserver();
            if (viewTreeObserver != null) {
                viewTreeObserver.addOnGlobalLayoutListener(onGlobalLayoutListener);
            }
        }
        g30 g30Var = m7.n.C.B;
        l30 l30Var = new l30(this.f31709a, onGlobalLayoutListener);
        ViewTreeObserver viewTreeObserverZze = l30Var.zze();
        if (viewTreeObserverZze != null) {
            l30Var.a(viewTreeObserverZze);
        }
        this.f31711c = true;
    }
}
