Ahmad Ali
Ahmad Ali

Reputation: 23

Does we need to hold wake lock programmatically for work manager or work manager do it by itself?

I am new to work manager and I want to know that if we use OneTimeWorkManager so does we need to hold wake lock programmatically or work manager did it by itself. Please guide me

Thanks in advance

Upvotes: 2

Views: 864

Answers (2)

pfmaggi
pfmaggi

Reputation: 6496

Using WorkManager adds the Wakelock permission to your AndroidManifest.xml as the library will use it as needed.

You can use the Background Task Inspector to see the active wakelocks.

Please refer to WorkManager's source code for additional information.

Upvotes: 1

AmirMohamamd
AmirMohamamd

Reputation: 412

WorkManager does not need wake lock to work.

Always works in background without wake lock

Upvotes: 3

Related Questions