Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "PowerManger.FULL_WAKE_LOCK is deprecated" mean?

I have this code:

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

And the FULL_WAKE_LOCK is crossed out and it's saying "PowerManger.FULL_WAKE_LOCK is deprecated". The code is working. But what does it mean exactly? And can it evoke any problems?

like image 886
silvia_aut Avatar asked Sep 24 '13 07:09

silvia_aut


2 Answers

Deprecation means that the feature may be removed in future versions of Android, or that an alternative has been added. It's not removed immediately to ensure backwards compatibility and to give you time to comply with the new standard.

Which is, according to the documentation:

"Most applications should use FLAG_KEEP_SCREEN_ON instead of this type of wake lock, as it will be correctly managed by the platform as the user moves between applications and doesn't require a special permission."

So it won't cause any problems now, but in future versions of Android, it may. You can read more about deprecation here.

like image 138
ashatte Avatar answered Nov 14 '22 00:11

ashatte


You can find more information about it by clicking here. It has everything detailed about what feature does. It won't cause any problems for the current versions but in the future It might.

like image 27
Shaun Avatar answered Nov 14 '22 01:11

Shaun