@Test public void removeLocationUpdates_pendingIntent_shouldCallService() throws Exception { PendingIntent callbackIntent = mock(PendingIntent.class); LocationRequest request = LocationRequest.create(); List<LocationRequest> requests = new ArrayList<>(); requests.add(request); when(requestManager.removeLocationUpdates(connectedClient, callbackIntent)). thenReturn(requests); api.removeLocationUpdates(connectedClient, callbackIntent); verify(service).removeLocationUpdates(requests); }
@Override public PendingResult<Status> removeLocationUpdates(LostApiClient client, LocationListener listener) { throwIfNotConnected(client); List<LocationRequest> requests = requestManager.removeLocationUpdates(client, listener); removeLocationUpdatesInternal(requests); boolean hasResult = clientManager.removeListener(client, listener); checkAllListenersPendingIntentsAndCallbacks(); return new SimplePendingResult(hasResult); }
FusedLocationProviderApiImpl extends ApiImpl implements FusedLocationProviderApi, EventCallbacks, ServiceConnection { @Override public PendingResult<Status> removeLocationUpdates(LostApiClient client, LocationListener listener) { throwIfNotConnected(client); List<LocationRequest> requests = requestManager.removeLocationUpdates(client, listener); removeLocationUpdatesInternal(requests); boolean hasResult = clientManager.removeListener(client, listener); checkAllListenersPendingIntentsAndCallbacks(); return new SimplePendingResult(hasResult); } }
FusedLocationProviderApiImpl extends ApiImpl implements FusedLocationProviderApi, EventCallbacks, ServiceConnection { @Override public PendingResult<Status> removeLocationUpdates(LostApiClient client, LocationListener listener) { throwIfNotConnected(client); List<LocationRequest> requests = requestManager.removeLocationUpdates(client, listener); removeLocationUpdatesInternal(requests); boolean hasResult = clientManager.removeListener(client, listener); checkAllListenersPendingIntentsAndCallbacks(); return new SimplePendingResult(hasResult); } FusedLocationProviderApiImpl(FusedLocationServiceConnectionManager connectionManager,
      FusedLocationServiceCallbackManager callbackManager, RequestManager requestManager,
      ClientManager clientManager); }
FusedLocationProviderApiImpl extends ApiImpl implements FusedLocationProviderApi, EventCallbacks, ServiceConnection { @Override public PendingResult<Status> removeLocationUpdates(LostApiClient client, LocationListener listener) { throwIfNotConnected(client); List<LocationRequest> requests = requestManager.removeLocationUpdates(client, listener); removeLocationUpdatesInternal(requests); boolean hasResult = clientManager.removeListener(client, listener); checkAllListenersPendingIntentsAndCallbacks(); return new SimplePendingResult(hasResult); } FusedLocationProviderApiImpl(FusedLocationServiceConnectionManager connectionManager,
      FusedLocationServiceCallbackManager callbackManager, RequestManager requestManager,
      ClientManager clientManager); @Override void onConnect(Context context); @Override void onServiceConnected(IBinder binder); @Override void onDisconnect(); @Override void onServiceConnected(ComponentName name, IBinder binder); @Override void onServiceDisconnected(ComponentName name); boolean isConnecting(); void addConnectionCallbacks(LostApiClient.ConnectionCallbacks callbacks); void connect(Context context, LostApiClient.ConnectionCallbacks callbacks); void disconnect(); boolean isConnected(); @Override Location getLastLocation(LostApiClient client); @Override LocationAvailability getLocationAvailability(LostApiClient client); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationListener listener); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationListener listener, Looper looper); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationCallback callback, Looper looper); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, PendingIntent callbackIntent); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      LocationListener listener); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      PendingIntent callbackIntent); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      LocationCallback callback); @Override PendingResult<Status> setMockMode(LostApiClient client, boolean isMockMode); @Override PendingResult<Status> setMockLocation(LostApiClient client,
      Location mockLocation); @Override PendingResult<Status> setMockTrace(LostApiClient client, String path,
      String filename); Map<LostApiClient, Set<LocationListener>> getLocationListeners(); }
FusedLocationProviderApiImpl extends ApiImpl implements FusedLocationProviderApi, EventCallbacks, ServiceConnection { @Override public PendingResult<Status> removeLocationUpdates(LostApiClient client, LocationListener listener) { throwIfNotConnected(client); List<LocationRequest> requests = requestManager.removeLocationUpdates(client, listener); removeLocationUpdatesInternal(requests); boolean hasResult = clientManager.removeListener(client, listener); checkAllListenersPendingIntentsAndCallbacks(); return new SimplePendingResult(hasResult); } FusedLocationProviderApiImpl(FusedLocationServiceConnectionManager connectionManager,
      FusedLocationServiceCallbackManager callbackManager, RequestManager requestManager,
      ClientManager clientManager); @Override void onConnect(Context context); @Override void onServiceConnected(IBinder binder); @Override void onDisconnect(); @Override void onServiceConnected(ComponentName name, IBinder binder); @Override void onServiceDisconnected(ComponentName name); boolean isConnecting(); void addConnectionCallbacks(LostApiClient.ConnectionCallbacks callbacks); void connect(Context context, LostApiClient.ConnectionCallbacks callbacks); void disconnect(); boolean isConnected(); @Override Location getLastLocation(LostApiClient client); @Override LocationAvailability getLocationAvailability(LostApiClient client); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationListener listener); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationListener listener, Looper looper); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, LocationCallback callback, Looper looper); @Override PendingResult<Status> requestLocationUpdates(LostApiClient client,
      LocationRequest request, PendingIntent callbackIntent); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      LocationListener listener); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      PendingIntent callbackIntent); @Override PendingResult<Status> removeLocationUpdates(LostApiClient client,
      LocationCallback callback); @Override PendingResult<Status> setMockMode(LostApiClient client, boolean isMockMode); @Override PendingResult<Status> setMockLocation(LostApiClient client,
      Location mockLocation); @Override PendingResult<Status> setMockTrace(LostApiClient client, String path,
      String filename); Map<LostApiClient, Set<LocationListener>> getLocationListeners();  }