Ejemplo n.º 1
0
 private static void releaseWakeLock(Integer wakeLockId) {
   if (wakeLockId != null) {
     TracingWakeLock wl = wakeLocks.remove(wakeLockId);
     if (wl != null) {
       if (Secure9.DEBUG) Log.v(Secure9.LOG_TAG, "CoreReceiver Releasing wakeLock " + wakeLockId);
       wl.release();
     } else {
       Log.w(Secure9.LOG_TAG, "BootReceiver WakeLock " + wakeLockId + " doesn't exist");
     }
   }
 }
Ejemplo n.º 2
0
 private static Integer getWakeLock(Context context) {
   TracingPowerManager pm = TracingPowerManager.getPowerManager(context);
   TracingWakeLock wakeLock =
       pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "CoreReceiver getWakeLock");
   wakeLock.setReferenceCounted(false);
   wakeLock.acquire(Secure9.BOOT_RECEIVER_WAKE_LOCK_TIMEOUT);
   Integer tmpWakeLockId = wakeLockSeq.getAndIncrement();
   wakeLocks.put(tmpWakeLockId, wakeLock);
   if (Secure9.DEBUG) Log.v(Secure9.LOG_TAG, "CoreReceiver Created wakeLock " + tmpWakeLockId);
   return tmpWakeLockId;
 }