Weather Tracker v1.0.0版本的 MD5 值为:3edef27647e42a8ea0e7c0d2dbf56f97

以下内容为反编译后的 f.java 源代码,内容仅作参考


package com.applovin.impl.adview.activity.b;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.PointF;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.StrictMode;
import android.os.SystemClock;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import androidx.annotation.Nullable;
import com.applovin.adview.AppLovinAdView;
import com.applovin.communicator.AppLovinCommunicator;
import com.applovin.communicator.AppLovinCommunicatorMessage;
import com.applovin.communicator.AppLovinCommunicatorSubscriber;
import com.applovin.impl.adview.AppLovinTouchToClickListener;
import com.applovin.impl.adview.AppLovinVideoView;
import com.applovin.impl.adview.h;
import com.applovin.impl.adview.k;
import com.applovin.impl.adview.n;
import com.applovin.impl.adview.u;
import com.applovin.impl.adview.v;
import com.applovin.impl.adview.w;
import com.applovin.impl.adview.x;
import com.applovin.impl.sdk.e.ac;
import com.applovin.impl.sdk.e.r;
import com.applovin.impl.sdk.o;
import com.applovin.impl.sdk.utils.AppLovinSdkExtraParameterKey;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.z;
import com.applovin.impl.sdk.y;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdkUtils;
import com.applovin.sdk.R;
import com.iab.omid.library.applovin.adsession.FriendlyObstructionPurpose;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
public class f extends com.applovin.impl.adview.activity.b.a implements AppLovinCommunicatorSubscriber {
    @Nullable
    protected final n A;
    @Nullable
    protected h B;
    @Nullable
    protected final ImageView C;
    @Nullable
    protected w D;
    @Nullable
    protected final ProgressBar E;
    @Nullable
    protected ProgressBar F;
    @Nullable
    protected ImageView G;
    protected final k H;
    protected final k I;
    protected boolean f916J;
    protected long K;
    protected boolean L;
    private final com.applovin.impl.adview.activity.a.c M;
    private MediaPlayer N;
    private final b O;
    private final a P;
    private final Handler Q;
    private final Handler R;
    private final boolean S;
    private int T;
    private int U;
    private boolean V;
    private final AtomicBoolean W;
    private final AtomicBoolean X;
    private long Y;
    private long Z;
    protected final AppLovinVideoView y;
    protected final com.applovin.impl.adview.a z;

    private class b implements MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener, MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, AppLovinTouchToClickListener.OnClickListener {
        private b() {
        }

        @Override
        public void onClick(View view, PointF pointF) {
            f.this.a(pointF, false);
        }

        @Override
        public void onCompletion(MediaPlayer mediaPlayer) {
            y yVar = f.this.c;
            if (y.a()) {
                f.this.c.b("AppLovinFullscreenActivity", "Video completed");
            }
            f.this.V = true;
            f fVar = f.this;
            if (!fVar.m) {
                fVar.B();
            } else if (fVar.u()) {
                f.this.H();
            }
        }

        @Override
        public boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
            f fVar = f.this;
            fVar.c("Video view error (" + i + "," + i2 + ")");
            f.this.y.start();
            return true;
        }

        @Override
        public boolean onInfo(MediaPlayer mediaPlayer, int i, int i2) {
            y yVar = f.this.c;
            if (y.a()) {
                y yVar2 = f.this.c;
                yVar2.b("AppLovinFullscreenActivity", "MediaPlayer Info: (" + i + ", " + i2 + ")");
            }
            if (i == 701) {
                f.this.y();
                f.this.d.g();
                return false;
            } else if (i != 3) {
                if (i == 702) {
                    f.this.z();
                    return false;
                }
                return false;
            } else {
                f.this.H.a();
                f fVar = f.this;
                if (fVar.A != null) {
                    fVar.E();
                }
                f.this.z();
                if (f.this.w.c()) {
                    f.this.e();
                    return false;
                }
                return false;
            }
        }

        @Override
        public void onPrepared(MediaPlayer mediaPlayer) {
            f.this.N = mediaPlayer;
            mediaPlayer.setOnInfoListener(f.this.O);
            mediaPlayer.setOnErrorListener(f.this.O);
            float f = !f.this.f916J ? 1 : 0;
            mediaPlayer.setVolume(f, f);
            f.this.n = (int) TimeUnit.MILLISECONDS.toSeconds(mediaPlayer.getDuration());
            f.this.c(mediaPlayer.getDuration());
            f.this.v();
            y yVar = f.this.c;
            if (y.a()) {
                f.this.c.b("AppLovinFullscreenActivity", "MediaPlayer prepared: " + f.this.N);
            }
        }
    }

    private class c implements View.OnClickListener {
        private c() {
        }

        @Override
        public void onClick(View view) {
            f fVar = f.this;
            if (view == fVar.A) {
                if (fVar.t()) {
                    f.this.e();
                    f.this.q();
                    f.this.w.b();
                    return;
                }
                f.this.c();
            } else if (view == fVar.C) {
                fVar.A();
            } else {
                y yVar = fVar.c;
                if (y.a()) {
                    y yVar2 = f.this.c;
                    yVar2.e("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
                }
            }
        }
    }

    public f(com.applovin.impl.sdk.ad.e eVar, Activity activity, @Nullable Map<String, Object> map, o oVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
        super(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
        this.M = new com.applovin.impl.adview.activity.a.c(this.a, this.e, this.f907b);
        this.G = null;
        b bVar = new b();
        this.O = bVar;
        a aVar = new a();
        this.P = aVar;
        Handler handler = new Handler(Looper.getMainLooper());
        this.Q = handler;
        Handler handler2 = new Handler(Looper.getMainLooper());
        this.R = handler2;
        k kVar = new k(handler, this.f907b);
        this.H = kVar;
        this.I = new k(handler2, this.f907b);
        boolean f = this.a.f();
        this.S = f;
        this.f916J = com.applovin.impl.sdk.utils.w.c(this.f907b);
        this.U = -1;
        this.W = new AtomicBoolean();
        this.X = new AtomicBoolean();
        this.Y = -2L;
        this.Z = 0L;
        if (eVar.hasVideoUrl()) {
            AppLovinVideoView appLovinVideoView = new AppLovinVideoView(activity);
            this.y = appLovinVideoView;
            appLovinVideoView.setOnPreparedListener(bVar);
            appLovinVideoView.setOnCompletionListener(bVar);
            appLovinVideoView.setOnErrorListener(bVar);
            appLovinVideoView.setOnTouchListener(new AppLovinTouchToClickListener(oVar, com.applovin.impl.sdk.c.b.bb, activity, bVar));
            c cVar = new c();
            if (eVar.r() >= 0) {
                n nVar = new n(eVar.x(), activity);
                this.A = nVar;
                nVar.setVisibility(8);
                nVar.setOnClickListener(cVar);
            } else {
                this.A = null;
            }
            boolean z = true;
            if (a(this.f916J, oVar)) {
                ImageView imageView = new ImageView(activity);
                this.C = imageView;
                imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
                imageView.setClickable(true);
                imageView.setOnClickListener(cVar);
                e(this.f916J);
            } else {
                this.C = null;
            }
            String C = eVar.C();
            if (StringUtils.isValidString(C)) {
                x xVar = new x(oVar);
                xVar.a(new WeakReference<>(aVar));
                w wVar = new w(xVar, activity);
                this.D = wVar;
                wVar.a(C);
            } else {
                this.D = null;
            }
            if (f) {
                com.applovin.impl.adview.a aVar2 = new com.applovin.impl.adview.a(activity, ((Integer) oVar.a(com.applovin.impl.sdk.c.b.cY)).intValue(), 16842874);
                this.z = aVar2;
                aVar2.setColor(Color.parseColor("#75FFFFFF"));
                aVar2.setBackgroundColor(Color.parseColor("#00000000"));
                aVar2.setVisibility(8);
                AppLovinCommunicator.getInstance(activity).subscribe(this, "video_caching_failed");
            } else {
                this.z = null;
            }
            final int m = m();
            z = (!((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cI)).booleanValue() || m <= 0) ? false : false;
            if (this.B == null && z) {
                this.B = new h(activity);
                int I = eVar.I();
                this.B.setTextColor(I);
                this.B.setTextSize(((Integer) oVar.a(com.applovin.impl.sdk.c.b.cH)).intValue());
                this.B.setFinishedStrokeColor(I);
                this.B.setFinishedStrokeWidth(((Integer) oVar.a(com.applovin.impl.sdk.c.b.cG)).intValue());
                this.B.setMax(m);
                this.B.setProgress(m);
                kVar.a("COUNTDOWN_CLOCK", TimeUnit.SECONDS.toMillis(1L), new k.a() {
                    @Override
                    public void a() {
                        f fVar = f.this;
                        if (fVar.B != null) {
                            long seconds = m - TimeUnit.MILLISECONDS.toSeconds(fVar.y.getCurrentPosition());
                            if (seconds <= 0) {
                                f.this.o = true;
                            } else if (f.this.C()) {
                                f.this.B.setProgress((int) seconds);
                            }
                        }
                    }

                    @Override
                    public boolean b() {
                        return f.this.C();
                    }
                });
            }
            if (eVar.R()) {
                final Integer num = (Integer) oVar.a(com.applovin.impl.sdk.c.b.cW);
                ProgressBar progressBar = new ProgressBar(activity, null, 16842872);
                this.E = progressBar;
                a(progressBar, eVar.S(), num.intValue());
                kVar.a("PROGRESS_BAR", ((Long) oVar.a(com.applovin.impl.sdk.c.b.cV)).longValue(), new k.a() {
                    @Override
                    public void a() {
                        f fVar = f.this;
                        if (fVar.L) {
                            fVar.E.setVisibility(8);
                            return;
                        }
                        f.this.E.setProgress((int) ((fVar.y.getCurrentPosition() / ((float) f.this.K)) * num.intValue()));
                    }

                    @Override
                    public boolean b() {
                        return !f.this.L;
                    }
                });
                return;
            }
            this.E = null;
            return;
        }
        throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
    }

    public void E() {
        if (this.X.compareAndSet(false, true)) {
            a(this.A, this.a.r(), new Runnable() {
                @Override
                public void run() {
                    f.this.Y = -1L;
                    f.this.Z = SystemClock.elapsedRealtime();
                }
            });
        }
    }

    private void F() {
        w wVar;
        u D = this.a.D();
        if (D == null || !D.e() || this.L || (wVar = this.D) == null) {
            return;
        }
        final boolean z = wVar.getVisibility() == 4;
        final long f = D.f();
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (z) {
                    com.applovin.impl.sdk.utils.x.a(f.this.D, f, (Runnable) null);
                } else {
                    com.applovin.impl.sdk.utils.x.b(f.this.D, f, null);
                }
            }
        });
    }

    public void G() {
        if (this.L) {
            if (y.a()) {
                this.c.d("AppLovinFullscreenActivity", "Skip video resume - postitial shown");
            }
        } else if (this.f907b.U().isApplicationPaused()) {
            if (y.a()) {
                this.c.d("AppLovinFullscreenActivity", "Skip video resume - app paused");
            }
        } else if (this.U >= 0) {
            if (y.a()) {
                y yVar = this.c;
                yVar.b("AppLovinFullscreenActivity", "Resuming video at position " + this.U + "ms for MediaPlayer: " + this.N);
            }
            this.y.seekTo(this.U);
            this.y.start();
            this.H.a();
            this.U = -1;
            a(new Runnable() {
                @Override
                public void run() {
                    com.applovin.impl.adview.a aVar = f.this.z;
                    if (aVar != null) {
                        aVar.a();
                        f.this.a(new Runnable() {
                            @Override
                            public void run() {
                                f.this.z.b();
                            }
                        }, 2000L);
                    }
                }
            }, 250L);
        } else if (y.a()) {
            this.c.b("AppLovinFullscreenActivity", "Invalid last video position");
        }
    }

    public void H() {
        this.M.a(this.i);
        this.k = SystemClock.elapsedRealtime();
    }

    public void A() {
        MediaPlayer mediaPlayer = this.N;
        if (mediaPlayer == null) {
            return;
        }
        try {
            float f = !this.f916J ? 0 : 1;
            mediaPlayer.setVolume(f, f);
            boolean z = this.f916J ? false : true;
            this.f916J = z;
            e(z);
            a(this.f916J, 0L);
        } catch (Throwable unused) {
        }
    }

    public void B() {
        if (y.a()) {
            this.c.b("AppLovinFullscreenActivity", "Showing postitial...");
        }
        d(this.a.aQ());
        final long W = this.a.W();
        if (W > 0) {
            this.l = 0L;
            final Long l = (Long) this.f907b.a(com.applovin.impl.sdk.c.b.df);
            final Integer num = (Integer) this.f907b.a(com.applovin.impl.sdk.c.b.di);
            ProgressBar progressBar = new ProgressBar(this.e, null, 16842872);
            this.F = progressBar;
            a(progressBar, this.a.V(), num.intValue());
            this.I.a("POSTITIAL_PROGRESS_BAR", l.longValue(), new k.a() {
                @Override
                public void a() {
                    f.this.F.setProgress((int) ((((float) f.this.l) / ((float) W)) * num.intValue()));
                    f.this.l += l.longValue();
                }

                @Override
                public boolean b() {
                    return f.this.l < W;
                }
            });
            this.I.a();
        }
        this.M.a(this.h, this.g, this.f, this.F);
        a("javascript:al_onPoststitialShow(" + this.p + "," + this.q + ");", this.a.X());
        if (this.h != null) {
            if (this.a.t() >= 0) {
                a(this.h, this.a.t(), new Runnable() {
                    @Override
                    public void run() {
                        f.this.k = SystemClock.elapsedRealtime();
                    }
                });
            } else {
                this.h.setVisibility(0);
            }
        }
        ArrayList arrayList = new ArrayList();
        n nVar = this.h;
        if (nVar != null) {
            arrayList.add(new com.applovin.impl.sdk.a.d(nVar, FriendlyObstructionPurpose.CLOSE_AD, "close button"));
        }
        v vVar = this.g;
        if (vVar != null && vVar.b()) {
            v vVar2 = this.g;
            arrayList.add(new com.applovin.impl.sdk.a.d(vVar2, FriendlyObstructionPurpose.NOT_VISIBLE, vVar2.getIdentifier()));
        }
        ProgressBar progressBar2 = this.F;
        if (progressBar2 != null) {
            arrayList.add(new com.applovin.impl.sdk.a.d(progressBar2, FriendlyObstructionPurpose.OTHER, "postitial progress bar"));
        }
        this.a.o().a(this.f, arrayList);
        w();
        this.L = true;
    }

    protected boolean C() {
        return (this.o || this.L || !this.y.isPlaying()) ? false : true;
    }

    public int D() {
        long currentPosition = this.y.getCurrentPosition();
        if (this.V) {
            return 100;
        }
        if (currentPosition > 0) {
            return (int) ((((float) currentPosition) / ((float) this.K)) * 100.0f);
        }
        return this.T;
    }

    @Override
    public String getCommunicatorId() {
        return "FullscreenVideoAdPresenter";
    }

    @Override
    public void h() {
        this.H.b();
        this.I.b();
        this.Q.removeCallbacksAndMessages(null);
        this.R.removeCallbacksAndMessages(null);
        n();
        super.h();
    }

    @Override
    @SuppressLint({"LongLogTag"})
    public void k() {
        if (y.a()) {
            this.c.c("AppLovinFullscreenActivity", "Destroying video components");
        }
        try {
            if (((Boolean) this.f907b.a(com.applovin.impl.sdk.c.b.gH)).booleanValue()) {
                z.a(this.D);
                this.D = null;
            }
            if (this.S) {
                AppLovinCommunicator.getInstance(this.e).unsubscribe(this, "video_caching_failed");
            }
            AppLovinVideoView appLovinVideoView = this.y;
            if (appLovinVideoView != null) {
                appLovinVideoView.pause();
                this.y.stopPlayback();
            }
            MediaPlayer mediaPlayer = this.N;
            if (mediaPlayer != null) {
                mediaPlayer.release();
            }
        } catch (Throwable th) {
            y.c("AppLovinFullscreenActivity", "Unable to destroy presenter", th);
        }
        super.k();
    }

    @Override
    protected void n() {
        super.a(D(), this.S, s(), this.Y);
    }

    @Override
    public void onMessageReceived(AppLovinCommunicatorMessage appLovinCommunicatorMessage) {
        if ("video_caching_failed".equals(appLovinCommunicatorMessage.getTopic())) {
            Bundle messageData = appLovinCommunicatorMessage.getMessageData();
            long j = messageData.getLong("ad_id");
            if (((Boolean) this.f907b.a(com.applovin.impl.sdk.c.b.go)).booleanValue() && j == this.a.getAdIdNumber() && this.S) {
                int i = messageData.getInt("load_response_code");
                String string = messageData.getString("load_exception_message");
                if ((string == null && i >= 200 && i < 300) || this.V || this.y.isPlaying()) {
                    return;
                }
                c("Video cache error during stream. ResponseCode=" + i + ", exception=" + string);
            }
        }
    }

    @Override
    public boolean s() {
        return D() >= this.a.T();
    }

    @Override
    protected boolean t() {
        return u() && !s();
    }

    @Override
    protected void v() {
        long aj;
        long millis;
        if (this.a.ai() >= 0 || this.a.aj() >= 0) {
            if (this.a.ai() >= 0) {
                aj = this.a.ai();
            } else {
                com.applovin.impl.sdk.ad.a aVar = (com.applovin.impl.sdk.ad.a) this.a;
                long j = this.K;
                long j2 = j > 0 ? 0 + j : 0L;
                if (aVar.ak()) {
                    int l = (int) ((com.applovin.impl.sdk.ad.a) this.a).l();
                    if (l > 0) {
                        millis = TimeUnit.SECONDS.toMillis(l);
                    } else {
                        int t = (int) aVar.t();
                        if (t > 0) {
                            millis = TimeUnit.SECONDS.toMillis(t);
                        }
                    }
                    j2 += millis;
                }
                aj = (long) (j2 * (this.a.aj() / 100.0d));
            }
            b(aj);
        }
    }

    @Override
    public void x() {
        super.x();
        this.M.a(this.D);
        this.M.a((View) this.A);
        if (!u() || this.L) {
            H();
        }
    }

    public void y() {
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                com.applovin.impl.adview.a aVar = f.this.z;
                if (aVar != null) {
                    aVar.a();
                }
            }
        });
    }

    public void z() {
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                com.applovin.impl.adview.a aVar = f.this.z;
                if (aVar != null) {
                    aVar.b();
                }
            }
        });
    }

    private class a implements x.a {
        private a() {
        }

        @Override
        public void a(w wVar) {
            y yVar = f.this.c;
            if (y.a()) {
                f.this.c.b("AppLovinFullscreenActivity", "Clicking through from video button...");
            }
            f.this.a(wVar.getAndClearLastClickLocation(), false);
        }

        @Override
        public void b(w wVar) {
            y yVar = f.this.c;
            if (y.a()) {
                f.this.c.b("AppLovinFullscreenActivity", "Closing ad from video button...");
            }
            f.this.h();
        }

        @Override
        public void c(w wVar) {
            y yVar = f.this.c;
            if (y.a()) {
                f.this.c.b("AppLovinFullscreenActivity", "Skipping video from video button...");
            }
            f.this.c();
        }

        @Override
        public void d(w wVar) {
            y yVar = f.this.c;
            if (y.a()) {
                f.this.c.b("AppLovinFullscreenActivity", "Attempting to install app from video button...");
            }
            f.this.a(wVar.getAndClearLastClickLocation(), true);
        }

        @Override
        public void a(Uri uri, w wVar) {
            y yVar = f.this.c;
            if (y.a()) {
                f.this.c.b("AppLovinFullscreenActivity", "Attempting to load a url from video button...");
            }
            com.applovin.impl.sdk.utils.u.a(uri, f.this.f.getController(), f.this.f907b);
        }
    }

    public void c(long j) {
        this.K = j;
    }

    @Override
    public void d() {
        a((ViewGroup) null);
    }

    @Override
    public void e() {
        if (y.a()) {
            this.c.b("AppLovinFullscreenActivity", "Pausing video");
        }
        this.U = this.y.getCurrentPosition();
        this.y.pause();
        this.H.c();
        if (y.a()) {
            y yVar = this.c;
            yVar.b("AppLovinFullscreenActivity", "Paused video at position " + this.U + "ms");
        }
    }

    private void d(boolean z) {
        this.T = D();
        if (z) {
            this.y.pause();
        } else {
            this.y.stopPlayback();
        }
    }

    @Override
    public void b() {
        if (y.a()) {
            this.c.b("AppLovinFullscreenActivity", "Skipping video from prompt");
        }
        c();
    }

    @Override
    public void c(boolean z) {
        super.c(z);
        if (z) {
            a(0L);
            if (this.L) {
                this.I.a();
            }
        } else if (this.L) {
            this.I.c();
        } else {
            e();
        }
    }

    @Override
    public void a(@Nullable ViewGroup viewGroup) {
        String str;
        this.M.a(this.C, this.A, this.D, this.z, this.E, this.B, this.y, this.f, this.g, this.G, viewGroup);
        if (com.applovin.impl.sdk.utils.h.g() && (str = this.f907b.ay().getExtraParameters().get(AppLovinSdkExtraParameterKey.AUDIO_FOCUS_REQUEST)) != null) {
            this.y.setAudioFocusRequest(Integer.parseInt(str));
        }
        StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
        a(!this.S);
        this.y.setVideoURI(this.a.h());
        StrictMode.setThreadPolicy(allowThreadDiskReads);
        if (this.a.ar()) {
            this.w.a(this.a, new Runnable() {
                @Override
                public void run() {
                    f.this.a(250L);
                }
            });
        }
        v vVar = this.g;
        if (vVar != null) {
            vVar.a();
        }
        this.y.start();
        if (this.S) {
            y();
        }
        this.f.renderAd(this.a);
        this.d.b(this.S ? 1L : 0L);
        if (this.A != null) {
            this.f907b.G().a(new ac(this.f907b, "scheduleSkipButton", new Runnable() {
                @Override
                public void run() {
                    f.this.E();
                }
            }), r.b.MAIN, this.a.s(), true);
        }
        super.b(this.f916J);
    }

    private void e(boolean z) {
        if (com.applovin.impl.sdk.utils.h.d()) {
            AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) this.e.getDrawable(z ? R.drawable.applovin_ic_unmute_to_mute : R.drawable.applovin_ic_mute_to_unmute);
            if (animatedVectorDrawable != null) {
                this.C.setScaleType(ImageView.ScaleType.FIT_XY);
                this.C.setImageDrawable(animatedVectorDrawable);
                animatedVectorDrawable.start();
                return;
            }
        }
        Uri aJ = z ? this.a.aJ() : this.a.aK();
        StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
        this.C.setImageURI(aJ);
        StrictMode.setThreadPolicy(allowThreadDiskReads);
    }

    public void c() {
        this.Y = SystemClock.elapsedRealtime() - this.Z;
        if (y.a()) {
            this.c.b("AppLovinFullscreenActivity", "Skipping video with skip time: " + this.Y + "ms");
        }
        this.d.f();
        this.p++;
        if (this.a.y()) {
            h();
        } else {
            B();
        }
    }

    public void c(String str) {
        if (y.a()) {
            y yVar = this.c;
            yVar.e("AppLovinFullscreenActivity", "Encountered media error: " + str + " for ad: " + this.a);
        }
        if (this.W.compareAndSet(false, true)) {
            AppLovinAdDisplayListener appLovinAdDisplayListener = this.u;
            if (appLovinAdDisplayListener instanceof com.applovin.impl.sdk.ad.h) {
                ((com.applovin.impl.sdk.ad.h) appLovinAdDisplayListener).onAdDisplayFailed(str);
            }
            h();
        }
    }

    private void a(ProgressBar progressBar, int i, int i2) {
        progressBar.setMax(i2);
        progressBar.setPadding(0, 0, 0, 0);
        if (com.applovin.impl.sdk.utils.h.d()) {
            progressBar.setProgressTintList(ColorStateList.valueOf(i));
        }
    }

    public void a(PointF pointF, boolean z) {
        if (this.a.E()) {
            if (y.a()) {
                this.c.b("AppLovinFullscreenActivity", "Clicking through video");
            }
            Uri k = this.a.k();
            if (k != null) {
                AppLovinAdView appLovinAdView = this.f;
                this.f907b.v().trackAndLaunchVideoClick(this.a, k, pointF, z, this, appLovinAdView != null ? appLovinAdView.getContext() : o.au());
                com.applovin.impl.sdk.utils.o.a(this.t, this.a);
                this.d.b();
                this.q++;
                return;
            }
            return;
        }
        F();
    }

    @Override
    public void a(long j) {
        a(new Runnable() {
            @Override
            public void run() {
                f.this.G();
            }
        }, j);
    }

    private static boolean a(boolean z, o oVar) {
        if (((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cN)).booleanValue()) {
            if (!((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cO)).booleanValue() || z) {
                return true;
            }
            return ((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cQ)).booleanValue();
        }
        return false;
    }

    @Override
    public void a() {
        if (y.a()) {
            this.c.b("AppLovinFullscreenActivity", "Continue video from prompt - will resume in onWindowFocusChanged(true) when alert dismisses");
        }
    }
}