1. The problem now encountered, the phone into hibernation after the wake, the app software and CC2541 communication is not normal, but CC2541 still detect when the connection state. How to solve this problem? Will the activity be recreated after the phone wakes up?
2.Wakelock lock Mechanism:
Applications can vote on whether the system is standby by applying the Wakelock lock mechanism, and when any application has applied for a wakelock lock, it is not released during standby and the system will not enter standby until all of the application's Wakelock locks are released, before they enter standby. Can this lock be used this time? Let the system not standby, if not standby, more power? If there is QQ open, the system is originally standby?
3. Look at the code of the lock
1 /** 2 * Get the Power lock, keep it running when the service is still getting the CPU when the screen is off3 */4 Private voidAcquirewakelock () {5 if(NULL==WakeLock) {6PowerManager pm =(PowerManager) Getsystemservice (context.power_service);7WakeLock =Pm.newwakelock (Powermanager.partial_wake_lock8|Powermanager.on_after_release, GetClass ()9 . Getcanonicalname ());Ten if(NULL!=WakeLock) { OneLOG.I (TAG,"Call Acquirewakelock"); A Wakelock.acquire (); - } - } the } - - //release the device power lock - Private voidReleasewakelock () { + if(NULL! = WakeLock &&Wakelock.isheld ()) { -LOG.I (TAG,"Call Releasewakelock"); + wakelock.release (); AWakeLock =NULL; at } -}
4. Will the activity be recreated after waking? When you rotate the screen, you
Android BLE connection CC2541 development record