title: How does FusedLocationProviderClient.getCurrentLocation work? CancellationToken
body: <p>I'm trying to request the current location, and if the task goes wrong, call if location is on.</p>
  <pre><code>private void getCurrentLocation() {
      fusedClient.getCurrentLocation(LocationRequest.PRIORITY_HIGH_ACCURACY, new CancellationToken() {
          @Override
          public boolean isCancellationRequested() {
              return false;
          }
  
          @NonNull
          @Override
          public CancellationToken onCanceledRequested(@NonNull OnTokenCanceledListener onTokenCanceledListener) {
              Log.d(&quot;CurrentLocation&quot;, &quot;CancelRequest&quot;);
              createLocationSettingRequest();
              return null;
          }
      }).addOnSuccessListener(new OnSuccessListener&lt;Location&gt;() {
          @Override
          public void onSuccess(Location location) {
              if (location != null) {
                  Log.d(&quot;CurrentLocation&quot;, location.toString());
                  mapFragment.getMapAsync(MapsActivity.this)
              }
          }
      });
  }
  </code></pre>
  <p>The problem is code in <strong>onCancelationRequested</strong> executes twice; I tried with CancellationTokenSource but I had same results.</p>