Why does a smartphone switch sleep mode on its own? Android sleep mode: what is it for, how to remove it

There are universal methods for increasing the operating time of mobile devices

Phones are constantly being improved, losing weight, becoming thinner, their processors becoming more powerful, and their screens becoming larger. And with all this technological progress, the load on batteries increases.

Phone manufacturers are constantly trying to extend the battery life of their devices. But with everyday use, the batteries also last an average of one to two days without recharging. Moreover, the functionality of devices, the resource intensity of programs, and the frequency of phone use are also increasing. This all leads to even faster battery depletion. It is enough to launch some program on your phone, surf the Internet for several hours, and the battery will remind you of itself by asking for recharging.

At the same time, there are certain universal methods for increasing the battery life of mobile devices. Let's look at these methods in more detail.

1. Disabling the Auto Brightness option. When in Auto Brightness mode, the phone adjusts the screen brightness to the light level of the place where you are at a particular moment. At the same time, such a useful function in general is in demand only if you move around a lot, and accordingly, the lighting intensity changes (street - transport - office, and so on). In the case when you spend most of the time in a room with a stable level of lighting, it will be beneficial for you to turn off the “Auto-Brightness” mode. Set the brightness mode that is most suitable and convenient for you; you will probably have to significantly reduce the brightness mode set automatically by your phone. And all because the standard light control sensor changes the screen backlight mode even when it is not necessary to do so. The light sensor in real mode reacts to shadows falling on the phone screen, glare of light, light from a computer monitor, and lighting fixtures. And this effect occurs constantly until the phone’s screen is on and it does not automatically go into sleep mode or auto-lock mode. And this, of course, is the work of sensors, energy consumption, premature, accelerated discharge of the phone battery.

2. Disable "Automatic screen rotation" mode. This useful function will also not be in demand all the time; at the same time, the accelerometer - a sensor in the phone that responds to turning the phone from a horizontal to a vertical position and back, will consume significant amounts of energy, which could be spent on more necessary, often necessary telephone conversations.

3. Reduce automatic screen lock time(there may be a “screen timeout” item in the settings). By default, a phone from a store usually has a timeout of one minute. That is, after one minute of inactivity, the phone goes into sleep mode, standby mode, and the screen automatically turns off and locks. It is important to understand that the shorter the interval between entering sleep mode, the more economical the phone's energy consumption.

4. Clean the phone's RAM. After working in any phone application, do not forget to close it. Remaining in the phone's RAM, applications continue to constantly use the device's system resources, thereby consuming battery power and reducing the battery life of the device. A similar remark applies to the so-called installed “live wallpapers”.

5. When working on devices with an Amoled display It is beneficial to install completely plain black wallpaper on your screen. In Amoled, power consumption directly depends on the brightness level of the screen. Such screens require more energy; if bright, light wallpapers are installed, they consume even more energy than liquid crystal options. Reduce screen brightness and use a dark screensaver background.

6. Change the reader mode in the device to “night”(or inversion). Reading books or any other text directly from the phone screen is very energy-intensive. However, here you can use a little trick. Inversion will replace the screen background with black, while the font will turn white. Thus, we will fulfill the condition from the previous paragraph. A dark screen will end up using less power than a white screen, like a sheet of paper.

7. Disable Bluetooth and Wi-Fi modules. Modern devices have a function to automatically turn off these modules, but they are turned off only when the device goes into sleep mode. Therefore, it is safer to disable them manually. Similarly, when not using the device, turn off all online services and email. It is also beneficial to save battery power by disabling all system reminders and messages. Disconnect the device from 3G networks. Such simple operations will extend the phone's operation without recharging for several hours.

8. Turn off vibration and vibration feedback on your phone. The vibration motor that sets the phone in motion consumes quite a bit of battery power; turning off vibration will not cause much inconvenience for the user, at the same time it will allow you to use the phone for a longer time.

9. Follow the temperature conditions recommended by the phone manufacturer. A comfortable temperature, and for a phone this is around 15 - 25 degrees, will extend the life of the battery, reduce the rate of its random discharge, and prevent malfunctions in the device.

10. Install additional applications, allowing for a full cycle of recharging the battery with low current. This is, for example, BatteryDoctor, the program implements careful control over battery consumption, and this has a positive effect on the battery life of the phone on a single charge.

Thus, the proposed tips, accessible to everyone, will guarantee to extend the phone’s operation without recharging to four or even six hours.

Android sleep mode - what is it and how to disable it - is an issue that requires an urgent solution in a situation where the user needs the device to work constantly. If you need to disable sleep mode or increase the decay time, it is worth studying the recommendations in this article. It says here how to increase the time period, why it is necessary and what benefits can be gained from carrying out this operation.

This is a special option built in by default. In such a case, setting up inactivity yourself will make a difference in time. This period is equal to two minutes. If necessary, you can increase it by following simple instructions and recommendations.

What is this function for?

It is worth considering why such an operation is required. This is a special option that will save battery power. After some time, the display goes dark and the device goes into sleep mode.

Despite its obvious usefulness, Android sleep mode bothers users. People are starting to get annoyed that the gadget turns off when reading or viewing photos. There is a need to disable the mode and make the gadget’s operation convenient. Disabling will be carried out over time or by intentional user action.

How to disable sleep mode on your phone?

An excellent solution is to disable screen fading through special applications. Without them, you can set a timeout only within a couple of minutes.

Before carrying out such an operation, you should think about it, since quieting down the operation can not only save battery, but also ensure safety. If the smartphone is left unattended, it will turn off and a stranger will not be able to use it.

How to remove sleep mode on your phone?

To completely remove the mode, you will need to use special Stay Alive software. The utility's interface is clear; after downloading, the user will understand what needs to be done.

If you do not want or have the ability to use third-party applications, you are allowed to do so through the settings. The scheme of actions can be studied using the examples of Honor and Huawei gadgets. It is necessary to perform the following manipulations:


Here you can set the operating time when the device is idle.
If you have a MIUI brand gadget at your disposal, a person must do the following to change the mode:

  • Go to the settings tab;
  • Click Privacy;
  • You should go to the Office.

On many gadgets, to achieve the goal, it is enough to launch the Track Usage function. If desired, you can use the Allow the screen to dim option, which translates to dimming the display. If you check the appropriate box, the light will darken a little, but there will be no blocking.

Why can't I change the sleep mode on my phone?

This is a deliberate and built-in limitation. It is intended for safety and to maintain working condition. Without third-party applications, it is difficult to change the mode due to the fact that the function acts as part of the phone's operation. The only thing you can do is increase the standard time.

If the phone's display has not been manually blocked by the owner, the gadget will go to sleep after 30 seconds of complete inactivity. To make this time period longer, you will have to act through the settings. If you need to deactivate the option, you should go to a special menu or use the application functionality.

How to set up sleep mode?

This useful option becomes annoying in different situations in which the owner of the device uses it. Among the most important are:

  1. Watching videos and photos on the Internet.
  2. Games where a break will take time.
  3. Studying maps.

These are actions where a person performs a minimum number of manipulations on the screen. To get rid of this annoying factor and not permanently unlock the Honor device, you need to follow the described scheme. A person must perform the following manipulations in the settings:


It is worth noting that on certain smartphones there is no way to disable the timeout. The exposure can only be extended to 30 minutes. A similar sleep mode is present in standard firmware on honor devices. If there is no such option, you can often find the option Keep the display on. If you put it in the active position, the phone will not turn off during the charging period.

You can use a special application. We are talking about the universal utility Hold Screen On Demo. It uses the front camera to prevent the screen from turning off after a certain amount of time. The camera follows the user's gaze. As soon as a person stops looking at the phone, the utility will be able to understand this, turn off the smartphone, and it will be inactive.

This program allows you to configure and change the list of specific applications. When they are active, the camera will track the direction of the eyes and their movement across the screen.

The option can be disabled for free, which means you won't have to pay for the absence of advertising. This option is suitable for users who do not want to waste time constantly switching settings on Samsung. It is enough to find and download the utility itself once, and you can get rid of such an annoying factor as screen fading, during which nothing can be done in applications.

Summing up

It’s quite easy to make settings on your tablet or phone, after which the device will not leave active mode. On most Android 7a phones, the option can be configured or turned off completely, but there are models where you can only increase the sleep time from an average of 30 seconds to 30 minutes.

By default, sleep mode, that is, the screen turns off when inactive on an Android smartphone, occurs after 30 or 60 seconds. As a rule, this is more than enough for most users, and turning off the display saves battery power. However, sometimes this time is not enough, so you need to increase the time before entering sleep mode. How to do it? Now you will find out everything.

Disable screen sleep for up to 30 minutes

On most Android smartphones, the maximum time of inactivity before the screen turns off is 30 minutes. If these numbers are enough for you, you just need to change the settings.

Go to the settings section.

Open the "Screen" section.

Find the line “Sleep mode”, tap on it.

Select the maximum period of user inactivity before the screen goes into sleep mode.

All. If necessary, the time can be changed at any time.

How to disable sleep mode completely (for more than 30 minutes)?

If the screen turns off during inactivity for more than 30 minutes, you will have to install a third-party application.

Open Play Market.

Write in search screen alive, click on the search button.

Choose an application, read reviews, install.

Let’s take “Staying Screen” from Active Mobile Applications as an example.

Install and launch. We select an application for which the screen should not go dark, tap on it and see the corresponding icon.

This application should not turn off the screen when there is no user activity at all. Other similar applications, which you can also install from the Play Market, work in much the same way.

Android defaults to a minimum amount of inactivity before your device goes into sleep mode. The standard timer is 2 minutes. This is not enough, since you can be distracted from work for a while.


In this material we will examine two main questions:

  1. How to completely disable sleep mode.
  2. How to increase waiting time.

Disabling sleep mode completely

Standard Android tools do not allow you to completely disable sleep mode, so we will use third-party applications for this. Go to Google Play, enter “Stay Alive!” in the search bar. Keep screen awake." It is not recommended to download such programs from other sources. The application is free and simple, which is why we chose it among more functional paid analogues.

Unfortunately, there is no Russian version yet.

When you open the application, you will see that opposite the inscription “ Always keep screen Alive" is already marked. The translation here is simple: the device always remains active. If you need to remain active only when working with certain programs, then select them from the list.

Click on the section “ Keep screen Alive! for selected apps" Below there will be a button “ Select apps that..." All applications installed on your tablet will be displayed here. Check the boxes next to the programs you need.

Done, now sleep mode will not interfere with your work. You can disable the permanently active device mode using the same procedure - just uncheck the “ Always keep screen Alive».

Increasing the time the device remains in active mode

This action can be performed using standard Android services:

  1. Open the main tablet settings and go to the section Screen.
  2. In the list of settings you will find a section Sleep mode.
  3. Here you can only change the time, although there are exceptions: on some versions of Android, you can disable the timeout in this menu. Most likely, this item will not be active for you.
  4. If necessary, you can set it for half an hour.

As for Apple tablets, here you can reduce the delay or turn it off completely. To do this, you need to go to the settings on the desktop. Go to the section Basic.

Here you should select Auto-lock, which is responsible for the sleep mode. You can specify the interval from the list or just click Never, then the gadget will not go into sleep mode at all..

Christopher Bird

Power Management in Android Operating System - Sleep Lock

Probably, many have encountered a situation where a mobile device cannot operate on a single battery charge for a full day. Everyone understands the unpleasantness of the situation when, by the end of the working day, the phone turns into a useless brick. Modern applications make it possible to perform tasks on smartphones that previously required a computer. But if we compare smartphones with PCs, then due to their significantly smaller size, they also differ in significantly lower battery capacity. Thus, the phone must have, in essence, the functionality of a laptop, but at the same time - and this is a very strict requirement - it must run on battery power for quite a long time without recharging.

Android and other mobile operating systems have achieved long battery life by using an aggressive power management model. After some time of using the phone, the screen turns off and the CPU goes into a low-power mode. Thus, when the phone is not in use, very little energy is consumed. Thanks to this approach, phones can work in standby mode without recharging for several days. The Android power manager is built on the following, quite logical principle: when the screen turns off, the CPU also turns off.

But Android developers have provided the ability to prevent devices running this OS from going into sleep mode. In some cases, you may want the CPU to remain active even when the screen is off, or you may want to prevent the screen from automatically turning off when performing certain tasks. For this purpose, Google* developers have included so-called sleep locks in the PowerManager API. Applications that need to avoid the device falling asleep can take advantage of this blocking. While the system has an active sleep lock, the device will not be able to “sleep”, that is, go into standby mode (until the lock is removed). When using sleep locks, it is important to understand that you need to properly remove these locks when they are not needed. Otherwise, the device’s battery will quickly run out: after all, the device will not be able to return to a state of reduced power consumption.

This article describes some Android apps that use sleep locks in Android 4.0. The article also describes the "Wakelocks" application from the SDPSamples set to demonstrate the implementation of sleep locks in code.

Using sleep locks with apps

On an Android system, you can see which services are holding sleep locks and preventing the system from entering one of the power saving modes. The file /proc/wakelocks on the device contains a list of services and drivers that use sleep locks. By monitoring the contents of the /sys/power/wake_lock file (requires root access), you can see if there is a CPU lock and which service is holding the wakelock2 lock. I was able to record several cases of using locks on my Galaxy Nexus smartphone running Android 4.0:

Table: Using sleep locks with stock Android apps

The YouTube and Music apps are good examples of using sleep blocking at various levels. The YouTube app takes over the sleep lock while the user is watching a streaming video. During the entire video playback, the screen remains on (regardless of the screen parameters set in the system). But if the user presses the power button during playback, the device will go into sleep mode: the screen will turn off and audio and video playback will stop. The Music app uses a different sleep lock when playing audio. The screen settings do not change, so the device screen will turn off as configured. But even when the screen is off, sleep lock will prevent the CPU from turning off so that music playback continues even if the user presses the power button.

Selecting the lock type

Before you start writing sleep lock code, you need to understand what types of sleep locks there are so that you can choose the most appropriate type to use in your application. The Android PowerManager API describes the various lock flags available that change the device's power state:

Flag meaningCPUScreenKeyboard backlight
PARTIAL_WAKE_LOCKOnOffOff
SCREEN_DIM_WAKE_LOCKOnDarkenedOff
SCREEN_BRIGHT_WAKE_LOCKOnFull brightnessOff
FULL_WAKE_LOCKOnFull brightnessFull brightness

Table: From the Android PowerManager API.

Please note that sleep locks significantly reduce the battery life of Android devices, so sleep locks should not be used if you can do without them. If possible, they should be removed as soon as possible.

An app that uses sleep blocking must request specific permission to do so. This is accomplished by applying the android.permission.WAKE_LOCK permission in the application manifest file. This means that even if a user installs a sleep blocking app using Google Play, users will receive a warning that the app contains components that may prevent the phone from sleeping. If you want to prevent the screen from dimming during a specific application action, you can do this in a way that does not require special permission. WindowManager has a variable, FLAG_KEEP_SCREEN_ON, that can be set if the application's View method needs to keep the screen on. It is recommended to use this approach for screen control, since its impact occurs only within the application. When the user switches to another application, WindowManager removes the sleep lock.

Keeping the screen on (from the SDPSamples set)

The WakeLock application from the SDPSamples demonstrates that the application can keep the screen on using the Window Manager, without writing sleep lock code. Launch the WakeLock application and select the "Win Man Screen On" list item.

As long as the button status bar displays the text “Screen is LOCKED,” the screen will be on. If the status bar of the button contains the text “Screen is UNLOCKED”, then after 5 seconds of inactivity the screen will turn off.

In code, this is done by the screenLockUpdateState() function in WakeLockActivity.java by setting and clearing FLAG_KEEP_SCREEN_ON for the current window each time the button is pressed and the state changes.

Public void screenLockUpdateState() ( if (mIsDisplayLocked) ( ... // update display state getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); ) else ( ... // update display state getWindow().clearFlags(WindowManager .LayoutParams.FLAG_KEEP_SCREEN_ON); ) )

Implementation of sleep blocking

The WakeLock application from the SDPSamples set implements various types of sleep locks. After launching the WakeLock application, select one of 4 types of sleep locks: Power Wake Lock Full, Power Wake Lock Bright, Power Wake Lock Dim and Power Wake Lock Partial. These 4 options correspond to the 4 sleep lock flags described in the PowerManager API. Each element demonstrates the device's response to an attempt to turn off the screen after 5 seconds.

By monitoring the contents of the /sys/power/wake_lock file (requires root access), you can see that only the PARTIAL_WAKE_LOCK sleep lock is retained after pressing the power button. Other sleep locks do not allow you to turn off the screen completely: it continues to work at one or another brightness level.

When writing code for sleep locks, you must first request permission to use them in your AndroidManifest.xml manifest:

You can then create a WakeLock object containing the acquire() and release() functions to manage sleep locking. A good example is in the WakeLockActivity.java file:

Public void onCreate(Bundle savedInstanceState) ( ... mPowerManager = (PowerManager) getSystemService(Context.POWER_SERVICE); ... mWakeLock = mPowerManager. newWakeLock(mWakeLockState, "UMSE PowerTest"); if (mWakeLock != null) ( mWakeLock. acquire(); ... ) protected void onDestroy() ( if (mWakeLock != null) ( mWakeLock.release(); mWakeLock = null; ) ... )

Conclusion

Sleep Lock is an Android system feature that allows developers to change the default power state of a device. The danger of using sleep locks in apps is that they drain your batteries prematurely. Some clear benefits of sleep locks are evident in a number of standard Google apps, such as navigation or music and video playback. Each application developer must make their own decision about whether sleep blocking is appropriate.

about the author

Christopher Bird began his career at Intel SSG in 2007 and is involved in building the Atom ecosystem of phones and tablets.

Reference materials

2 LWN – “Wakelocks and the embedded problem”: http://lwn.net/Articles/318611/

Notes

THE INFORMATION IN THIS DOCUMENT IS PROVIDED FOR INTEL PRODUCTS ONLY. NO EXPRESS OR IMPLIED LICENSE, ELIGIBILITY OR OTHER INTELLECTUAL PROPERTY RIGHT IS GRANTED HEREIN. EXCEPT AS PROVIDED IN THE TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ACCEPTS NO LIABILITY FOR AND DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, WITH RESPECT TO THE SALE AND/OR USE OF ITS PRODUCTS, INCLUDING LIABILITY OR WARRANTY AI REGARDING THEIR FITNESS FOR A PARTICULAR PURPOSE, PROFIT OR INFRINGEMENT -EITHER PATENTS, COPYRIGHTS OR OTHER INTELLECTUAL PROPERTY RIGHTS.

EXCEPT AS AGREED IN WRITING BY INTEL, INTEL PRODUCTS ARE NOT INTENDED FOR USE IN SITUATIONS WHERE FAILURE COULD RESULT IN INJURY OR DEATH.

Intel reserves the right to change the specifications and descriptions of its products without notice. Designers should not rely on missing characteristics, or characteristics marked “reserved” or “unspecified.” These features are reserved by Intel for future use and are not guaranteed to have no compatibility conflicts. The information in this document is subject to change without notice. Do not use this information in the final design.

The products described in this document may contain errors or inaccuracies which may cause actual product specifications to differ from those described herein. Already identified errors can be provided upon request. Please obtain the latest specifications from your local Intel sales office or local distributor before placing your order.

Numbered copies of documents referenced in this document, as well as other Intel materials, can be ordered by calling 1-800-548-4725 or downloaded from http://www.intel.com/design/literature.htm

The software and loads used in benchmark tests may have been optimized to achieve high performance on Intel microprocessors. Performance tests such as SYSmark and MobileMark are performed on specific computer systems, components, programs, operations and functions. Any changes to any of these elements may change the results. When selecting the products you purchase, you should consult other information and performance tests, including tests of the performance of a particular product in combination with other products.

This document and the software described herein are provided under a license and may be used and distributed only in accordance with the terms of the license.

Intel® and the Intel logo are trademarks of Intel Corporation in the United States and other countries.

© Intel Corporation, 2012. All rights reserved.

*Other names and trademarks may be the property of third parties.

Share