Fing.apk(点击下载) / o4.java


package com.overlook.android.fing.ui.internet;

import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.text.TextUtils;
import android.util.Log;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.FragmentActivity;
import com.overlook.android.fing.R;
import com.overlook.android.fing.engine.e.i;
import com.overlook.android.fing.engine.j.a.e.r;
import com.overlook.android.fing.engine.j.d.x;
import com.overlook.android.fing.engine.l.s;
import com.overlook.android.fing.engine.l.u;
import com.overlook.android.fing.engine.l.z;
import com.overlook.android.fing.engine.model.internet.CarrierSubject;
import com.overlook.android.fing.engine.model.internet.IspInfo;
import com.overlook.android.fing.engine.model.internet.IspQuery;
import com.overlook.android.fing.engine.model.internet.IspSubject;
import com.overlook.android.fing.engine.model.internet.RatingSubject;
import com.overlook.android.fing.engine.model.internet.UserRating;
import com.overlook.android.fing.engine.model.net.GeoIpInfo;
import com.overlook.android.fing.engine.model.net.p;
import com.overlook.android.fing.engine.model.speedtest.InternetSpeedTestRecord;
import com.overlook.android.fing.engine.services.netbox.j0;
import com.overlook.android.fing.engine.services.netbox.l0;
import com.overlook.android.fing.engine.services.netbox.m0;
import com.overlook.android.fing.engine.services.netbox.o0;
import com.overlook.android.fing.engine.services.wifi.WiFiConnectionInfo;
import com.overlook.android.fing.ui.base.j;
import com.overlook.android.fing.ui.misc.h;
import com.overlook.android.fing.ui.speedtest.SpeedtestActivity;
import com.overlook.android.fing.vl.components.Header;
import com.overlook.android.fing.vl.components.IconView;
import com.overlook.android.fing.vl.components.MainButton;
import com.overlook.android.fing.vl.components.ScoreIndicator;
import com.overlook.android.fing.vl.components.SectionFooter;
import com.overlook.android.fing.vl.components.SectionHeader;
import com.overlook.android.fing.vl.components.Separator;
import com.overlook.android.fing.vl.components.SummaryReview;
import e.f.a.a.a.r6;
import e.f.a.a.a.s6;
import e.f.a.a.b.h.g;
import e.f.a.a.b.j.k;
import e.f.a.a.b.j.l;
import java.util.EnumSet;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/* compiled from: IspInfoFragment */
public class o4 extends j {
    public static final /* synthetic */ int C0 = 0;
    private ScoreIndicator A0;
    private SummaryReview B0;
    private h c0 = new h(null);
    private h d0 = new h(null);
    private boolean e0;
    private ExecutorService f0;
    private c g0;
    private b h0;
    private b i0;
    private String j0;
    private String k0;
    private String l0;
    private String m0;
    private boolean n0;
    private d o0;
    private WiFiConnectionInfo p0;
    private IspInfo q0;
    private IspQuery r0;
    private InternetSpeedTestRecord s0;
    private s6 t0;
    private SectionHeader u0;
    private SectionFooter v0;
    private MainButton w0;
    private Separator x0;
    private Header y0;
    private IconView z0;

    /* access modifiers changed from: package-private */
    /* compiled from: IspInfoFragment */
    public class a implements s<IspInfo> {

        /* renamed from: a  reason: collision with root package name */
        final /* synthetic */ IspQuery f16831a;

        a(IspQuery ispQuery) {
            this.f16831a = ispQuery;
        }

        @Override // com.overlook.android.fing.engine.l.s
        public void onFailure(Exception exc) {
            o4.this.f2(new f1(this));
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // com.overlook.android.fing.engine.l.s
        public void onSuccess(IspInfo ispInfo) {
            o4.this.f2(new g1(this, ispInfo, this.f16831a));
        }
    }

    /* compiled from: IspInfoFragment */
    public enum b {
        SPEEDTEST,
        COMPARE
    }

    /* compiled from: IspInfoFragment */
    public enum c {
        NETWORK,
        FINGBOX,
        ISP,
        SPEEDTEST
    }

    /* compiled from: IspInfoFragment */
    public interface d {
        void a(o4 o4Var);

        void b(o4 o4Var, UserRating userRating);
    }

    /* access modifiers changed from: private */
    public void C3() {
        WiFiConnectionInfo wiFiConnectionInfo;
        b bVar = b.SPEEDTEST;
        b bVar2 = b.COMPARE;
        Context m02 = m0();
        if (m02 != null && A2()) {
            c cVar = this.g0;
            if (cVar == c.ISP || cVar == c.SPEEDTEST) {
                this.u0.setVisibility(8);
                this.v0.setVisibility(8);
                this.x0.setVisibility(8);
            } else {
                b bVar3 = this.h0;
                if (bVar3 == null) {
                    this.v0.x(8);
                } else if (bVar3 == bVar) {
                    this.v0.v(R.string.generic_test_speed);
                    this.v0.t(new x1(this));
                    this.v0.x(0);
                } else if (bVar3 == bVar2) {
                    this.v0.v(R.string.generic_compare_providers);
                    this.v0.t(new t1(this));
                    this.v0.x(0);
                }
                b bVar4 = this.i0;
                if (bVar4 == null) {
                    this.w0.setVisibility(8);
                } else if (bVar4 == bVar) {
                    this.w0.j(R.drawable.tile_speed);
                    this.w0.k(androidx.core.content.a.b(m02, R.color.accent100));
                    this.w0.n(R.string.generic_test_speed);
                    this.w0.q(e.f.a.a.c.b.b.i() ? 0 : 8);
                    this.w0.setOnClickListener(new p1(this));
                    this.w0.setVisibility(0);
                } else if (bVar4 == bVar2) {
                    this.w0.j(R.drawable.website_24);
                    this.w0.k(androidx.core.content.a.b(m02, R.color.accent100));
                    this.w0.n(R.string.generic_compare_providers);
                    this.w0.q(e.f.a.a.c.b.b.i() ? 0 : 8);
                    this.w0.setOnClickListener(new y1(this));
                    this.w0.setVisibility(0);
                }
                IspInfo ispInfo = this.q0;
                if (ispInfo == null) {
                    this.u0.E(R.string.networkdetail_internetprovider_title);
                    this.u0.C(R.string.isp_info_fetching);
                    this.u0.v(8);
                    this.v0.s(false);
                    this.w0.setEnabled(false);
                } else {
                    this.u0.F(ispInfo.j());
                    if (this.g0 == c.FINGBOX) {
                        this.u0.C(R.string.isp_wifi_data);
                    } else if (this.n0) {
                        this.u0.C(R.string.isp_cellular_data);
                    } else {
                        this.u0.C(R.string.isp_wifi_data);
                    }
                    if (this.q0.a() != null) {
                        this.u0.u(e.e.a.a.a.a.s(128.0f), e.e.a.a.a.a.s(64.0f));
                        this.u0.t(this.q0.a());
                        this.u0.v(0);
                    } else if (this.q0.h() != null) {
                        this.u0.u(e.e.a.a.a.a.s(64.0f), e.e.a.a.a.a.s(64.0f));
                        this.u0.t(this.q0.h());
                        this.u0.v(0);
                    } else {
                        v1 v1Var = new v1(this);
                        if (this.q0.b() != null) {
                            this.u0.u(e.e.a.a.a.a.s(128.0f), e.e.a.a.a.a.s(64.0f));
                            e.f.a.a.b.h.d u = e.f.a.a.b.h.d.u(m02);
                            StringBuilder E = e.a.a.a.a.E("https://cdn.fing.io/images");
                            E.append(this.q0.b());
                            u.r(E.toString());
                            u.s(this.u0.o());
                            u.i(v1Var);
                            u.a();
                        } else if (this.q0.i() != null) {
                            this.u0.u(e.e.a.a.a.a.s(64.0f), e.e.a.a.a.a.s(64.0f));
                            e.f.a.a.b.h.d u2 = e.f.a.a.b.h.d.u(m02);
                            StringBuilder E2 = e.a.a.a.a.E("https://cdn.fing.io/images");
                            E2.append(this.q0.i());
                            u2.r(E2.toString());
                            u2.s(this.u0.o());
                            u2.i(v1Var);
                            u2.a();
                        } else {
                            this.u0.v(8);
                        }
                    }
                    com.overlook.android.fing.engine.j.a.b p2 = p2();
                    p o2 = o2();
                    boolean z = true;
                    boolean z2 = p2 != null || (o2 != null && o2.H == x.d.READY);
                    boolean z3 = (p2 != null && p2.r()) || !(o2 == null || o2.y == null || (wiFiConnectionInfo = this.p0) == null || wiFiConnectionInfo.a() == null || !o2.y.contains(this.p0.a()));
                    b bVar5 = this.h0;
                    if (bVar5 == bVar) {
                        this.v0.s(z2 && z3);
                    } else if (bVar5 == bVar2) {
                        this.v0.s(z2);
                    }
                    b bVar6 = this.i0;
                    if (bVar6 == bVar) {
                        MainButton mainButton = this.w0;
                        if (!z2 || !z3) {
                            z = false;
                        }
                        mainButton.setEnabled(z);
                    } else if (bVar6 == bVar2) {
                        this.w0.setEnabled(z2);
                    }
                }
                this.u0.setVisibility(0);
                this.v0.setVisibility(0);
                this.x0.setVisibility(0);
            }
        }
        D3();
    }

    /* access modifiers changed from: private */
    public void D3() {
        String str;
        String str2;
        String str3;
        InternetSpeedTestRecord internetSpeedTestRecord;
        String d2;
        p y;
        c cVar = c.SPEEDTEST;
        c cVar2 = c.ISP;
        if (A2() && m0() != null) {
            p o2 = o2();
            UserRating R2 = R2();
            boolean z = this.g0 != c.NETWORK || (o2 != null && o2.H == x.d.READY);
            boolean z2 = R2 != null && R2.f() > 0;
            if (z) {
                if (z2) {
                    RatingSubject e2 = R2.e();
                    o0 K = ((m0) t2()).K();
                    String str4 = "https://app.fing.com/images/avatar/avatar-4.png";
                    if (K != null) {
                        str = K.y();
                        String t = K.t();
                        if (t != null) {
                            str4 = t;
                        }
                        if (str4.startsWith("images/")) {
                            str4 = e.a.a.a.a.t("https://app.fing.com/", str4);
                        }
                    } else {
                        str = C0(R.string.reviews_fing_user);
                    }
                    String S2 = S2();
                    String b2 = e.f.a.a.b.j.j.b(R2.f(), k.DATE, l.MEDIUM);
                    if (e2 == null || e2.c() == null) {
                        str3 = (e2 == null || e2.a() == null) ? null : u.b(e2.a().a());
                        str2 = null;
                    } else {
                        c cVar3 = this.g0;
                        if (cVar3 == cVar || cVar3 == cVar2) {
                            p o22 = o2();
                            if (o22 != null && o22.T != null) {
                                str2 = o22.h();
                                str3 = z.b(e2.c().a(), e2.c().e(), e2.c().b());
                            } else if (!(!A2() || (internetSpeedTestRecord = this.s0) == null || internetSpeedTestRecord.k() == null || this.s0.k().e() == null || this.s0.k().e().c() == null || this.s0.k().e().c().d() == null || (y = n2().y(null, d2, null, (d2 = this.s0.k().e().c().d()), EnumSet.complementOf(x.v))) == null)) {
                                str2 = y.h();
                                str3 = z.b(e2.c().a(), e2.c().e(), e2.c().b());
                            }
                        }
                        str2 = null;
                        str3 = z.b(e2.c().a(), e2.c().e(), e2.c().b());
                    }
                    this.y0.C(D0(R.string.minternetspeed_rate_subject_rated, S2));
                    this.y0.x(str2 == null ? null : D0(R.string.minternetspeed_rated_on_network, str2));
                    this.y0.y(str2 == null ? 8 : 0);
                    this.B0.x(str);
                    SummaryReview summaryReview = this.B0;
                    if (str3 != null) {
                        b2 = e.a.a.a.a.v(b2, " • ", str3);
                    }
                    summaryReview.v(b2);
                    this.B0.t(R2.a());
                    this.B0.u(TextUtils.isEmpty(R2.a()) ? 8 : 0);
                    this.B0.w((double) R2.d());
                    e.f.a.a.b.h.d u = e.f.a.a.b.h.d.u(m0());
                    u.r(str4);
                    u.j(R.drawable.avatar_placeholder);
                    u.t(new e.f.a.a.b.h.l());
                    u.s(this.B0.q());
                    u.a();
                    this.A0.setVisibility(8);
                    this.y0.setVisibility(0);
                    this.z0.setVisibility(0);
                    this.B0.setVisibility(0);
                } else {
                    String S22 = S2();
                    if (S22 != null) {
                        this.y0.C(D0(R.string.minternetspeed_rate_subject, S22));
                    } else {
                        this.y0.B(R.string.minternetspeed_rate_provider);
                    }
                    this.B0.setVisibility(8);
                    this.y0.setVisibility(0);
                    this.z0.setVisibility(8);
                    this.A0.setVisibility(0);
                    this.A0.r(0.0d);
                }
                Resources w02 = w0();
                int dimensionPixelSize = w02.getDimensionPixelSize(R.dimen.spacing_small);
                int dimensionPixelSize2 = w02.getDimensionPixelSize(R.dimen.spacing_regular);
                c cVar4 = this.g0;
                if (cVar4 == cVar2 || cVar4 == cVar) {
                    this.y0.setPaddingRelative(dimensionPixelSize, dimensionPixelSize, dimensionPixelSize, dimensionPixelSize);
                    this.x0.setVisibility(8);
                    return;
                }
                this.y0.setPaddingRelative(dimensionPixelSize, dimensionPixelSize2, dimensionPixelSize, dimensionPixelSize);
                this.x0.setVisibility(0);
                return;
            }
            this.x0.setVisibility(8);
            this.y0.setVisibility(8);
            this.B0.setVisibility(8);
            this.A0.setVisibility(8);
        }
    }

    static void M2(o4 o4Var, UserRating userRating) {
        d dVar = o4Var.o0;
        if (dVar != null) {
            dVar.b(o4Var, userRating);
        }
    }

    private UserRating R2() {
        p o2 = o2();
        if (o2 == null || o2.T == null) {
            InternetSpeedTestRecord internetSpeedTestRecord = this.s0;
            if (internetSpeedTestRecord == null || internetSpeedTestRecord.k() == null) {
                return null;
            }
            StringBuilder E = e.a.a.a.a.E("Rating recovered from local record (date=");
            E.append(this.s0.i());
            E.append(")");
            Log.v("fing:isp-info", E.toString());
            return this.s0.k();
        }
        StringBuilder E2 = e.a.a.a.a.E("Rating recovered from discovery state (networkId=");
        E2.append(o2.m);
        E2.append(", syncId=");
        E2.append(o2.i());
        E2.append(", agentId=");
        E2.append(o2.f15878a);
        E2.append(")");
        Log.v("fing:isp-info", E2.toString());
        return o2.T;
    }

    private String S2() {
        GeoIpInfo geoIpInfo;
        IspInfo ispInfo = this.q0;
        if (ispInfo != null && !TextUtils.isEmpty(ispInfo.j())) {
            return this.q0.j();
        }
        if (!TextUtils.isEmpty(this.j0)) {
            return this.j0;
        }
        p o2 = o2();
        if (o2 == null || (geoIpInfo = o2.Q) == null) {
            return null;
        }
        return geoIpInfo.u();
    }

    private RatingSubject T2() {
        String str;
        p o2 = o2();
        RatingSubject ratingSubject = null;
        if (o2 != null) {
            GeoIpInfo geoIpInfo = o2.Q;
            if (geoIpInfo == null) {
                return null;
            }
            IspSubject ispSubject = new IspSubject(geoIpInfo.u(), geoIpInfo.y());
            ispSubject.h(geoIpInfo.B());
            ispSubject.f(geoIpInfo.x());
            RatingSubject ratingSubject2 = new RatingSubject();
            ratingSubject2.e(ispSubject);
            return ratingSubject2;
        }
        String str2 = this.j0;
        if (!(str2 == null || (str = this.k0) == null)) {
            ratingSubject = new RatingSubject();
            if (this.n0) {
                CarrierSubject carrierSubject = new CarrierSubject();
                carrierSubject.d(str2);
                carrierSubject.c(this.k0);
                ratingSubject.d(carrierSubject);
            } else {
                IspSubject ispSubject2 = new IspSubject(str2, str);
                ispSubject2.h(this.l0);
                ispSubject2.f(this.m0);
                ratingSubject.e(ispSubject2);
            }
        }
        return ratingSubject;
    }

    private void V2() {
        if (m0() != null && A2()) {
            com.overlook.android.fing.engine.e.h l2 = l2();
            if (l2.t()) {
                this.p0 = l2.n();
            } else {
                this.p0 = null;
            }
        }
    }

    private void W2() {
        IspQuery ispQuery;
        IspQuery ispQuery2;
        String str;
        if (A2() && m0() != null && !this.c0.f()) {
            p o2 = o2();
            if (o2 != null) {
                GeoIpInfo geoIpInfo = o2.Q;
                if (geoIpInfo != null) {
                    ispQuery = new IspQuery(geoIpInfo.u(), geoIpInfo.y());
                    if (!TextUtils.isEmpty(geoIpInfo.B()) && z.a(geoIpInfo.y())) {
                        ispQuery.l(geoIpInfo.B());
                    }
                    if (!TextUtils.isEmpty(geoIpInfo.x())) {
                        ispQuery.k(geoIpInfo.x());
                    }
                } else {
                    return;
                }
            } else {
                String str2 = this.j0;
                if (str2 != null && (str = this.k0) != null) {
                    IspQuery ispQuery3 = new IspQuery(str2, str);
                    if (!TextUtils.isEmpty(this.l0) && z.a(this.k0)) {
                        ispQuery3.l(this.l0);
                    }
                    if (!TextUtils.isEmpty(this.m0)) {
                        ispQuery3.k(this.m0);
                    }
                    ispQuery = ispQuery3;
                } else {
                    return;
                }
            }
            ispQuery.i(this.n0);
            ispQuery.j(true);
            ispQuery.m(10);
            if (this.q0 == null || (ispQuery2 = this.r0) == null || !ispQuery2.equals(ispQuery)) {
                this.c0.j(2000, true);
                s2().m(ispQuery, new a(ispQuery));
            }
        }
    }

    /* access modifiers changed from: private */
    public void X2() {
        RatingSubject T2;
        com.overlook.android.fing.engine.j.a.b p2 = p2();
        if ((p2 == null || !p2.r()) && (T2 = T2()) != null) {
            this.s0 = ((r6) this.t0).c(T2);
        }
    }

    private void Y2() {
        RatingSubject T2;
        if (A2() && (T2 = T2()) != null) {
            InternetSpeedTestRecord internetSpeedTestRecord = this.s0;
            if (internetSpeedTestRecord == null || internetSpeedTestRecord.k() == null || !T2.equals(this.s0.k().e())) {
                X2();
            }
        }
    }

    private void n3() {
        GeoIpInfo geoIpInfo;
        if (m0() != null && this.q0 != null && k0() != null) {
            Intent intent = new Intent(m0(), IspDetailsActivity.class);
            intent.putExtra("isp-name", this.q0.e());
            intent.putExtra("isp-info", this.q0);
            c cVar = this.g0;
            if (cVar == c.NETWORK || cVar == c.FINGBOX) {
                p o2 = o2();
                if (o2 != null && (geoIpInfo = o2.Q) != null) {
                    intent.putExtra("country-code", geoIpInfo.y());
                    intent.putExtra("current-region", o2.Q.B());
                    intent.putExtra("current-city", o2.Q.x());
                    intent.putExtra("original-region", o2.Q.B());
                    intent.putExtra("original-city", o2.Q.x());
                    intent.putExtra("original-isp", this.q0.e());
                    intent.putExtra("cellular", false);
                    com.overlook.android.fing.engine.j.a.b p2 = p2();
                    if (p2 != null) {
                        intent.putExtra("agentId", p2.c());
                    }
                } else {
                    return;
                }
            } else {
                intent.putExtra("country-code", this.k0);
                intent.putExtra("current-region", this.l0);
                intent.putExtra("current-city", this.m0);
                intent.putExtra("cellular", this.n0);
            }
            j2(intent);
        }
    }

    /* access modifiers changed from: private */
    public void o3() {
        UserRating R2;
        if (m0() != null && (R2 = R2()) != null && this.q0 != null) {
            com.overlook.android.fing.engine.j.a.b p2 = p2();
            if (p2 == null || !p2.r()) {
                e.f.a.a.b.j.j.w("Mobile_Speedtest_Review_Comment");
            } else {
                e.f.a.a.b.j.j.w("Speedtest_Review_Comment");
            }
            String[] strArr = {C0(R.string.minternetspeed_rate_1), C0(R.string.minternetspeed_rate_2), C0(R.string.minternetspeed_rate_3), C0(R.string.minternetspeed_rate_4), C0(R.string.minternetspeed_rate_5)};
            Intent intent = new Intent(m0(), RatingActivity.class);
            intent.putExtra("title", S2());
            intent.putExtra("score", R2.d());
            intent.putExtra("image", "https://cdn.fing.io/images" + this.q0.c());
            intent.putExtra("feelings", strArr);
            intent.putExtra("comment", R2.a());
            k2(intent, 3033, true);
        }
    }

    private void p3() {
        if (m0() != null) {
            Intent intent = new Intent(m0(), SpeedtestActivity.class);
            c cVar = this.g0;
            if (cVar == c.FINGBOX) {
                com.overlook.android.fing.engine.j.a.b p2 = p2();
                if (p2 != null) {
                    intent.putExtra("agentId", p2.c());
                } else {
                    return;
                }
            } else if (cVar == c.NETWORK) {
                p o2 = o2();
                if (o2 != null) {
                    j.F2(intent, o2);
                } else {
                    return;
                }
            }
            j2(intent);
        }
    }

    private void q3(UserRating userRating) {
        if (p2() == null) {
            Y2();
            if (this.s0 != null) {
                StringBuilder E = e.a.a.a.a.E("Saving rating on local record (date=");
                E.append(this.s0.i());
                E.append(")");
                Log.d("fing:isp-info", E.toString());
                this.s0.p(userRating);
                ((r6) this.t0).f(this.s0);
            }
        }
    }

    private void r3(UserRating userRating) {
        p o2;
        if (A2() && (o2 = o2()) != null) {
            if (p2() != null) {
                this.d0.i();
            }
            com.overlook.android.fing.engine.j.d.u o = n2().o(o2);
            if (o != null) {
                StringBuilder E = e.a.a.a.a.E("Saving rating on discovery state (networkId=");
                E.append(o2.m);
                E.append(", syncId=");
                E.append(o2.i());
                E.append(", agentId=");
                E.append(o2.f15878a);
                E.append(")");
                Log.d("fing:isp-info", E.toString());
                o.w(userRating);
                o.c();
            }
        }
    }

    private void s3(UserRating userRating, s<UserRating> sVar) {
        if (A2() && m0() != null) {
            if (this.f0 == null) {
                this.f0 = Executors.newSingleThreadScheduledExecutor();
            }
            if (!this.f0.isShutdown() && !this.f0.isTerminated()) {
                l0 t2 = t2();
                j0 j0Var = new j0("11.1.0");
                m0 m0Var = (m0) t2;
                j0Var.F(m0Var.C());
                j0Var.G(m0Var.v());
                j0Var.E(m0Var.x());
                this.f0.execute(new q1(j0Var, userRating, sVar));
            }
        }
    }

    public void A3() {
        if (!this.e0) {
            this.e0 = true;
            this.X.post(new r1(this));
        }
    }

    /* access modifiers changed from: protected */
    @Override // com.overlook.android.fing.ui.base.j
    public void B2() {
        com.overlook.android.fing.engine.j.a.b p2 = p2();
        p o2 = o2();
        if (p2 != null) {
            super.B2();
        } else if (this.g0 == c.NETWORK) {
            super.B2();
        } else if (o2 != null) {
            super.B2();
        }
    }

    public void B3(String str, String str2) {
        if (A2()) {
            D2(n2().y(null, str, null, str2, EnumSet.complementOf(x.v)));
        }
    }

    @Override // com.overlook.android.fing.ui.base.j, com.overlook.android.fing.engine.j.a.e.q.a
    public void C(com.overlook.android.fing.engine.j.a.b bVar, p pVar) {
        f2(new n1(this, bVar, pVar));
    }

    @Override // androidx.fragment.app.Fragment
    public void Q0(int i2, int i3, Intent intent) {
        if (i2 == 3033 && i3 == -1 && intent != null && m0() != null) {
            com.overlook.android.fing.engine.j.a.b p2 = p2();
            if (p2 == null || !p2.r()) {
                e.f.a.a.b.j.j.w("Mobile_Speedtest_Review_Comment_Edited");
            } else {
                e.f.a.a.b.j.j.w("Speedtest_Review_Comment_Edited");
            }
            int intExtra = intent.getIntExtra("score", 0);
            String stringExtra = intent.getStringExtra("comment-edited");
            if (TextUtils.isEmpty(stringExtra)) {
                stringExtra = intent.getStringExtra("comment");
            }
            UserRating.b bVar = new UserRating.b();
            bVar.n(System.currentTimeMillis());
            bVar.k("overall");
            bVar.l(intExtra);
            bVar.m(T2());
            bVar.i(stringExtra);
            bVar.j(u.c());
            bVar.o(null);
            UserRating h2 = bVar.h();
            q3(h2);
            r3(h2);
            s3(h2, new p4(this, h2));
        }
    }

    @Override // androidx.fragment.app.Fragment
    public boolean U0(MenuItem menuItem) {
        RatingSubject T2;
        if (F0()) {
            int itemId = menuItem.getItemId();
            if (itemId == R.id.clear) {
                if (!(m0() == null || (T2 = T2()) == null)) {
                    com.overlook.android.fing.engine.j.a.b p2 = p2();
                    if (p2 == null || !p2.r()) {
                        e.f.a.a.b.j.j.w("Mobile_Speedtest_Review_Cleared");
                    } else {
                        e.f.a.a.b.j.j.w("Speedtest_Review_Cleared");
                    }
                    UserRating.b bVar = new UserRating.b();
                    bVar.n(0);
                    bVar.k("overall");
                    bVar.m(T2);
                    bVar.l(0);
                    UserRating h2 = bVar.h();
                    q3(h2);
                    r3(h2);
                    d dVar = this.o0;
                    if (dVar != null) {
                        dVar.b(this, h2);
                    }
                    D3();
                }
                return true;
            } else if (itemId == R.id.edit) {
                o3();
                return true;
            }
        }
        return false;
    }

    public boolean U2() {
        UserRating R2 = R2();
        return (R2 == null || R2.f() == 0) ? false : true;
    }

    @Override // com.overlook.android.fing.ui.base.j, androidx.fragment.app.Fragment
    public View Z0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        c cVar = c.NETWORK;
        super.Z0(layoutInflater, viewGroup, bundle);
        View inflate = layoutInflater.inflate(R.layout.fragment_isp_info, viewGroup, false);
        if (bundle == null) {
            bundle = k0();
        }
        if (bundle != null) {
            c cVar2 = (c) bundle.getSerializable("configuration");
            this.g0 = cVar2;
            if (cVar2 == null) {
                this.g0 = cVar;
            }
            this.h0 = (b) bundle.getSerializable("action_1");
            this.i0 = (b) bundle.getSerializable("action_2");
            this.j0 = bundle.getString("isp_name");
            this.k0 = bundle.getString("country_code");
            this.l0 = bundle.getString("country_region");
            this.m0 = bundle.getString("country_city");
            this.n0 = bundle.getBoolean("cellular");
        }
        if (m0() != null) {
            this.t0 = new r6(m0());
        }
        if (m0() != null) {
            Resources w02 = w0();
            SectionHeader sectionHeader = (SectionHeader) inflate.findViewById(R.id.isp_header);
            this.u0 = sectionHeader;
            sectionHeader.G(0, (float) w02.getDimensionPixelSize(this.g0 == cVar ? R.dimen.font_title : R.dimen.font_h1));
            this.v0 = (SectionFooter) inflate.findViewById(R.id.isp_footer);
            this.w0 = (MainButton) inflate.findViewById(R.id.isp_secondary_button);
            this.x0 = (Separator) inflate.findViewById(R.id.separator);
            this.B0 = (SummaryReview) inflate.findViewById(R.id.rating_review);
            ScoreIndicator scoreIndicator = (ScoreIndicator) inflate.findViewById(R.id.rating_editor);
            this.A0 = scoreIndicator;
            scoreIndicator.q(new s1(this));
            this.z0 = (IconView) inflate.findViewById(R.id.rating_header_more);
            Header header = (Header) inflate.findViewById(R.id.rating_header);
            this.y0 = header;
            header.setOnClickListener(new e1(this));
            this.z0.setOnClickListener(w1.f16895a);
            this.z0.setOnCreateContextMenuListener(this);
        }
        w2();
        V2();
        W2();
        Y2();
        C3();
        return inflate;
    }

    public /* synthetic */ void Z2(String str) {
        com.overlook.android.fing.engine.j.a.b p2 = p2();
        if (p2 != null && p2.m() && p2.t(str) && this.d0.f()) {
            this.d0.k();
            i2(R.string.generic_network_update_failed, new Object[0]);
        }
    }

    @Override // com.overlook.android.fing.ui.base.j, com.overlook.android.fing.ui.base.ServiceActivity.a
    public void a(boolean z) {
        c cVar = this.g0;
        if (cVar != c.NETWORK && cVar != c.FINGBOX) {
            w2();
            V2();
            W2();
            Y2();
            C3();
        }
    }

    @Override // androidx.fragment.app.Fragment
    public void a1() {
        super.a1();
        ExecutorService executorService = this.f0;
        if (executorService != null) {
            executorService.shutdown();
        }
        this.f0 = null;
    }

    public /* synthetic */ void a3(String str, p pVar) {
        com.overlook.android.fing.engine.j.a.b p2 = p2();
        if (p2 != null && p2.m() && p2.t(str)) {
            D2(pVar);
            if (this.d0.f()) {
                this.d0.k();
            }
            W2();
            Y2();
            C3();
        }
    }

    public /* synthetic */ void b3(com.overlook.android.fing.engine.j.a.b bVar) {
        com.overlook.android.fing.engine.j.a.b p2 = p2();
        if (p2 != null && p2.equals(bVar) && this.d0.f()) {
            this.d0.k();
            i2(R.string.generic_network_update_failed, new Object[0]);
        }
    }

    public /* synthetic */ void c3(com.overlook.android.fing.engine.j.a.b bVar, p pVar) {
        com.overlook.android.fing.engine.j.a.b p2 = p2();
        if (p2 != null && p2.equals(bVar)) {
            D2(pVar);
            if (this.d0.f()) {
                this.d0.k();
            }
            W2();
            Y2();
            C3();
        }
    }

    public void d3(View view, double d2) {
        RatingSubject T2;
        int i2 = (int) d2;
        if (m0() != null && (T2 = T2()) != null) {
            com.overlook.android.fing.engine.j.a.b p2 = p2();
            if (p2 == null || !p2.r()) {
                e.f.a.a.b.j.j.w("Mobile_Speedtest_Review");
            } else {
                e.f.a.a.b.j.j.w("Speedtest_Review");
            }
            UserRating R2 = R2();
            UserRating.b bVar = new UserRating.b();
            bVar.n(System.currentTimeMillis());
            bVar.k("overall");
            bVar.l(i2);
            bVar.m(T2);
            bVar.i(R2 != null ? R2.a() : null);
            bVar.j(u.c());
            bVar.o(null);
            UserRating h2 = bVar.h();
            q3(h2);
            r3(h2);
            s3(h2, new q4(this, h2));
        }
    }

    @Override // com.overlook.android.fing.ui.base.j, com.overlook.android.fing.engine.e.h.b
    public void e(i iVar) {
        f2(new k1(this));
    }

    @Override // com.overlook.android.fing.ui.base.j, com.overlook.android.fing.engine.j.a.e.q.a
    public void e0(com.overlook.android.fing.engine.j.a.b bVar, Throwable th) {
        f2(new o1(this, bVar));
    }

    public /* synthetic */ void e3(View view) {
        this.z0.performClick();
    }

    public /* synthetic */ void f3(p pVar) {
        p o2;
        if (p2() == null && (o2 = o2()) != null && o2.m(pVar)) {
            D2(pVar);
            W2();
            Y2();
            C3();
        }
    }

    @Override // com.overlook.android.fing.ui.base.j, com.overlook.android.fing.engine.services.agent.desktop.l.a
    public void g(String str, p pVar) {
        f2(new l1(this, str, pVar));
    }

    public /* synthetic */ void g3() {
        V2();
        C3();
    }

    @Override // com.overlook.android.fing.ui.base.j, com.overlook.android.fing.engine.j.d.x.f
    public void h(x.a aVar, p pVar, x.b bVar) {
        f2(new m1(this, pVar));
    }

    public /* synthetic */ void h3() {
        this.e0 = false;
        W2();
        Y2();
        C3();
    }

    @Override // com.overlook.android.fing.ui.base.j, com.overlook.android.fing.engine.services.agent.desktop.l.a
    public void i0(String str, Throwable th) {
        f2(new u1(this, str));
    }

    public /* synthetic */ void i3(View view) {
        p3();
    }

    public /* synthetic */ void j3(View view) {
        n3();
    }

    public /* synthetic */ void k3(View view) {
        p3();
    }

    public /* synthetic */ void l3(View view) {
        n3();
    }

    public /* synthetic */ void m3(Bitmap bitmap, g gVar, boolean z) {
        this.u0.v(bitmap != null ? 0 : 8);
    }

    @Override // androidx.fragment.app.Fragment
    public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
        FragmentActivity h02;
        UserRating R2;
        super.onCreateContextMenu(contextMenu, view, contextMenuInfo);
        if (view == this.z0 && (h02 = h0()) != null && (R2 = R2()) != null) {
            h02.getMenuInflater().inflate(R.menu.rating_edit_menu, contextMenu);
            MenuItem findItem = contextMenu.findItem(R.id.edit);
            MenuItem findItem2 = contextMenu.findItem(R.id.clear);
            e.e.a.a.a.a.g0(h02, TextUtils.isEmpty(R2.a()) ^ true ? R.string.generic_editreview : R.string.generic_writereview, findItem);
            e.e.a.a.a.a.g0(h02, R.string.generic_clear, findItem2);
        }
    }

    @Override // androidx.fragment.app.Fragment
    public void p1() {
        super.p1();
        c cVar = this.g0;
        if (cVar == c.NETWORK || cVar == c.FINGBOX) {
            B2();
            V2();
            W2();
            Y2();
            C3();
        }
    }

    @Override // com.overlook.android.fing.ui.base.j, androidx.fragment.app.Fragment
    public void q1(Bundle bundle) {
        bundle.putSerializable("configuration", this.g0);
        bundle.putSerializable("action_1", this.h0);
        bundle.putSerializable("action_2", this.i0);
        bundle.putString("isp_name", this.j0);
        bundle.putString("country_code", this.k0);
        bundle.putString("country_region", this.l0);
        bundle.putString("country_city", this.m0);
        bundle.putBoolean("cellular", this.n0);
        super.q1(bundle);
    }

    @Override // androidx.fragment.app.Fragment
    public void t1(View view, Bundle bundle) {
        d dVar = this.o0;
        if (dVar != null) {
            dVar.a(this);
        }
    }

    public void t3(String str) {
        if (A2()) {
            E2(((r) r2()).r(str));
        }
    }

    public void u3(boolean z) {
        this.n0 = z;
    }

    public void v3(String str) {
        this.m0 = str;
    }

    public void w3(String str) {
        this.k0 = str;
    }

    public void x3(String str) {
        this.l0 = str;
    }

    public void y3(String str) {
        this.j0 = str;
    }

    public void z3(d dVar) {
        this.o0 = dVar;
    }
}