/ home / Bugs / android gps left on when leaving app /

Android GPS Left On when Leaving App

4:08 pm, August 23, 2016 1,232 641 3.2 @ 200 wpmrate up beachinvasion source
1
Has this been discussed already? If not basically how to reproduce this bug:

  • Go to Tournament Finding page
  • GPS will turn on by default
  • Without leaving the tournament finding page, switch to another app or press Home to go back to launcher
  • GPS remains on in the background


  • The only way to prevent GPS from staying on while Clash Royale is no longer in the foreground is either by remembering to switch away from the tournament finding screen OR by swiping Clash Royale away from recents.


    The screenshot here shows the effect of this bug. Right around 8pm I plug in the phone to charge for a bit. Notice the charging rate and the slope. Next I pick up the phone and go play some Clash Royale for the night (notice the drop in power). After I'm done I accidentally checked the tournament page, and then I pressed Home, and I plugged my phone back in. Notice the reduced charging rate because GPS is left on.

    This should not be the case. If we look at Google Maps, the GPS is on the minute you open the app. However if you press Home or switch to a different app, the GPS will turn off to prevent excessive drainage unless you are actively navigating in the background.

    OS: Android 6.0.1
    Device: Nexus 6P

    Edit: I recorded a video here to demonstrate the bug


    • 0:08 - 0:23: Notice that as I switch to the tournament tab and back to the clan page or my main page, the GPS turns on and off. You can see this in the status bar where there's a notification icon on the top left for the GPS Status app as well as the stock AOSP location icon (the pin in the center)
    • 0:23 - 0:40: You can see here the GPS remains on even though I have pressed the Home button to go to my launcher
    • 0:40 - 0:43: You can see here switching back to CR brings the tournament page back up, and GPS is still on. The minute I swipe to another tab, GPS usage stops.
    • 0:43 - 0:50: Now here we press home again and the GPS is no longer on because the last tab I was on in Clash Royale was NOT the tournament page.
    • 0:50 - 0:57: Once again going back into the app, the tournament tab causes GPS to turn on which remains on yet again after I go back to my launcher.
    • 0:57 - End: Here I open the recents menu. As I swipe Clash Royale away, you see the GPS icons disappear.


    Summary: This is poor behavior where someone's device could have the GPS constantly running. I haven't tested this outdoors as to see what happens if an actual GPS lock is achieved (does the GPS turn off at that point once it achieves a location lock?), but if I'm indoors or at work, my GPS will never lock as I'm in large buildings.

    Also from a developer-perspective, is it really necessary to use GPS? Or is Geolocation using WiFi/cell tower sufficient? It doesn't really make sense to even use the GPS because it's not like there are going to be hundreds of tournaments within a 1 mile radius. I suggest not only fixing the GPS turn-off behavior when the app is in the background but also rethinking of you really need to use excessive battery.
    forum.supercell.net
    4:08 pm, August 23, 2016 1,232 641 source

    Comments

    Chat

    Site Rules

    1. Please be respectful.
    2. Only content directly related to Clash Royale belongs here.
    3. No image macros or memes.
    4. Comments + Content that don't contribute to the discussion or are abusive may be removed.
    5. No sexist, racist or homophobic language.
    6. Posting NSFW material is not allowed.

    Links

    Latest