@Test(expected = NullPointerException.class) public void getLastLocationNullCallback() { engine.getLastLocation(null); }
@SuppressLint("MissingPermission") @Override public void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback) throws SecurityException { GoogleLastLocationEngineCallbackTransport transport = new GoogleLastLocationEngineCallbackTransport(callback); fusedLocationProviderClient.getLastLocation().addOnSuccessListener(transport).addOnFailureListener(transport); }
GoogleLocationEngineImpl implements LocationEngineImpl<LocationCallback> { @SuppressLint("MissingPermission") @Override public void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback) throws SecurityException { GoogleLastLocationEngineCallbackTransport transport = new GoogleLastLocationEngineCallbackTransport(callback); fusedLocationProviderClient.getLastLocation().addOnSuccessListener(transport).addOnFailureListener(transport); } }
GoogleLocationEngineImpl implements LocationEngineImpl<LocationCallback> { @SuppressLint("MissingPermission") @Override public void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback) throws SecurityException { GoogleLastLocationEngineCallbackTransport transport = new GoogleLastLocationEngineCallbackTransport(callback); fusedLocationProviderClient.getLastLocation().addOnSuccessListener(transport).addOnFailureListener(transport); } @VisibleForTesting  GoogleLocationEngineImpl(FusedLocationProviderClient fusedLocationProviderClient);   GoogleLocationEngineImpl(@NonNull Context context); }
GoogleLocationEngineImpl implements LocationEngineImpl<LocationCallback> { @SuppressLint("MissingPermission") @Override public void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback) throws SecurityException { GoogleLastLocationEngineCallbackTransport transport = new GoogleLastLocationEngineCallbackTransport(callback); fusedLocationProviderClient.getLastLocation().addOnSuccessListener(transport).addOnFailureListener(transport); } @VisibleForTesting  GoogleLocationEngineImpl(FusedLocationProviderClient fusedLocationProviderClient);   GoogleLocationEngineImpl(@NonNull Context context); @NonNull @Override LocationCallback createListener(LocationEngineCallback<LocationEngineResult> callback); @SuppressLint("MissingPermission") @Override void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback); @SuppressLint("MissingPermission") @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     @NonNull LocationCallback listener,
                                     @Nullable Looper looper); @SuppressLint("MissingPermission") @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     @NonNull PendingIntent pendingIntent); @Override void removeLocationUpdates(@NonNull LocationCallback listener); @Override void removeLocationUpdates(PendingIntent pendingIntent); }
GoogleLocationEngineImpl implements LocationEngineImpl<LocationCallback> { @SuppressLint("MissingPermission") @Override public void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback) throws SecurityException { GoogleLastLocationEngineCallbackTransport transport = new GoogleLastLocationEngineCallbackTransport(callback); fusedLocationProviderClient.getLastLocation().addOnSuccessListener(transport).addOnFailureListener(transport); } @VisibleForTesting  GoogleLocationEngineImpl(FusedLocationProviderClient fusedLocationProviderClient);   GoogleLocationEngineImpl(@NonNull Context context); @NonNull @Override LocationCallback createListener(LocationEngineCallback<LocationEngineResult> callback); @SuppressLint("MissingPermission") @Override void getLastLocation(@NonNull LocationEngineCallback<LocationEngineResult> callback); @SuppressLint("MissingPermission") @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     @NonNull LocationCallback listener,
                                     @Nullable Looper looper); @SuppressLint("MissingPermission") @Override void requestLocationUpdates(@NonNull LocationEngineRequest request,
                                     @NonNull PendingIntent pendingIntent); @Override void removeLocationUpdates(@NonNull LocationCallback listener); @Override void removeLocationUpdates(PendingIntent pendingIntent);  }