title: How whatsapp tracks location when app is closed with permission "use location while app is in use"
body: <p>I recently built an Android app that tracks location in the background even when the app is closed.
  I used Services that fetch location in native Android which runs continuously even when app is closed with the permission of location as &quot;Allow all the time&quot; is required. It makes sense.</p>
  <p>but when I checked the permission of the Whatsapp when share live location for an hour is enabled I see the permission of location as &quot;Only while app is in use&quot;. Whatsapp can be closed and live location sharing works.</p>
  <p>How is possible with &quot;Only while app is in use&quot; to fetch location when app is closed in Android.</p>