Lines Matching refs:criteria
33 import android.location.Criteria;
648 public List<String> getProviders(Criteria criteria, boolean enabledOnly) {
651 return _getProvidersLocked(criteria, enabledOnly);
661 private List<String> _getProvidersLocked(Criteria criteria, boolean enabledOnly) {
673 if (criteria != null && !p.meetsCriteria(criteria)) {
689 case Criteria.POWER_LOW:
690 return Criteria.POWER_MEDIUM;
691 case Criteria.POWER_MEDIUM:
692 return Criteria.POWER_HIGH;
693 case Criteria.POWER_HIGH:
694 return Criteria.NO_REQUIREMENT;
695 case Criteria.NO_REQUIREMENT:
697 return Criteria.NO_REQUIREMENT;
707 if (accuracy == Criteria.ACCURACY_FINE) {
708 return Criteria.ACCURACY_COARSE;
710 return Criteria.NO_REQUIREMENT;
808 * Returns the name of the provider that best meets the given criteria. Only providers
810 * returned. If several providers meet the criteria, the one with the best
811 * accuracy is returned. If no provider meets the criteria,
812 * the criteria are loosened in the following sequence:
825 * @param criteria the criteria that need to be matched
829 public String getBestProvider(Criteria criteria, boolean enabledOnly) {
830 List<String> goodProviders = getProviders(criteria, enabledOnly);
835 // Make a copy of the criteria that we can modify
836 criteria = new Criteria(criteria);
839 int power = criteria.getPowerRequirement();
840 while (goodProviders.isEmpty() && (power != Criteria.NO_REQUIREMENT)) {
842 criteria.setPowerRequirement(power);
843 goodProviders = getProviders(criteria, enabledOnly);
850 int accuracy = criteria.getAccuracy();
851 while (goodProviders.isEmpty() && (accuracy != Criteria.NO_REQUIREMENT)) {
853 criteria.setAccuracy(accuracy);
854 goodProviders = getProviders(criteria, enabledOnly);
861 criteria.setBearingRequired(false);
862 goodProviders = getProviders(criteria, enabledOnly);
868 criteria.setSpeedRequired(false);
869 goodProviders = getProviders(criteria, enabledOnly);
875 criteria.setAltitudeRequired(false);
876 goodProviders = getProviders(criteria, enabledOnly);
884 public boolean providerMeetsCriteria(String provider, Criteria criteria) {
889 return p.meetsCriteria(criteria);
1089 public void requestLocationUpdates(String provider, Criteria criteria,
1091 if (criteria != null) {
1095 provider = getBestProvider(criteria, true);
1097 throw new IllegalArgumentException("no providers found for criteria");
1126 public void requestLocationUpdatesPI(String provider, Criteria criteria,
1129 if (criteria != null) {
1133 provider = getBestProvider(criteria, true);
1135 throw new IllegalArgumentException("no providers found for criteria");