package com.kwad.sdk.utils; import android.content.Context; import android.os.Build; import android.os.PowerManager; import android.os.SystemClock; public final class am { private static volatile am bBJ = new am(); private volatile boolean bBK; private volatile long bBL = 0; private volatile PowerManager bBM; public static am YI() { return bBJ; } public final boolean aX(Context context) { if (this.bBL > 0 && SystemClock.elapsedRealtime() - this.bBL < 600) { return this.bBK; } boolean z = false; if (this.bBM == null && context != null) { synchronized (this) { if (this.bBM == null) { this.bBM = (PowerManager) context.getApplicationContext().getSystemService("power"); } } } if (this.bBM != null) { z = Build.VERSION.SDK_INT >= 20 ? this.bBM.isInteractive() : this.bBM.isScreenOn(); } this.bBK = z; this.bBL = SystemClock.elapsedRealtime(); return this.bBK; } }