title: Location Service on Android 10
body: <p>I am trying to get lat long after some intervals using FusedLocationProviderClient. I have created a service which runs in background. But the issue is that when my device is locked (Screen is off) the device sends about 3-5 lat long and then stops in Android 10 (was working fine in Android 9 and Previous versions). Did Android 10 had some changes/Updates which is stopping me from getting location updates. Any help will be grateful</p>
  
  <p>Menifest.xml</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.FOREGROUND_SERVICE" /&gt;
  
  &lt;service android:enabled="true" android:name=".LocationService"&gt;
  &lt;/service&gt;
  </code></pre>
  
  <p>LocationService.java</p>
  
  <pre><code>public void requestLocationUpdates() {
      mLocationRequest = new LocationRequest();
      mLocationRequest.setInterval(UPDATE_INTERVAL); // two minute interval
      mLocationRequest.setFastestInterval(FASTEST_INTERVAL);
  
      mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
      if (ContextCompat.checkSelfPermission(this,
              Manifest.permission.ACCESS_FINE_LOCATION)
              == PackageManager.PERMISSION_GRANTED) {
          mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());
      }
  }
  
  LocationCallback mLocationCallback = new LocationCallback(){
      @Override
      public void onLocationResult(LocationResult locationResult) {
  
  
          for (Location location : locationResult.getLocations()) {
  
              Log.e("mLocationCallbackLat", String.valueOf(location.getLatitude()));
              Log.e("mLocationCallbackLong", String.valueOf(location.getLongitude()));
  
          }
  </code></pre>