1

Due to increased battery drain I figured I should probably come up with a solution that will allow me to block access for certain apps during certain hours while the only data connectivity available is the mobile connection.

For example: I don't really care if someone is messaging me via LinkedIn during night time so it's probably better not to check. Or if I'm not over obsessed with who is messaging me via OkCupid I would probably want to increase the check interval for that app to check for new data only once an hour or 3 hours. Blocking Facebook push notifications during work hours is pretty much reasonable as another example.

I've been looking at solutions such as AWall+ and although I could figure how to block data I could find any simple method of defining time range for that operation.

I was also thinking of a possibility to block access for half an hour after a fetch, this way the interval will change to a half an hour minimum causing the battery to drain less.

Do you guys know of any existing app or Tasker script? (My phone is rooted) Thanks in advance!

0

AFWall+ allows creation of multiple profiles and the profiles can be toggled using Tasker. I'm giving you a basic idea now.

  1. Enable multi-profile support in AFWall+. It's inside the Preferences.
  2. For nighttime, create a profile and allow or disallow the apps which you want/don't want to connect to Internet or to a particular network interface.

    (Click image to enlarge)

    IMG:

  3. Once done, create a task in Tasker with the action Plugin → AFWall+ → Configuration → choose your profile.

Now it is up to you how you want this task to be executed. The best option is to create a time triggered profile and assign the task to it. This technique would work for office hours as well.

I was also thinking of a possibility to block access for half an hour after a fetch...

This can be done too, now that you've got the idea about AFWall+ profiles.

Consider this example: If it is about two profiles to be switched after an interval, I would roughly use these actions in a task:

  1. Select an AFWall+ profile of your choice under Plugins
  2. Task → Wait and make it 30 minutes
  3. Select another AFWall+ profile to be triggered
  4. Add Wait of another 30 minutes
  5. Task → Goto → and choose first action.

You just created an endless task. Attach it to a time triggered profile or any profile of your choice.

In order to stop that infinitely looping task, create another task and use the action Task → Stop → choose the task to be stopped. You've to execute this task of course.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.