code: public static void keepCpuAwake(Context context, boolean awake) {
      if (cpuWakeLock == null) {
        PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        if (pm != null) {
          cpuWakeLock =
              pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE, TAG);
          cpuWakeLock.setReferenceCounted(true);
        }
      }
      if (cpuWakeLock != null) { //May be null if pm is null
        if (awake) {
          cpuWakeLock.acquire();
          L.d(TAG, "Adquired CPU lock");
        } else if (cpuWakeLock.isHeld()) {
          cpuWakeLock.release();
          L.d(TAG, "Released CPU lock");
        }
      }
    }
docs: Register a wake lock to power management in the device.
  
  @param context Context to use
  @param awake if true the device cpu will keep awake until false is called back. if true is
  passed several times only the first time after a false call will take effect,
  also if false is passed and previously the cpu was not turned on (true call)
  does nothing.