QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685

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


package com.tencent.mtt.external.setting;

import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.tencent.common.featuretoggle.FeatureToggle;
import com.tencent.common.manifest.EventEmiter;
import com.tencent.common.manifest.EventMessage;
import com.tencent.common.manifest.annotation.CreateMethod;
import com.tencent.common.manifest.annotation.EventReceiver;
import com.tencent.common.threadpool.BrowserExecutorSupplier;
import com.tencent.common.utils.bitmap.BitmapUtils;
import com.tencent.mtt.ContextHolder;
import com.tencent.mtt.R;
import com.tencent.mtt.animation.QBViewPropertyAnimator;
import com.tencent.mtt.base.notification.facade.INotify;
import com.tencent.mtt.base.skin.MttResources;
import com.tencent.mtt.base.stat.StatManager;
import com.tencent.mtt.base.stat.facade.IUserActionStatServer;
import com.tencent.mtt.base.utils.permission.PermissionUtils;
import com.tencent.mtt.browser.homepage.appdata.facade.AppIconLoadListener;
import com.tencent.mtt.browser.homepage.appdata.facade.AppItem;
import com.tencent.mtt.browser.homepage.appdata.facade.IAppDataService;
import com.tencent.mtt.browser.notification.facade.INotificationService;
import com.tencent.mtt.browser.push.facade.IPushNotificationDialogService;
import com.tencent.mtt.browser.push.facade.IPushTokenSerivce;
import com.tencent.mtt.browser.push.facade.PushAuthorizeApp;
import com.tencent.mtt.external.setting.facade.SettingView;
import com.tencent.mtt.external.setting.util.QBAppLockReportUtils;
import com.tencent.mtt.newskin.SimpleSkinBuilder;
import com.tencent.mtt.qbcontext.core.QBContext;
import com.tencent.mtt.qbinfo.ChannelConfigManager;
import com.tencent.mtt.setting.MultiProcessPublicSettingManager;
import com.tencent.mtt.setting.MultiProcessSettingManager;
import com.tencent.mtt.setting.PublicSettingManager;
import com.tencent.mtt.view.dialog.newui.SimpleDialogBuilder;
import com.tencent.mtt.view.dialog.newui.builder.api.base.IDialogBuilder;
import com.tencent.mtt.view.dialog.newui.dialog.DialogBase;
import com.tencent.mtt.view.dialog.newui.view.ViewOnClickListener;
import com.tencent.mtt.view.setting.SettingItem;
import com.tencent.mtt.view.setting.SettingResCache;
import com.tencent.mtt.view.widget.QBSwitch;
import com.tencent.qqlive.module.videoreport.collect.EventCollector;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import qb.a.f;
import qb.qbcontext.BuildConfig;

public final class PushOverAllSettingView extends SettingView implements View.OnClickListener {
    private SettingItem E;
    private PushAuthorizeApp F;
    private Handler G;

    int f59532a;

    int f59533b;

    ArrayList<AppItem> f59534d;
    boolean e;
    boolean f;
    private int l;
    private IPushTokenSerivce m;
    private LinearLayout n;
    private LinearLayout o;
    private SettingItem p;
    private TextView q;
    private TextView r;
    private SettingResCache s;
    private SettingItem t;
    private SettingItem u;
    private SettingItem v;
    private SettingItem w;
    private static final String g = MttResources.l(R.string.bhj);
    private static final String h = MttResources.l(R.string.bhi);
    private static final String i = MttResources.l(R.string.bhd);
    private static final String j = MttResources.l(R.string.bhc);
    private static final String k = MttResources.l(R.string.bhh);

    static Bitmap f59531c = null;

    public class AcceptAllSwitchListener implements QBSwitch.OnSwitchListener {
        private AcceptAllSwitchListener() {
        }

        @Override
        public void a(View view, boolean z) {
            String str;
            PushOverAllSettingView.this.c(z);
            if (z) {
                StatManager.b().c("EIC1401_1");
                str = "1";
            } else {
                StatManager.b().c("EIC1401_0");
                PushOverAllSettingView.this.t();
                str = "0";
            }
            QBAppLockReportUtils.a(138, str);
        }
    }

    private static class PushAppIdReportBean {

        private String f59553a;

        private String f59554b;

        public PushAppIdReportBean(String str, String str2) {
            this.f59553a = str;
            this.f59554b = str2;
        }

        public String a() {
            return this.f59553a;
        }

        public String b() {
            return this.f59554b;
        }
    }

    public class PushSettingDetailItem extends SettingItem implements AppIconLoadListener, QBSwitch.OnSwitchListener {

        int f59555a;

        public ImageView f59556b;

        public PushSettingDetailItem(Context context, int i) {
            super(context, i, PushOverAllSettingView.this.s);
            this.f59555a = -1;
            this.f59556b = new ImageView(getContext());
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
            layoutParams.gravity = 16;
            layoutParams.leftMargin = MttResources.s(24);
            this.f59556b.setLayoutParams(layoutParams);
            addView(this.f59556b, 0);
            this.f59556b.setVisibility(8);
            a(true, (QBSwitch.OnSwitchListener) this);
        }

        @Override
        public void a(View view, boolean z) {
            StatManager b2;
            String b3;
            int i = this.f59555a;
            if (i == 111) {
                MultiProcessSettingManager.a().setBoolean("push_111", z);
                ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).setNotificationEnabled(111, z);
            } else if (i == 10001) {
                PublicSettingManager.a().setBoolean("KEY_PUSH_LOCK_SCREEN_FEEDS_FEATURE", z);
            } else {
                ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).setNotificationEnabled(this.f59555a, z);
            }
            HashMap hashMap = new HashMap();
            hashMap.put(111, new PushAppIdReportBean("EIC1403_1", "EIC1403_0"));
            hashMap.put(170902, new PushAppIdReportBean("EIC1404_1", "EIC1404_0"));
            hashMap.put(11028, new PushAppIdReportBean("EIC1405_1", "EIC1405_0"));
            hashMap.put(281, new PushAppIdReportBean("EIC1406_1", "EIC1406_0"));
            hashMap.put(284, new PushAppIdReportBean("EIC1407_1", "EIC1407_0"));
            hashMap.put(10001, new PushAppIdReportBean("EIC1408_1", "EIC1408_0"));
            PushAppIdReportBean pushAppIdReportBean = (PushAppIdReportBean) hashMap.get(Integer.valueOf(this.f59555a));
            if (pushAppIdReportBean == null) {
                return;
            }
            if (z) {
                b2 = StatManager.b();
                b3 = pushAppIdReportBean.a();
            } else {
                b2 = StatManager.b();
                b3 = pushAppIdReportBean.b();
            }
            b2.c(b3);
        }

        @Override
        public void a(AppItem appItem) {
        }

        void a(AppItem appItem, Bitmap bitmap) {
            Bitmap a2;
            int i = this.f59555a;
            if (i == 99) {
                if (bitmap != null) {
                    this.f59556b.setImageBitmap(bitmap);
                    return;
                }
                return;
            }
            if (i == 111) {
                if (PushOverAllSettingView.f59531c != null) {
                    this.f59556b.setImageBitmap(PushOverAllSettingView.f59531c);
                    return;
                }
                return;
            }
            if (bitmap == null || bitmap.isRecycled()) {
                if (appItem != null) {
                    ((IAppDataService) QBContext.getInstance().getService(IAppDataService.class)).getAppInfoLoader().a(appItem, this);
                }
                Bitmap p = MttResources.p(R.drawable.b0m);
                if (p == null || p.isRecycled() || (a2 = BitmapUtils.a(p, PushOverAllSettingView.this.f59532a, PushOverAllSettingView.this.f59533b, 0)) == null || a2.isRecycled()) {
                    return;
                }
            } else {
                a2 = BitmapUtils.a(bitmap, PushOverAllSettingView.this.f59532a, PushOverAllSettingView.this.f59533b, 0);
                if (a2 == null || a2.isRecycled()) {
                    return;
                }
            }
            this.f59556b.setImageBitmap(a2);
        }

        @Override
        public void a(AppItem appItem, final Bitmap bitmap, int i) {
            if (bitmap == null || bitmap.isRecycled() || this.f59555a != i) {
                return;
            }
            new Handler(Looper.getMainLooper()).post(new Runnable() {
                @Override
                public void run() {
                    PushSettingDetailItem.this.f59556b.setImageBitmap(BitmapUtils.a(bitmap, PushOverAllSettingView.this.f59532a, PushOverAllSettingView.this.f59533b, 0));
                }
            });
        }

        void a(PushAuthorizeApp pushAuthorizeApp) {
            setSwitchChecked(false);
            if (this.f59555a == 111) {
                setSwitchChecked(MultiProcessSettingManager.a().getBoolean("push_111", true));
                return;
            }
            if (pushAuthorizeApp == null) {
                pushAuthorizeApp = ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).getAppById(this.f59555a);
            }
            if (pushAuthorizeApp == null) {
                return;
            }
            if (pushAuthorizeApp.hasNotificationSwitch()) {
                setSwitchChecked(pushAuthorizeApp.isNotifcationOn());
            }
            pushAuthorizeApp.hasBubbleSwitch();
        }

        public void a(PushAuthorizeApp pushAuthorizeApp, AppItem appItem, Bitmap bitmap, boolean z) {
            this.f59555a = appItem.a();
            setMainText(appItem.f39373d);
            a(appItem, bitmap);
            SimpleSkinBuilder.a(this.f59556b).f();
            a(pushAuthorizeApp);
        }

        @Override
        public void b(AppItem appItem) {
        }
    }

    public static class SwitchItem implements Serializable {
        private static final long serialVersionUID = 1700465138483958595L;
        public int mAppID;
        public boolean mSwitchOn;

        public SwitchItem(int i, boolean z) {
            this.mAppID = i;
            this.mSwitchOn = z;
        }

        public String toString() {
            return "{appID:" + this.mAppID + " switch:" + this.mSwitchOn + " }";
        }
    }

    public PushOverAllSettingView(Context context) {
        super(context);
        this.l = 18;
        this.f59532a = MttResources.h(R.dimen.a3d);
        this.f59533b = MttResources.h(R.dimen.a3c);
        this.f = true;
        this.G = null;
        this.G = new Handler(Looper.getMainLooper()) {
            @Override
            public void handleMessage(Message message) {
                if (message.what == 100 && PushOverAllSettingView.this.o != null) {
                    PushOverAllSettingView.this.o.setVisibility(message.arg1);
                }
                super.handleMessage(message);
            }
        };
        this.s = SettingResCache.a();
        this.f59534d = new ArrayList<>();
        this.m = (IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class);
        this.e = MultiProcessSettingManager.a().getBoolean("push_global", true);
        e();
    }

    private void a(final View view, long j2) {
        if (view != null) {
            try {
                QBViewPropertyAnimator.a(view).j(0.0f).a(j2).a(new Runnable() {
                    @Override
                    public void run() {
                        view.setVisibility(8);
                    }
                }).b();
            } catch (Exception unused) {
                view.setVisibility(8);
            }
        }
    }

    public void a(PushAuthorizeApp pushAuthorizeApp) {
        if (this.t == null) {
            boolean z = pushAuthorizeApp != null && pushAuthorizeApp.hasNotificationSwitch() && pushAuthorizeApp.isNotifcationOn();
            this.t = new SettingItem(getContext(), 103, this.s);
            this.t.setMainText(MttResources.l(R.string.bhk));
            this.t.a(true, new QBSwitch.OnSwitchListener() {
                @Override
                public void a(View view, boolean z2) {
                    ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).setNotificationEnabled(131, z2);
                    StatManager.b().c(z2 ? "EIC1409_1" : "EIC1409_0");
                }
            });
            this.t.setSwitchChecked(z);
            AppItem appItem = new AppItem();
            appItem.a(131);
            appItem.f39373d = MttResources.l(R.string.bhk);
            this.f59534d.add(appItem);
            this.t.setId(this.l);
            this.l++;
            this.t.setOnClickListener(this);
            this.n.addView(this.t, 1);
        }
        f();
    }

    private void a(boolean z) {
        Iterator<AppItem> it = this.f59534d.iterator();
        while (it.hasNext()) {
            AppItem next = it.next();
            if (next.f39371b != 99) {
                if (next.f39371b == 111) {
                    MultiProcessSettingManager.a().setBoolean("push_111", z);
                    ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).setNotificationEnabled(111, z);
                } else if (next.f39371b == 10001) {
                    PublicSettingManager.a().setBoolean("KEY_PUSH_LOCK_SCREEN_FEEDS_FEATURE", z);
                } else {
                    ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).setNotificationEnabled(next.f39371b, z);
                }
            }
        }
    }

    private void b(View view, long j2) {
        if (view == null) {
            return;
        }
        view.setVisibility(0);
        a(view, (int) j2);
    }

    public void b(ArrayList<AppItem> arrayList, ArrayList<PushAuthorizeApp> arrayList2, ArrayList<Bitmap> arrayList3) {
        int i2;
        PushAuthorizeApp pushAuthorizeApp;
        Iterator<AppItem> it = arrayList.iterator();
        while (it.hasNext()) {
            AppItem next = it.next();
            PushAuthorizeApp appById = ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).getAppById(next.f39371b);
            if (appById != null) {
                arrayList2.add(appById);
                if (appById.mAppId != 111) {
                    if (appById.mAppId == 281) {
                        if (TextUtils.isEmpty(appById.mAppName)) {
                            i2 = R.string.be5;
                            appById.mAppName = MttResources.l(i2);
                        }
                    } else if (appById.mAppId == 170902) {
                        if (TextUtils.isEmpty(appById.mAppName)) {
                            i2 = R.string.bf_;
                            appById.mAppName = MttResources.l(i2);
                        }
                    } else if (next.f39371b == 284) {
                        i2 = R.string.beo;
                        appById.mAppName = MttResources.l(i2);
                    }
                }
                arrayList3.add(null);
            } else {
                if (next.f39371b == 111) {
                    pushAuthorizeApp = new PushAuthorizeApp();
                    pushAuthorizeApp.mAppId = 99;
                    pushAuthorizeApp.mAppName = j;
                } else if (next.f39371b == 10001) {
                    pushAuthorizeApp = new PushAuthorizeApp();
                    pushAuthorizeApp.mAppId = 10001;
                    pushAuthorizeApp.mAppName = k;
                    pushAuthorizeApp.setNotificationState(PublicSettingManager.a().getBoolean("KEY_PUSH_LOCK_SCREEN_FEEDS_FEATURE", true));
                    pushAuthorizeApp.mMask = pushAuthorizeApp.mOnOff;
                }
                arrayList3.add(null);
                arrayList2.add(pushAuthorizeApp);
            }
        }
    }

    public void b(boolean z) {
        PublicSettingManager a2;
        int i2;
        if (z) {
            StatManager.b().c("EIC1410_1");
            a2 = PublicSettingManager.a();
            i2 = 1;
        } else {
            StatManager.b().c("EIC1410_0");
            a2 = PublicSettingManager.a();
            i2 = 0;
        }
        a2.setInt("key_setting_inner_push_switch", i2);
    }

    public void c(boolean z) {
        try {
            if (z) {
                ((IUserActionStatServer) QBContext.getInstance().getService(IUserActionStatServer.class)).addUserAction(366);
            } else {
                ((IUserActionStatServer) QBContext.getInstance().getService(IUserActionStatServer.class)).addUserAction(367);
            }
            MultiProcessSettingManager.a().setBoolean("push_global", z);
            this.e = z;
            if (z) {
                b(this.r, 200L);
                b(this.u, 200L);
                b(this.o, 200L);
                b(this.t, 200L);
                a((View) this.q, 200L);
                a(true);
                for (int i2 = 0; i2 < this.o.getChildCount(); i2++) {
                    View childAt = this.o.getChildAt(i2);
                    if (childAt instanceof SettingItem) {
                        ((SettingItem) childAt).setSwitchChecked(true);
                    }
                }
                Message obtainMessage = this.G.obtainMessage(100);
                obtainMessage.arg1 = 0;
                this.G.removeMessages(100);
                this.G.sendMessageDelayed(obtainMessage, 200L);
            } else {
                a((View) this.r, 200L);
                a((View) this.u, 200L);
                a((View) this.o, 200L);
                a((View) this.t, 200L);
                b(this.q, 200L);
                a(false);
                Message obtainMessage2 = this.G.obtainMessage(100);
                obtainMessage2.arg1 = 8;
                this.G.removeMessages(100);
                this.G.sendMessageDelayed(obtainMessage2, 200L);
            }
            ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).setNotificationEnabled(1, z);
        } catch (Exception unused) {
        }
    }

    public static void h() {
        if (!MultiProcessSettingManager.a().getBoolean("push_global", true)) {
            MultiProcessSettingManager.a().setBoolean("push_global", true);
            ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).setNotificationEnabled(1, true);
        }
        PublicSettingManager.a().setBoolean("key_junk_enable_notify", true);
        MultiProcessSettingManager.a().setBoolean("push_111", true);
    }

    private void l() {
        if (this.n == null) {
            this.n = c(0);
        }
        if (this.p == null) {
            this.p = new SettingItem(getContext(), 103, this.s);
            this.p.setMainText(g);
            this.p.setId(2147483637);
            this.p.setOnClickListener(this);
            this.p.a(true, (QBSwitch.OnSwitchListener) new AcceptAllSwitchListener());
            this.p.setSwitchChecked(this.e);
            this.n.addView(this.p);
        }
        if (this.n.getParent() == null) {
            addView(this.n);
        }
        if (this.q == null) {
            this.q = new TextView(getContext());
            SimpleSkinBuilder.a(this.q).g(R.color.a2_).f();
            this.q.setTextSize(1, MttResources.r(MttResources.h(f.cD)));
            this.q.setText(h);
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -2);
            this.q.setLayoutParams(layoutParams);
            layoutParams.setMargins(this.s.g, MttResources.h(R.dimen.a3q), 0, 0);
            this.q.setGravity(3);
            addView(this.q, 1);
        }
    }

    public void p() {
        if (this.f) {
            this.f = false;
            if (PermissionUtils.a(getContext())) {
                return;
            }
            ((IPushNotificationDialogService) QBContext.getInstance().getService(IPushNotificationDialogService.class)).showQBNotificationGuideDlg(getContext(), new IPushNotificationDialogService.PushGuideListener() {
                @Override
                public void a() {
                    if (PushOverAllSettingView.this.e) {
                        return;
                    }
                    PushOverAllSettingView.this.p.setSwitchChecked(true);
                    PushOverAllSettingView.this.c(true);
                }

                @Override
                public void b() {
                }

                @Override
                public void c() {
                }

                @Override
                public void d() {
                }
            });
        }
    }

    public void q() {
        if (!FeatureToggle.a(BuildConfig.FEATURE_TOGGLE_CLOSE_RES_NOTIFICATION_868099529) && this.v == null && ChannelConfigManager.c()) {
            this.v = new SettingItem(getContext(), 100, this.s);
            this.v.a(true, new QBSwitch.OnSwitchListener() {
                @Override
                public void a(View view, boolean z) {
                    MultiProcessPublicSettingManager.a().setBoolean("key_notification_show", z);
                    MultiProcessPublicSettingManager.a().setBoolean("key_notification_operation", true);
                    StatManager b2 = StatManager.b();
                    if (z) {
                        b2.c("EIC2101_1");
                        ((INotificationService) QBContext.getInstance().getService(INotificationService.class)).show(ContextHolder.getAppContext(), true);
                        return;
                    }
                    b2.c("EIC2101_0");
                    if (MultiProcessPublicSettingManager.a().getInt("key_notification_type", 0) == 0) {
                        ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).closeHotWordsPush();
                        MultiProcessPublicSettingManager.a().setBoolean("key_notification_hotword_register", false);
                    }
                    ((INotificationService) QBContext.getInstance().getService(INotificationService.class)).stopNotificationService();
                    ((INotify) QBContext.getInstance().getService(INotify.class)).cancelNotificationByID(ContextHolder.getAppContext(), 83);
                    Intent intent = new Intent();
                    intent.setClassName("com.tencent.mtt", "com.tencent.mtt.browser.notification.weather.ResidentForegroundService");
                    ContextHolder.getAppContext().stopService(intent);
                }
            });
            this.v.setSwitchChecked(MultiProcessPublicSettingManager.a().getBoolean("key_notification_show", true ^ ChannelConfigManager.d()));
            this.v.setMainText(MttResources.l(R.string.bee));
            this.v.setId(37);
            this.v.setOnClickListener(this);
            this.v.a(0, z, 0, 0);
            addView(this.v);
            TextView m = m();
            m.setText("开启后,会显示通知栏常驻快捷工具。");
            addView(m);
        }
    }

    public void r() {
        if (this.w == null) {
            this.w = new SettingItem(getContext(), 103, this.s);
            this.w.setOnClickListener(this);
            this.w.a(true, new QBSwitch.OnSwitchListener() {
                @Override
                public void a(View view, boolean z) {
                    PublicSettingManager a2;
                    int i2;
                    if (z) {
                        StatManager.b().c("EIC2107_1");
                        a2 = PublicSettingManager.a();
                        i2 = 1;
                    } else {
                        StatManager.b().c("EIC2107_0");
                        a2 = PublicSettingManager.a();
                        i2 = 0;
                    }
                    a2.setInt("key_welfare_pendant_switch", i2);
                }
            });
            this.w.setMainText(MttResources.l(R.string.bjy));
            this.w.a(0, FeatureToggle.a(qb.basebusiness.BuildConfig.FEATURE_TOGGLE_INNER_PUSH_SWITCK_869435289) ? 0 : z, 0, 0);
            this.w.setSwitchChecked(PublicSettingManager.a().getInt("key_welfare_pendant_switch", 1) == 1);
            addView(this.w);
        }
    }

    public void s() {
        if (FeatureToggle.a(qb.basebusiness.BuildConfig.FEATURE_TOGGLE_INNER_PUSH_SWITCK_869435289) && this.E == null) {
            this.E = new SettingItem(getContext(), 103, this.s);
            this.E.setOnClickListener(this);
            this.E.a(true, new QBSwitch.OnSwitchListener() {
                @Override
                public void a(View view, boolean z) {
                    PushOverAllSettingView.this.b(z);
                }
            });
            this.E.setMainText(MttResources.l(R.string.be6));
            this.E.a(0, z, 0, 0);
            this.E.setSwitchChecked(PublicSettingManager.a().getInt("key_setting_inner_push_switch", 1) == 1);
            addView(this.E);
        }
    }

    public void t() {
        SimpleDialogBuilder.a().a(FeatureToggle.a(qb.library.BuildConfig.FEATURE_TOGGLE_869384873) ? "https://m4.publicimg.browser.qq.com/publicimg/nav/common/push_overall_switch_confirm_v2.png" : "https://static.res.qq.com/nav/res_mtt/common/push_overall_switch_confirm.png").d(MttResources.l(R.string.b07)).e(MttResources.l(R.string.b03) + "\n" + MttResources.l(R.string.b04) + "\n" + MttResources.l(R.string.b05)).a((CharSequence) MttResources.l(R.string.bho)).c(MttResources.l(R.string.bhn)).a_(new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                StatManager.b().c("EIC140102_1");
                dialogBase.dismiss();
                PushOverAllSettingView.this.p.a();
            }
        }).c(new ViewOnClickListener() {
            @Override
            public void onClick(View view, DialogBase dialogBase) {
                StatManager.b().c("EIC140101_0");
                dialogBase.dismiss();
            }
        }).a(new IDialogBuilder.BackListener() {
            @Override
            public boolean handleBack(DialogBase dialogBase) {
                return true;
            }
        }).e();
    }

    @EventReceiver(createMethod = CreateMethod.NONE, eventName = "com.tencent.mtt.browser.push.event.SYNC_PUSH_APP_INFO")
    public void OnSyncPushAppInfo(EventMessage eventMessage) {
        post(new Runnable() {
            @Override
            public void run() {
                PushOverAllSettingView.this.f();
            }
        });
    }

    void a(ArrayList<AppItem> arrayList, ArrayList<PushAuthorizeApp> arrayList2, ArrayList<Bitmap> arrayList3) {
        int i2 = 0;
        if (this.u == null) {
            this.u = new SettingItem(getContext(), 103, 102, this.D);
            this.u.setMainText(i);
            this.u.g.k = MttResources.c(R.color.a2_);
            this.u.setBackgroundColor(0);
            LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, MttResources.h(R.dimen.a3e));
            layoutParams.setMargins(0, MttResources.h(R.dimen.a3s), 0, 0);
            this.u.setLayoutParams(layoutParams);
            addView(this.u);
        }
        if (this.o == null) {
            this.o = c(3);
            addView(this.o);
        }
        if (!this.e) {
            SettingItem settingItem = this.u;
            if (settingItem != null) {
                settingItem.setVisibility(8);
            }
            TextView textView = this.r;
            if (textView != null) {
                textView.setVisibility(8);
            }
            this.o.setVisibility(8);
        }
        this.o.removeAllViews();
        this.f59534d.clear();
        this.l = 18;
        while (i2 < arrayList.size()) {
            AppItem appItem = arrayList.get(i2);
            if (appItem != null) {
                PushAuthorizeApp pushAuthorizeApp = arrayList2.get(i2);
                if ((appItem.f39371b == 111 || appItem.f39371b == 99 || appItem.f39371b == 10001 || (pushAuthorizeApp != null && pushAuthorizeApp.hasNotificationSwitch())) && !TextUtils.isEmpty(appItem.f39373d)) {
                    PushSettingDetailItem pushSettingDetailItem = new PushSettingDetailItem(getContext(), i2 == 0 ? 100 : i2 == arrayList.size() + (-1) ? 102 : 101);
                    pushSettingDetailItem.a(pushAuthorizeApp, appItem, arrayList3.get(i2), this.e);
                    this.f59534d.add(appItem);
                    pushSettingDetailItem.setOnClickListener(this);
                    pushSettingDetailItem.setId(this.l);
                    this.l++;
                    this.o.addView(pushSettingDetailItem);
                }
            }
            i2++;
        }
    }

    @Override
    public void b() {
        super.b();
        f();
        EventEmiter.getDefault().register("com.tencent.mtt.browser.push.event.SYNC_PUSH_APP_INFO", this);
        this.m.getAllPushApp();
    }

    @Override
    public void c() {
        EventEmiter.getDefault().unregister("com.tencent.mtt.browser.push.event.SYNC_PUSH_APP_INFO", this);
        super.c();
    }

    void e() {
        l();
        i();
    }

    void f() {
        TextView textView = this.q;
        if (textView != null) {
            textView.setVisibility(this.e ? 8 : 0);
        }
        SettingItem settingItem = this.t;
        if (settingItem != null) {
            settingItem.setVisibility(this.e ? 0 : 8);
        }
    }

    void i() {
        BrowserExecutorSupplier.postForBackgroundTasks(new BrowserExecutorSupplier.BackgroundRunable() {
            @Override
            public void doRun() {
                PushOverAllSettingView.this.F = ((IPushTokenSerivce) QBContext.getInstance().getService(IPushTokenSerivce.class)).getAppById(131);
                final ArrayList arrayList = new ArrayList();
                ArrayList<AppItem> filteredPushAppList = PushOverAllSettingView.this.m.getFilteredPushAppList();
                if (filteredPushAppList != null) {
                    arrayList.addAll(filteredPushAppList);
                }
                AppItem appItem = new AppItem();
                appItem.a(111);
                appItem.f39373d = PushOverAllSettingView.j;
                arrayList.add(0, appItem);
                AppItem appItem2 = new AppItem();
                appItem2.a(10001);
                appItem2.f39373d = PushOverAllSettingView.k;
                arrayList.add(appItem2);
                final ArrayList arrayList2 = new ArrayList(arrayList.size());
                final ArrayList arrayList3 = new ArrayList(arrayList.size());
                PushOverAllSettingView.this.b(arrayList, arrayList2, arrayList3);
                BrowserExecutorSupplier.forMainThreadTasks().execute(new Runnable() {
                    @Override
                    public void run() {
                        try {
                            PushOverAllSettingView.this.a(PushOverAllSettingView.this.F);
                            PushOverAllSettingView.this.a(arrayList, arrayList2, arrayList3);
                            PushOverAllSettingView.this.s();
                            PushOverAllSettingView.this.r();
                            PushOverAllSettingView.this.q();
                            PushOverAllSettingView.this.p();
                        } catch (Throwable unused) {
                        }
                    }
                });
            }
        });
    }

    @Override
    public void onClick(View view) {
        SettingItem settingItem;
        EventCollector.getInstance().onViewClickedBefore(view);
        int id = view.getId();
        if (id == 37) {
            settingItem = this.v;
        } else if (id == 62) {
            settingItem = this.w;
        } else if (id == 2147483637) {
            settingItem = this.p;
        } else if (view instanceof SettingItem) {
            settingItem = (SettingItem) view;
            settingItem.a();
        }
        EventCollector.getInstance().onViewClicked(view);
    }
}