Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7696723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:50:47+00:00 2026-05-31T21:50:47+00:00

Do you have better way to make the device awakes by 100%? I repeatedly

  • 0

Do you have better way to make the device awakes by 100%? I repeatedly call the acquire() but I’m not sure if that is correct. Or should I just call the acquire() once? Or should I make use of Intent.ACTION_SCREEN_OFF?

public class MyServiceThatKeepsTheDeviceAwake extends IntentService {   
TAG = "com.android.browser.test.launcher.BrowsePageService";
...
@Override
public void onCreate() {
    super.onCreate();
    mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE);
    mWakeLock = mPowerManager.newWakeLock(PowerManager.FULL_WAKE_LOCK |PowerManager.ACQUIRE_CAUSES_WAKEUP |PowerManager.ON_AFTER_RELEASE, TAG);
}

@Override
public void onStart(Intent intent, int startId) {
    super.onStart(intent, startId);
    mWakeLock.acquire();
}

// No release

*This service is run using AlarmManager every 20 seconds

—Added:

*This gives me the ff. output when repeatedly running it. Should there be any problem with this? Should there be any problem call it repeatedly?

C:\Windows\System32>adb shell dumpsys power
Power Manager State:
mIsPowered=false mPowerState=3 mScreenOffTime=463571 ms
mPartialCount=9
mWakeLockState=SCREEN_BRIGHT_BIT SCREEN_ON_BIT
mUserState=
mPowerState=SCREEN_BRIGHT_BIT SCREEN_ON_BIT
mLocks.gather=SCREEN_BRIGHT_BIT SCREEN_ON_BIT
mNextTimeout=355968 now=463589 -107s from now
mDimScreen=true mStayOnConditions=0
mScreenOffReason=0 mUserState=0
mBroadcastQueue={-1,-1,-1}
mBroadcastWhy={0,0,0}
mPokey=0 mPokeAwakeonSet=false
mKeyboardVisible=false mUserActivityAllowed=true
mKeylightDelay=6000 mDimDelay=2000 mScreenOffDelay=7000
mPreventScreenOn=false  mScreenBrightnessOverride=-1  mButtonBrightnessOverride=-1
mScreenOffTimeoutSetting=15000 mMaximumScreenOffTimeout=2147483647
mLastScreenOnTime=19531
mBroadcastWakeLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)
mStayOnWhilePluggedInScreenDimLock=UnsynchronizedWakeLock(mFlags=0x6 mCount=0 mHeld=false)
mStayOnWhilePluggedInPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)
mPreventScreenOnPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)
mProximityPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)
mProximityWakeLockCount=0
mProximitySensorEnabled=false
mProximitySensorActive=false
mProximityPendingValue=-1
mLastProximityEventTime=0
mLightSensorEnabled=true
mLightSensorValue=1219.0 mLightSensorPendingValue=1173.0
mLightSensorPendingDecrease=true mLightSensorPendingIncrease=false
mLightSensorScreenBrightness=122 mLightSensorButtonBrightness=0 mLightSensorKeyboardBrightness=0
mUseSoftwareAutoBrightness=true
mAutoBrightessEnabled=true
mScreenBrightness: animating=false targetValue=122 curValue=122.0 delta=0.45

mLocks.size=16:
FULL_WAKE_LOCK                 'com.android.browser.test.launcher.BrowsePageService'ACQUIRE_CAUSES_WAKEUP  activated (minState=3, uid=10040, pid=722)
FULL_WAKE_LOCK                 'com.android.browser.test.launcher.BrowsePageService'ACQUIRE_CAUSES_WAKEUP  activated (minState=3, uid=10040, pid=722)
FULL_WAKE_LOCK                 'com.android.browser.test.launcher.BrowsePageService'ACQUIRE_CAUSES_WAKEUP  activated (minState=3, uid=10040, pid=722)
FULL_WAKE_LOCK                 'com.android.browser.test.launcher.BrowsePageService'ACQUIRE_CAUSES_WAKEUP  activated (minState=3, uid=10040, pid=722)
FULL_WAKE_LOCK                 'com.android.browser.test.launcher.BrowsePageService'ACQUIRE_CAUSES_WAKEUP  activated (minState=3, uid=10040, pid=722)
FULL_WAKE_LOCK                 'com.android.browser.test.launcher.BrowsePageService'ACQUIRE_CAUSES_WAKEUP  activated (minState=3, uid=10040, pid=722)
FULL_WAKE_LOCK                 'com.android.browser.test.launcher.BrowsePageService'ACQUIRE_CAUSES_WAKEUP  activated (minState=3, uid=10040, pid=722)
PARTIAL_WAKE_LOCK              'WSBase.lastChance' activated (minState=0, uid=10007, pid=243)
PARTIAL_WAKE_LOCK              'WSBase.lastChance' activated (minState=0, uid=10007, pid=243)
PARTIAL_WAKE_LOCK              'WSBase.lastChance' activated (minState=0, uid=10007, pid=243)
PARTIAL_WAKE_LOCK              'WSBase.lastChance' activated (minState=0, uid=10007, pid=243)
PARTIAL_WAKE_LOCK              'WSBase.lastChance' activated (minState=0, uid=10007, pid=243)
PARTIAL_WAKE_LOCK              'WSBase.lastChance' activated (minState=0, uid=10007, pid=243)
PARTIAL_WAKE_LOCK              'WSBase.lastChance' activated (minState=0, uid=10007, pid=243)
PARTIAL_WAKE_LOCK              'WSBase.lastChance' activated (minState=0, uid=10007, pid=243)
PARTIAL_WAKE_LOCK              'WSBase' activated (minState=0, uid=10007, pid=243)

mPokeLocks.size=0:
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T21:50:48+00:00Added an answer on May 31, 2026 at 9:50 pm

    No need to call acquire() repeatedly.Just in onCreate() acquire lock.It will work until you do not call release().Just in onDestroy() of activity call release(), As it battery consuming task.

    For more detail look at this Detail Discussion on Wake up of Screen

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have realized that I am not 100% sure what is the best way
I have a workable solution but I'm pretty convinced there's a better way of
Sorry for repost but I have a better working example of data that reflects
I'm wondering if there is a better way to make a daemon that waits
Checking to make sure my assumptions are correct. I have an ObservableCollection class. I
Possible Duplicate: A better way to compare Strings which could be null I have
I have a string and am trying to findout what's a better way by
Is there a better way to do this jquery code? Currently I have to
If I have this line and I'm wondering if there's better way to do
This may be have a better name than custom tab completion, but here's the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.