What does "PowerManger.FULL_WAKE_LOCK deprecated" mean?

I have this code:

wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, "MyWakeLock"); 

And FULL_WAKE_LOCK crossed out, and he says that "PowerManger.FULL_WAKE_LOCK is out of date." The code is working. But what does that mean? And can this cause any problems?

+7
android powermanager wakelock
source share
4 answers

Obsolescence means that this feature may be removed in future versions of Android or an alternative has been added. It is not removed immediately to ensure backward compatibility and give you time to comply with the new standard.

What matches the documentation :

"Most applications should use FLAG_KEEP_SCREEN_ON instead of this type of tracking lock, as it will be properly managed by the platform as the user moves between applications and does not require special permission."

This way, it will not cause any problems now, but in future versions of Android it may be. You can learn more about depreciation here .

+4
source share

You can learn more about this by clicking here . It has all the detailed descriptions of what it does. This will not cause any problems for current versions, but it may be in the future.

+2
source share

PowerManager.FULL_WAKE_LOCK

This constant was deprecated at API level 17. Most applications should use FLAG_KEEP_SCREEN_ON instead of this type of tracking lock, as it will be properly managed by the platform when the user moves between applications and does not require special permission.

Tow lock level: Ensures that the backlight of the screen and keyboard are on at full brightness.

If the user presses the power button, FULL_WAKE_LOCK will be implicitly released by the system, as a result of which the screen and processor will be turned off. Contrast with PARTIAL_WAKE_LOCK.

+2
source share

According to Wikipedia,

Deprecated Tools "You can still use it, but don’t count on it because we will most likely replace it with something else (or completely remove it) in future releases of the software."

In general terms, this means that there is a better way to do this, and an obsolete method should be avoided. In addition, legacy methods are also not backward compatible and may be removed in future versions.

Developer website clearly states

"The battery life of the device will greatly depend on the use of this API. Do not purchase PowerManager.WakeLocks, if they really do not need you, use the minimum levels and do not forget to release them as soon as possible."

0
source share

All Articles