AutoLocation Geofences on Android 8 Oreo not working

Discussion in 'AutoApps' started by Stokesy, Sep 20, 2017.

  1. Stokesy

    Stokesy New Member

    Joined:
    Sep 15, 2017
    Messages:
    4
    Likes Received:
    0
    Since upgrading to Android 8 (on both a Google Pixel and Nexus 5X) Geofences and Location Monitor have been pretty hit and miss...mostly miss!

    On Androind 7 they were working great, with Geofences consistently tracking my location so, when entering a zone, Tasker could then set Location Monitor to "High Accuracy" mode to know when I arrived home for Home Assistant. (Like you did for the shopping list in your video). Now though I'm often arriving at the middle of my 1000m Geofence but AutoLocation still thinks I'm outside it; I have to edit the Geofence in AutoLocation for it to update.

    Also, when Tasker runs a task to get a 'Balanced' update from Location Monitor it sometimes throws this error now:
    20.24.24/ActionArgBundle key: SmallestDisplacement: replace <null> String value with null
    20.24.24/ActionArgBundle key: LocationReportName: replace <null> String value with null
    20.24.24/ActionArgBundle key: ExpirationDuration: replace <null> String value with null
    20.24.24/ActionArgBundle key: NumberOfUpdates: replace <null> String value with null
    20.24.24/ActionArgBundle key: Interval: replace <null> String value with null
    20.24.24/ActionArgBundle AutoLocation Location: ExpirationDuration: ignored replacement specified for null value
    20.24.24/ActionArgBundle AutoLocation Location: Interval: ignored replacement specified for null value
    20.24.24/ActionArgBundle AutoLocation Location: NumberOfUpdates: ignored replacement specified for null value
    20.24.24/ActionArgBundle AutoLocation Location: SmallestDisplacement: ignored replacement specified for null value
    20.24.24/ActionArgBundle AutoLocation Location: LocationReportName: ignored replacement specified for null value
    20.24.24/E FIRE PLUGIN: AutoLocation Location / com.twofortyfouram.locale.intent.action.FIRE_SETTING: 12 bundle keys
    20.24.24/E AutoLocation Location: plugin comp: com.joaomgcd.autolocation/com.joaomgcd.autolocation.broadcastreceiver.BroadcastReceiverRequestActivityReport
    20.24.24/E add wait type Plugin1 time 60
    20.24.24/E add wait type Plugin1 done
    20.24.24/E add wait task
    20.25.24/E Error: null​

    Setting 'continue on error' and adding another task to flash %errmsg (as per another thread) has never displayed an actual error though - just a red dot next to my AutoLocation task?

    I've been running the beta version of AutoLocation for several days now with no noticeable change.

    AutoLocation is also set to 'run in the background when not in use', and is not 'battery optimised'.

    Please let me know if I can get any more data to help... and thanks for your apps and time.
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Hi there. Google have performed a number of "optimizations" to their system in Android O, so maybe this was one of them :(
    Is this maybe the issue you're experiencing?
     
  3. Stokesy

    Stokesy New Member

    Joined:
    Sep 15, 2017
    Messages:
    4
    Likes Received:
    0
    Thanks for getting back to me. Yes I'm sure lots of changes!

    Confirmed my Google app version is OK (7.10.35.21.arm64) but cleared the data just in case and will test today.

    I don't think it's this though as other tasks appear to execute without problems and if, inside a Geofence that hasn't triggered, I open the AutoLocation app and edit the GeoFence the "inside" status updates and Tasker kicks in and runs my tasks. So my main problem seems specific to AutoLocation and primarily Geofences not getting location updates as often as it used to on Android 7, unless it's in the foreground in map view.
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    But AutoLocation hasn't changed in that regard. The problem is that Google is the one that alerts apps about Geofence updates, so if Google doesn't alert AutoLocation, there's nothing it can do.
    The only way to get around this is to enable the option for the location monitor to help the geofence monitor in the advanced settings and then manage the location monitor updates yourself.
     
  5. CAL701

    CAL701 New Member

    Joined:
    Dec 6, 2016
    Messages:
    9
    Likes Received:
    0
    I've finally got an Oreo ROM available for my phone and am wanting to upgrade. But, Autolocation for presence-sensing is mandatory (on Marshmallow now and is GREAT!). Have these issues, which I've heard here and on the Smartthings forums, been investigated? Is Oreo a known for-sure problem or might it be hit-and-miss and with trying? Thank you.
     
    Last edited: Nov 21, 2017
  6. Stokesy

    Stokesy New Member

    Joined:
    Sep 15, 2017
    Messages:
    4
    Likes Received:
    0
    I haven't used AutoLocation since Sept given the problems but another app has been working well for GeoLocation triggers.
     
  7. CAL701

    CAL701 New Member

    Joined:
    Dec 6, 2016
    Messages:
    9
    Likes Received:
    0
    Thanks for the info. Do you have a link to that app? Does it work with Tasker?
     
  8. breakthestatic

    breakthestatic New Member

    Joined:
    Oct 17, 2017
    Messages:
    10
    Likes Received:
    0
    Yes, if you could let us know what you're doing to get around this on Oreo it'd be a huge help. I haven't been able to use my home automation presence detection since upgrading to Oreo, and it seems that Joao isn't very interested in making the changes to get it working reliably on 8.x.
     
  9. breakthestatic

    breakthestatic New Member

    Joined:
    Oct 17, 2017
    Messages:
    10
    Likes Received:
    0
    I found a URL (https://developer.android.com/about/versions/oreo/background-location-limits.html) that explains are the cause of the geofencing issues in Oreo with AutoLocation. @joaomgcd, can you look into implementing your app w/ a foreground service (at least as an option maybe?). Users could still block the ongoing notification if it's an annoyance in the notification area. Doing this would allow the service to run in the foreground without having a visible activity on-screen. I have a URL available, but seems I can't post it here without moderator approval

    I just purchased auto-location and upgraded to Oreo on my OnePlus 3T, but can't use your plugin anymore due to these Android changes. Let me know if you would like any further info to help bring the app into compatibility with 8.0/Oreo.
     
  10. CAL701

    CAL701 New Member

    Joined:
    Dec 6, 2016
    Messages:
    9
    Likes Received:
    0
    @joaomgcd Can you elaborate on your recommendation? Does the Android Developer article (that @breakthestatic quoted) provide any potential resolution to the Oreo problem with Autolocation?

    I also found this recommendation:
    https://www.xda-developers.com/android-oreo-background-location-whitelist/

    that basically says it is possible to whitelist apps with (either adb unrooted or from an Android Terminal window with superuser permissions) a command of the form:

    Code (Text):
    settings put global location_background_throttle_package_whitelist "appname"
    OR
    Code (Text):
    settings put global location_background_throttle_package_whitelist "package1,package2,package3"
    I'm trying:
    Code (Text):
    settings put global location_background_throttle_package_whitelist "com.joaomgcd.autolocation"
    As far as I can tell, it's not working as advertised. If I move through several geofences, with Autolocation in the background there is a several-minute delay. I'm not sure if Tasker should also be on the whitelist, but I've tried the form of two apps separated by a comma and don't see any improvement. @joaomgcd Can you give your opinion as to whether this whitelist approach is valid, and if so, what applications should be on the list.
     
  11. Hcaserty

    Hcaserty New Member

    Joined:
    Nov 16, 2017
    Messages:
    7
    Likes Received:
    0
    Maybe it just want you to root your Android version , if you want
     
  12. CAL701

    CAL701 New Member

    Joined:
    Dec 6, 2016
    Messages:
    9
    Likes Received:
    0
    Thanks for jumping in. You're suggestion was not directed to me, but I'll answer. In my case, the phone is rooted, so that alone is not making a difference. But I'd appreciate any advice as to what I can do with a rooted phone to restore the responsiveness that Autolocation had before Oreo.
     
  13. CAL701

    CAL701 New Member

    Joined:
    Dec 6, 2016
    Messages:
    9
    Likes Received:
    0
    @joaomgcd It looks to me, but I'm not sure, that I have a post (would be Post #10 in this thread) that is awaiting moderator approval. I'm not sure why, when other posts (like the one immediately above) from me are sent OK. The one in question is a little longer and has a link - maybe that's it.

    Anyway, the subject is Autolocation and Oreo and whitelisting Autolocation. Can you look and give us your opinion? Many thanks.
     
  14. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Sorry about that. The spam filter catches anything with a link in it...
    Yeah, that could potentially solve it.
    The way to really fix it will be if I add a foreground service that gets the locations more often. Sorry but right now my hands are full with the whole accessibility issues. I'll try to get back to AutoLocation as soon as I can!
     
  15. CAL701

    CAL701 New Member

    Joined:
    Dec 6, 2016
    Messages:
    9
    Likes Received:
    0
    Thank you very much. I realized this was hitting you at a time when you were very busy, so I appreciate you keeping this on your TO-DO list.

    As far as I can tell, the whitelisting does not work. It would seem the foreground service is the only approved Android technique. Please do implement thus whenever you can. Thank you again.
     
  16. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    Thank you for letting me know. I'll definitely try foreground service then!
     
    breakthestatic and CAL701 like this.
  17. breakthestatic

    breakthestatic New Member

    Joined:
    Oct 17, 2017
    Messages:
    10
    Likes Received:
    0
    Hey @joaomgcd, is there any update for running autolocation as a foreground service? It's bee a while since I upgraded to Oreo and really miss my integrations that utilize this plugin. If you need any help testing or debugging the change I'd be more than happy to assist!
     
  18. CAL701

    CAL701 New Member

    Joined:
    Dec 6, 2016
    Messages:
    9
    Likes Received:
    0
    I've backed off to Nougat, so I'm not in a position to help. But Autolocation is the only thing holding me from Oreo, so I'm morally supportive of @breakthestatic's request.
     
  19. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,479
    Likes Received:
    806
    CAL701 likes this.
  20. destructure00

    destructure00 New Member

    Joined:
    Dec 31, 2016
    Messages:
    5
    Likes Received:
    0
    I've been having the Android O issues. Downloading now, will give it a workout when I get home this evening.
     

Share This Page