Why is Jobscheduler running without the cell phone is charging?

Asked

Viewed 60 times

0

I made an application using the class Jobscheduler that has now come in the Lolipop api.

I won’t go into detail about the structure of the application because it is running and working properly.

My point is about an option that exists in the construction of a Jobscheduler:

To create a Job you must know that the Jobinfo.Builder where the option exists setRequiresCharging()...

Anyway, my application creates these Obs, in fact the application is nothing more than a registration screen of Obs... I created two Jobs one just to run with it loading and the other without it loading. It rotates every 2 minutes that Job he needs to be carrying.

The problem is that it runs both tasks with the phone out of the charger. I’m running this on a Nexus 5 with android 6 already.

Does anyone know why he runs a Job that was created with the setRequiresCharging as true even with the mobile not charging?

UPDATING

The way I have to check if Job is running is by creating a notification with the precise time it ran, each job has its notification and manages it, default scheme of if it doesn’t exist it creates and displays, if it is already being displayed it updates the time of execution, this is working perfectly.

1 answer

1

I found the problem with this class.

That one Issue is open for a year and it seems that it has not yet been resolved.

As soon as I have an update on the date of a possible update I will edit this question with the solution.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.