Questions tagged [wakelock]

Refers to PowerManager.WakeLock, a class from the Android SDK belonging to package android.os. Its responsibility is requesting CPU resources in the context of power management. If no wake locks are taken, Android will shut down the CPU.

The Android Operating System uses its own power management scheme, built on top of the standard Linux one. Since it's mobile-oriented, one of its main goals is to avoid wasting CPU cycles (i.e. power) if no application is running.

That's why every application must request CPU resources, using wake locks. If no wake lock is taken, Android will shut down the CPU in order to save power.

Resources:

534 questions
0
votes
1 answer

Voip application in sleep states

Imagine that we have the SIP stack Voip Android application, and we want to receive message, and calls in sleep mode. By using ADB we put devices in IDLE states, and haven't any source for receiving incoming message from signaling. Neither…
GensaGames
  • 5,538
  • 4
  • 24
  • 53
0
votes
0 answers

PARTIAL_WAKE_LOCK with ACQUIRE_CAUSES_WAKEUP

I read PowerManager API Doc which said "In addition, you can add two more flags, which affect behavior of the screen only. These flags have no effect when combined with a PARTIAL_WAKE_LOCK." So ON_AFTER_RELEASE and ACQUIRE_CAUSES_WAKEUP not work…
DONG
  • 59
  • 1
  • 10
0
votes
1 answer

Wake up android even it's in sleep mode

I working with application that using GCM. So when I lock my screen and few minute after that, maybe the phone come to sleep mode. I try to send message to that phone but it cannot deliver, but when I turn screen on, the message delivered…
Bui Quang Huy
  • 1,784
  • 2
  • 17
  • 50
0
votes
2 answers

Android: background process stops after some minutes since device sleeps even when using wakelock

I'm building an app to control led bulbs (Mi-Light, limitlessLed and the likes). The purpose of the app is to have effects that the user can select and let run for an indefinite amount of time. For example, a "candle light" effect might change the…
coconup
  • 945
  • 10
  • 17
0
votes
1 answer

How to find if a phone is in sleep mode or not???

I want my application to run all time. It should execute a function when phone is in sleep mode and stop the execution when it is asleep. Can anyone post a sample code? Thanks in advance.
James
  • 13,891
  • 26
  • 68
  • 93
0
votes
0 answers

Let screen off after releasing a wakelock with ACQUIRE_CAUSES_WAKEUP flag

Context: I'm under Android 4.0.4. The code I'm stating is inside an Activity. The application is a Cordova application, I'm writing this code inside a plugin. I think I read all the questions here in StackOverflow and the Android docs. I want to…
emilianop11
  • 313
  • 4
  • 15
0
votes
1 answer

programmatically turn screen off in Android phone from another thread

I'm trying to turn off the screen of an Android phone. I read many other discussions, and tried two ways discribed here: Turn off screen on Android In fact, what I really need to do is to launch the lock screen (the one that asks for the PIN). I…
Augustina
  • 259
  • 1
  • 4
  • 15
0
votes
1 answer

Turning Screen Off in Android with PARTIAL_WAKE_LOCK

I am using the following code to send some HTTP request when the device is moving. It works fine when I change PARTIAL_WAKE_LOCK to SCREEN_DIM_WAKE_LOCK and it keeps the screen on and app working. However, when using PARTIAL_WAKE_LOCK, the device…
Amir
  • 1,667
  • 3
  • 23
  • 42
0
votes
1 answer

Android service call OnDestroy immediately when i start the service in sleep mode

I use a BroadcastReceiverTo: Wake up the phone Playing sound and vibration in a service Show an Activity Every things work well when i test it while the phone is not in Sleep mode BUT When the phone is in Sleep mode (phone is locked and the…
Ramin Bateni
  • 16,499
  • 9
  • 69
  • 98
0
votes
1 answer

Android - WakeLock - POST location on PUSH notification received when screen lock'd (parse.com)

I want to POST my Location on PushReceived when the screen is lock'd. My code works when the screen is on. WakeLock does not seem to work... When receiving a PUSH notification for the first time from Parse.com the screen turns ON and I can see that…
0
votes
1 answer

Android AlarmManager RTC_WAKEUP not waking CPU

I'm working on alarm app, that notofies the user several times at different moments. Everything is working perfect, except that when I disconnect phone from PC and turn off the screen (by pressing power button for example), the alarms do not go off.…
Pelikan
  • 1
  • 1
  • 5
0
votes
1 answer

Partial wake lock releases when screen turns off

Im building a Cordova/Ionic app which lets a user view the camera of an Andoroid cellphone live using webrtc (peerJs). I need to allow the device to turn off the screen after (let's say) 15 seconds, and keep transmitting the video to other Android…
emilianop11
  • 313
  • 4
  • 15
0
votes
1 answer

Is there a way to lock Android screen after a certain period of time?

My app uses a WakeLock and it automatically turns the screen on when it receives a SMS. I've set the duration so that it releases the WakeLock almost instantaneously, but it seems that in Settings, the minimum time the screen will turn off after…
Kyle
  • 598
  • 1
  • 7
  • 25
0
votes
0 answers

WakeLock huge battery consumption

Hello everybody and thanks in advance, I have a service that checks every minute if the actual time match a given time (hour and minute) and if so, shows a notification. The problem is that the wakelock is "drinking" my battery quickly. I guess that…
Mazinger
  • 633
  • 1
  • 6
  • 12
0
votes
1 answer

Webview behaviour wakelock android

How WebView works with wake lock? Flag Value CPU Screen Keyboard PARTIAL_WAKE_LOCK On* Off Off SCREEN_DIM_WAKE_LOCK On Dim Off SCREEN_BRIGHT_WAKE_LOCK On Bright Off FULL_WAKE_LOCK On …
TroniPM
  • 329
  • 3
  • 13