Code example for Criteria

Methods: setAccuracy

0
 
        resume(); 
 
        Map<PendingIntent, Criteria> locationPendingIntents = shadowLocationManager
                .getRequestLocationUdpateCriteriaPendingIntents(); 
        Criteria criteria = new Criteria();
        criteria.setAccuracy(Criteria.ACCURACY_FINE);
 
        sendBatteryLevelChangedBroadcast(100); 
 
        Intent intent = new Intent(Intent.ACTION_BATTERY_OKAY);
        shadowApp.sendBroadcast(intent);
 
        assertThat("Updates from " + LocationManager.GPS_PROVIDER
                + " provider should be requested when battery power is okay!", 
                locationPendingIntents.containsValue(criteria));
    } 
 
    @Test 
    public void shouldDismissWaitForFixDialogWhenLocationIsAvailable() { 
        shadowLocationManager.setLastKnownLocation(LocationManager.GPS_PROVIDER, null);