FileDocCategorySizeDatePackage
WakeUpController.javaAPI DocAndroid 5.1 API1946Thu Mar 12 22:22:44 GMT 2015com.android.testing.alarmservice

WakeUpController

public class WakeUpController extends Object
A singleton used for controlling and sharing of states/wakelocks

Fields Summary
private static final String
LOG_TAG
private static WakeUpController
mController
private android.os.PowerManager.WakeLock
mWakeLock
private Object
mWakeSync
Constructors Summary
private WakeUpController()


      
        Log.i(LOG_TAG, "Created instance: 0x" + Integer.toHexString(this.hashCode()));
    
Methods Summary
public static synchronized com.android.testing.alarmservice.WakeUpControllergetController()

        if (mController == null) {
            mController = new WakeUpController();
        }
        return mController;
    
public android.os.PowerManager.WakeLockgetWakeLock()

        if (mWakeLock == null) {
            PowerManager pm =
                    (PowerManager) AlarmService.sContext.getSystemService(Context.POWER_SERVICE);
            mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "testing-alarmservice");
            Log.i(LOG_TAG, "Create wakelock: 0x" + Integer.toHexString(mWakeLock.hashCode()));
        }
        return mWakeLock;
    
public java.lang.ObjectgetWakeSync()

        return mWakeSync;