example.platform.power/src/example/platform/power/ExamplePlatformPowerManager.java
@Override
    public void cancelWakeLock(WakeLock lock) throws IllegalStateException
    {
        ExamplePowerManagerMethodLog methodLog = new ExamplePowerManagerMethodLog();
        methodLog.setWakeLockId(lock.getId());
        logMethodCall(lock.getId(), methodLog, ExamplePowerManagerMethodLog.MethodCalled.Cancel);        

        if(getActiveWakeLocks().contains(lock))  
        {    
            m_ExamplePlatformKernel.deactivateWakelock(lock);
            m_Logging.log(LogService.LOG_INFO, "Cancelling Active WakeLock for [%s]", lock.getId());
        }
        else if(getScheduledWakeLocks().contains(lock))
        {
            m_ExamplePlatformKernel.unscheduleWakelock(lock);
            m_Logging.log(LogService.LOG_INFO, "Cancelling Scheduled WakeLock for [%s]", lock.getId());
        }
        else
        {
            throw new IllegalStateException("WakeLock not in active or scheduled state.");
        }
    }
/**
     * Calls the OS/hardware code to cancel a given active or scheduled WakeLock.
     */
Calls the OS/hardware code to cancel a given active or scheduled WakeLock.
Calls the OS / hardware code to cancel a given active or scheduled WakeLock .
@Override
    public void cancelWakeLock(WakeLock lock) throws IllegalStateException
    {
        ExamplePowerManagerMethodLog methodLog = new ExamplePowerManagerMethodLog();
        methodLog.setWakeLockId(lock.getId());
        logMethodCall(lock.getId(), methodLog, ExamplePowerManagerMethodLog.MethodCalled.Cancel);        
        if(getActiveWakeLocks().contains(lock))  
        {    
            m_ExamplePlatformKernel.deactivateWakelock(lock);
            m_Logging.log(LogService.LOG_INFO, "Cancelling Active WakeLock for [%s]", lock.getId());
        }
        else if(getScheduledWakeLocks().contains(lock))
        {
            m_ExamplePlatformKernel.unscheduleWakelock(lock);
            m_Logging.log(LogService.LOG_INFO, "Cancelling Scheduled WakeLock for [%s]", lock.getId());
        }
        else
        {
            throw new IllegalStateException("WakeLock not in active or scheduled state.");
        }
    }
@ Override public void cancelWakeLock ( WakeLock lock ) throws IllegalStateException { ExamplePowerManagerMethodLog methodLog = new ExamplePowerManagerMethodLog ( ) ; methodLog . setWakeLockId ( lock . getId ( ) ) ; logMethodCall ( lock . getId ( ) , methodLog , ExamplePowerManagerMethodLog . MethodCalled . Cancel ) ; if ( getActiveWakeLocks ( ) . contains ( lock ) ) { m_ExamplePlatformKernel . deactivateWakelock ( lock ) ; m_Logging . log ( LogService . LOG_INFO , "Cancelling Active WakeLock for [%s]" , lock . getId ( ) ) ; } else if ( getScheduledWakeLocks ( ) . contains ( lock ) ) { m_ExamplePlatformKernel . unscheduleWakelock ( lock ) ; m_Logging . log ( LogService . LOG_INFO , "Cancelling Scheduled WakeLock for [%s]" , lock . getId ( ) ) ; } else { throw new IllegalStateException ( "WakeLock not in active or scheduled state." ) ; } }
Calls the OS/hardware code to cancel a given active or scheduled WakeLock.
Calls the OS / hardware code to cancel a given active or scheduled WakeLock .