package a.b.a.i;

import a.a.a.b;
import android.content.Context;
import android.os.PowerManager;

public class g {

    /* renamed from: a  reason: collision with root package name */
    private static final String f36a = "Locker";
    private static final Object b = new Object();
    private static PowerManager.WakeLock c;

    public static void a() {
        synchronized (b) {
            if (c != null) {
                b.c(f36a, "Release wake lock.");
                c.release();
                c = null;
            } else {
                b.e(f36a, "Lock was release already.");
            }
        }
    }

    public static void a(Context context) {
        synchronized (b) {
            PowerManager powerManager = (PowerManager) context.getSystemService("power");
            if (c == null) {
                c = powerManager.newWakeLock(1, "vivoShare::AppWakeLock");
                b.c(f36a, "Acquire wake lock.");
                c.acquire(3600000);
            } else {
                b.e(f36a, "Already on lock.");
            }
        }
    }
}
