title: Remove background location access on Android
body: <p>I am using <code>react-native-geolocation-service</code> to fetch the location of the user. On iOS it is easy to just ask for location access when the app is in the foreground, you just skip adding background location access as a capability. However, I don't understand how you remove this permission on Android. I don't have the <code>ACCESS_BACKGROUND_LOCATION</code> permission set and I'm still getting the option &quot;Allow all the time&quot; on e.g. my Pixel 2.</p>
  <p>This is the code I am using to fetch the location of the user:</p>
  <pre><code>const getCurrentPosition = async (onSuccess, onError) =&gt; {
    if (Platform.OS === 'android') {
      const granted = await PermissionsAndroid.request(
        PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
        {
          title: 'My title',
          message: 'My message',
          buttonPositive: 'Continue',
        }
      );
      if (granted !== PermissionsAndroid.RESULTS.GRANTED) {
        onError();
        return;
      }
    }
    Geolocation.getCurrentPosition(
      (result) =&gt; {
        const position = {
          longitude: result.coords.longitude,
          latitude: result.coords.latitude,
        };
        onSuccess(position);
      },
      (error) =&gt; {
        onError();
      },
      { enableHighAccuracy: true, maximumAge: 10000, timeout: 15000 }
    );
  };
  </code></pre>