package com.flurry.android;

import android.app.Activity;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.util.Log;
import com.jumptap.adtag.JtAdInterstitial;
import com.jumptap.adtag.JtAdView;
import com.jumptap.adtag.JtAdWidgetSettings;
import com.jumptap.adtag.JtAdWidgetSettingsFactory;
import com.jumptap.adtag.utils.JtException;

/* JADX INFO: Access modifiers changed from: package-private */
/* loaded from: /storage/emulated/0/Documents/jadec/sources/com.UBI.A90.WW/dex-files/0.dex */
public final class g extends AdNetworkView {
    /* JADX INFO: Access modifiers changed from: package-private */
    public g(Context context, be beVar, bb bbVar, AdCreative adCreative) {
        super(context, beVar, bbVar, adCreative);
        ApplicationInfo applicationInfo = null;
        try {
            applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128);
        } catch (PackageManager.NameNotFoundException e) {
            Log.d("FlurryAgent", "Cannot find manifest for app");
        }
        String string = applicationInfo.metaData.getString("com.flurry.jumptap.PUBLISHER_ID");
        sAdNetworkApiKey = string;
        if (string == null) {
            Log.d("FlurryAgent", "com.flurry.jumptap.PUBLISHER_ID not set in manifest");
        }
        setFocusable(true);
    }

    @Override // com.flurry.android.o
    public final void initLayout(Context context) {
        JtAdInterstitial jtAdInterstitial;
        JtAdView jtAdView = null;
        if (this.fAdCreative.getFormat().equals(AdCreative.kFormatTakeover)) {
            JtAdWidgetSettings createWidgetSettings = JtAdWidgetSettingsFactory.createWidgetSettings();
            createWidgetSettings.setPublisherId(sAdNetworkApiKey);
            createWidgetSettings.setRefreshPeriod(0);
            createWidgetSettings.setShouldSendLocation(false);
            try {
                jtAdInterstitial = new JtAdInterstitial((Activity) context, createWidgetSettings);
            } catch (JtException e) {
                Log.d("FlurryAgent", "Jumptap JtException when creating ad object.");
                jtAdInterstitial = null;
            }
            jtAdInterstitial.setAdViewListener(new ap(this));
            jtAdInterstitial.showAsPopup();
            return;
        }
        JtAdWidgetSettings createWidgetSettings2 = JtAdWidgetSettingsFactory.createWidgetSettings();
        createWidgetSettings2.setPublisherId(sAdNetworkApiKey);
        createWidgetSettings2.setRefreshPeriod(0);
        createWidgetSettings2.setShouldSendLocation(false);
        try {
            jtAdView = new JtAdView((Activity) context, createWidgetSettings2);
        } catch (JtException e2) {
            Log.d("FlurryAgent", "Jumptap JtException when creating ad object.");
        }
        jtAdView.setAdViewListener(new s(this));
        addView(jtAdView);
    }
}
