package com.tencent.mm.plugin.voip_cs.ui;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.PowerManager;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.voip_cs.b.c;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.ah;

class VoipCSMainUI$4 extends BroadcastReceiver {
    final /* synthetic */ VoipCSMainUI teJ;

    VoipCSMainUI$4(VoipCSMainUI voipCSMainUI) {
        this.teJ = voipCSMainUI;
    }

    public final void onReceive(Context context, Intent intent) {
        AppMethodBeat.i(135392);
        String action = intent.getAction();
        PowerManager powerManager = (PowerManager) ah.getContext().getSystemService("power");
        if ("android.intent.action.USER_PRESENT".equals(action) && powerManager.isScreenOn()) {
            ab.d("MicroMsg.voipcs.VoipCSMainUI", "on user present home");
            VoipCSMainUI.e(this.teJ).cAY = false;
            AppMethodBeat.o(135392);
            return;
        }
        if ("android.intent.action.SCREEN_ON".equals(action)) {
            ab.d("MicroMsg.voipcs.VoipCSMainUI", "screen on...");
            VoipCSMainUI.e(this.teJ).cAY = false;
            if (!VoipCSMainUI.f(this.teJ).cKq() && c.cMf().tdM == 2) {
                VoipCSMainUI.f(this.teJ).cMo();
                AppMethodBeat.o(135392);
                return;
            }
        } else if ("android.intent.action.SCREEN_OFF".equals(action)) {
            ab.d("MicroMsg.voipcs.VoipCSMainUI", "screen off...");
            VoipCSMainUI.e(this.teJ).cAY = true;
            if (!VoipCSMainUI.f(this.teJ).cKq()) {
                VoipCSMainUI.f(this.teJ).stopRing();
            }
        }
        AppMethodBeat.o(135392);
    }
}
