Tasker Removing an app from the list of optimization of battery

Discussion in 'Guides / Examples / Ideas Forum' started by Emanuele Cannizzo, Jul 9, 2019.

  1. Emanuele Cannizzo

    Emanuele Cannizzo New Member

    Joined:
    Aug 2, 2018
    Messages:
    6
    Likes Received:
    0
    I have created an app with app factory but some phones put this app in the list optimization of battery, so the app falls asleep and don't work anymore. I know that this problem can be resolved manually but I want a task that do this automatically, for example asking an authorization. Do you know how I can do?
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,355
    Likes Received:
    711
    Send an intent with
    • Action: android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
    • Data: package:YOUR_APPS_PACKAGE_NAME
     
    Frank Tusche likes this.
  3. Emanuele Cannizzo

    Emanuele Cannizzo New Member

    Joined:
    Aug 2, 2018
    Messages:
    6
    Likes Received:
    0
    I have done exactly what you said but don't happen anything when I launch the app. Is it correct in the photo?
     

    Attached Files:

  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,355
    Likes Received:
    711
    Oh, you have to set target to Activity at the bottom too :)
     
  5. Emanuele Cannizzo

    Emanuele Cannizzo New Member

    Joined:
    Aug 2, 2018
    Messages:
    6
    Likes Received:
    0
    I have modified the target to activity but don't work...
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,355
    Likes Received:
    711
    Nothing shows up at all?
     
  7. Emanuele Cannizzo

    Emanuele Cannizzo New Member

    Joined:
    Aug 2, 2018
    Messages:
    6
    Likes Received:
    0
    Nothing
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    8,355
    Likes Received:
    711
    Did you give your app the
    android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
    permission?
     
  9. Emanuele Cannizzo

    Emanuele Cannizzo New Member

    Joined:
    Aug 2, 2018
    Messages:
    6
    Likes Received:
    0
    No, should I send an intent with android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS ?
     
  10. Emanuele Cannizzo

    Emanuele Cannizzo New Member

    Joined:
    Aug 2, 2018
    Messages:
    6
    Likes Received:
    0
    I sent android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS
    with an intent from tasker with the package of my app (I also tried to put first this intent:android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS) and it didn't work.I changed the package with that one of tasker of others apps and it worked perfectly.
     
: #app_factory

Share This Page