public void removeUpdates() { if (mGoogleApiClient == null) { return; } mLocationRequestTimeOut.cancel(); if (mGoogleApiClient.isConnected()) { LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this); } }
void requestLocationOrDeliverCurrent() { if (mGoogleApiClient == null) { return; } final Location location = getLastLocation(); if (isLocationAcceptable(location)) { onLocationChanged(location); } else { mLocationRequestTimeOut.start(); LocationServices.FusedLocationApi.requestLocationUpdates( mGoogleApiClient, createLocationRequest(), this); } }