package com.tencent.mm.app;

import android.content.SharedPreferences;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.app.a.c;
import com.tencent.mm.compatible.util.h;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ah;

class a$c$1 implements Runnable {
    final /* synthetic */ c cdT;

    a$c$1(c cVar) {
        this.cdT = cVar;
    }

    public final void run() {
        AppMethodBeat.i(15356);
        this.cdT.cdR = (this.cdT.cdR + 1) % Integer.MAX_VALUE;
        if (this.cdT.cdR % a.access$200() == 0) {
            SharedPreferences sharedPreferences = ah.getContext().getSharedPreferences("system_config_prefs", h.Mu());
            int i = sharedPreferences.getInt("main_thread_watch_enable", 65535);
            int i2 = sharedPreferences.getInt("main_thread_watch_timeout", 0);
            int i3 = sharedPreferences.getInt("main_thread_watch_log_loop", 0);
            int i4 = sharedPreferences.getInt("main_thread_watch_report", 0);
            ab.i("MicroMsg.ANRWatchDog.summeranr", "summeranr ticker tname[%s], tick[%d] enable[%d], timeout[%d], loop[%d], report[%d]", new Object[]{Thread.currentThread().getName(), Integer.valueOf(this.cdT.cdR), Integer.valueOf(i), Integer.valueOf(i2), Integer.valueOf(i3), Integer.valueOf(i4)});
            if (a.r(a.access$300(), i)) {
                if (i2 > 0 && i2 != a.AN()) {
                    ab.i("MicroMsg.ANRWatchDog.summeranr", "summeranr reset timeout[%d, %d] by new setting", new Object[]{Integer.valueOf(a.AN()), Integer.valueOf(i2)});
                    a.gg(i2);
                }
                if (i3 > 0 && i3 != a.access$200()) {
                    ab.i("MicroMsg.ANRWatchDog.summeranr", "summeranr reset loop[%d, %d] by new setting", new Object[]{Integer.valueOf(a.access$200()), Integer.valueOf(i3)});
                    a.access$202(i3);
                    AppMethodBeat.o(15356);
                    return;
                }
            }
            com.tencent.mm.plugin.report.service.h.pYm.a(510, 12, 1, true);
            if (a.AO() != null) {
                a.AO().interrupt();
            }
            ab.i("MicroMsg.ANRWatchDog.summeranr", "summeranr disable by new setting and interrupt watch");
        }
        AppMethodBeat.o(15356);
    }
}
