@Test public void await_shouldReturnNetworkUsableIfNetworkEnabled() { when(locationManager.isProviderEnabled(LocationManager.NETWORK_PROVIDER)).thenReturn(true); when(pm.hasSystemFeature(PackageManager.FEATURE_LOCATION_NETWORK)).thenReturn(true); when(pm.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)).thenReturn(true); when(pm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH_LE)).thenReturn(true); LocationSettingsResult result = resultRequest.await(); assertThat(result.getStatus().getStatusCode()).isEqualTo(Status.RESOLUTION_REQUIRED); assertThat(result.getLocationSettingsStates().isGpsPresent()).isTrue(); assertThat(result.getLocationSettingsStates().isGpsUsable()).isFalse(); assertThat(result.getLocationSettingsStates().isNetworkLocationPresent()).isTrue(); assertThat(result.getLocationSettingsStates().isNetworkLocationUsable()).isTrue(); assertThat(result.getLocationSettingsStates().isLocationPresent()).isTrue(); assertThat(result.getLocationSettingsStates().isLocationUsable()).isTrue(); assertThat(result.getLocationSettingsStates().isBlePresent()).isTrue(); assertThat(result.getLocationSettingsStates().isBleUsable()).isTrue(); }
@NonNull @Override public LocationSettingsResult await() { return generateLocationSettingsResult(); }
LocationSettingsResultRequest extends PendingResult<LocationSettingsResult> { @NonNull @Override public LocationSettingsResult await() { return generateLocationSettingsResult(); } }
LocationSettingsResultRequest extends PendingResult<LocationSettingsResult> { @NonNull @Override public LocationSettingsResult await() { return generateLocationSettingsResult(); } LocationSettingsResultRequest(Context context, PendingIntentGenerator generator,
      LocationSettingsRequest request); }
LocationSettingsResultRequest extends PendingResult<LocationSettingsResult> { @NonNull @Override public LocationSettingsResult await() { return generateLocationSettingsResult(); } LocationSettingsResultRequest(Context context, PendingIntentGenerator generator,
      LocationSettingsRequest request); @NonNull @Override LocationSettingsResult await(); @NonNull @Override LocationSettingsResult await(long time, @NonNull TimeUnit timeUnit); @Override void cancel(); @Override boolean isCanceled(); @Override void setResultCallback(@NonNull ResultCallback<? super LocationSettingsResult> callback); @Override void setResultCallback(@NonNull ResultCallback<? super LocationSettingsResult> callback,
      long time, @NonNull TimeUnit timeUnit); }
LocationSettingsResultRequest extends PendingResult<LocationSettingsResult> { @NonNull @Override public LocationSettingsResult await() { return generateLocationSettingsResult(); } LocationSettingsResultRequest(Context context, PendingIntentGenerator generator,
      LocationSettingsRequest request); @NonNull @Override LocationSettingsResult await(); @NonNull @Override LocationSettingsResult await(long time, @NonNull TimeUnit timeUnit); @Override void cancel(); @Override boolean isCanceled(); @Override void setResultCallback(@NonNull ResultCallback<? super LocationSettingsResult> callback); @Override void setResultCallback(@NonNull ResultCallback<? super LocationSettingsResult> callback,
      long time, @NonNull TimeUnit timeUnit);  }