onResult() in Awareness.SnapshotApi.getLocation NOT getting called from a Service
<p>I am trying to get location from a background <code>Service</code>. The problem is that the <code>onResult()</code> function inside the <code>Awareness.SnapshotApi.getLocation(mGoogleApiClient).setResultCallback(new ResultCallback&lt;LocationResult&gt;()</code> is NOT getting called. What could be wrong here?</p>

<p>The functions <code>onConnected()</code> and <code>onConnectionSuspended()</code> also are not getting called but when I print out <code>mGoogleApiClient.isConnected() = true</code> is returned.</p>

<p>So I am trying to understand why <code>onConnected()</code> is not getting called either.</p>

<pre><code>public class BlockingService extends Service implements GoogleApiClient.ConnectionCallbacks {
    private GoogleApiClient mGoogleApiClient;

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {

        initAwarenessAPI();
        amIClosetoLocation(&lt;LatLng I get from my database&gt;);

        return START_NOT_STICKY;
    }

    @Override
    public void onDestroy() {

        if (mGoogleApiClient.isConnected()) {
            mGoogleApiClient.disconnect();
        }
        super.onDestroy();
    }

    private void initAwarenessAPI() {
        Context context = getApplicationContext();
        mGoogleApiClient = new GoogleApiClient.Builder(context)
                .addApi(Awareness.API)
                .build();
        mGoogleApiClient.connect();
    }

    private Boolean amIClosetoLocation(final LatLng savedLoc) {
        final String TAG = "Awareness";
        mLog.printToLog(className + Constants.funcStart + MethodName.methodName() + ": Entered Function");
        amIClosetoLocation = false;

        if (ContextCompat.checkSelfPermission(
                getApplicationContext(),
                android.Manifest.permission.ACCESS_FINE_LOCATION) !=
                PackageManager.PERMISSION_GRANTED) {
            mLog.printToLog(className + MethodName.methodName() + ": ***DONT HAVE LOCATION PERMISSION***");
        } else {
            mLog.printToLog(className + MethodName.methodName()
                    + ": Permission Exists -- so now going to get location");

            Awareness.SnapshotApi.getLocation(mGoogleApiClient)
                    .setResultCallback(new ResultCallback&lt;LocationResult&gt;() {
                        @Override
                        public void onResult(@NonNull LocationResult locationResult) {
                            //THIS FUNCTION IS NOT GETTING CALLED
                            if (!locationResult.getStatus().isSuccess()) {
                                Log.e(TAG, "Could not get location.");

                                mLog.printToLog(className + MethodName.methodName() + ": Could NOT get location");

                                return false;
                            } else {
                                mLog.printToLog(className + MethodName.methodName()
                                        + ": Success: Able to send location");
                            }
                            Location currLocation = locationResult.getLocation();

                            mLog.printToLog(className + MethodName.methodName()
                                    + ": Success, Received location = " + currLocation.toString());

                            mLog.printToLog(className + Constants.funcStart + MethodName.methodName() +
                                    ": Got Location = Lat: " +
                                    currLocation.getLatitude() +
                                    ", Lon: " + currLocation.getLongitude());
                        }
                    });
        }


        mLog.printToLog(className + Constants.funcEnd + MethodName.methodName()
                + ": Exiting Function, returning amIClosetoLocation = " + amIClosetoLocation);


        return amIClosetoLocation;
    }


@Override
public void onConnected(@Nullable Bundle bundle) {

    mLog.printToLog(className + Constants.funcStart + MethodName.methodName() + ": Entered Function");


@Override
public void onConnectionSuspended(int i) {

}
}
</code></pre>