Checks if the device has an USB host.
@param context the context.
@return {@code true} if the device has an USB host.
198894
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
    public static boolean hasUsbHostFeature(Context context) {
        return hasUsbHostFeature(context.getPackageManager());
    }
535468
static DeviceInfo initialize(Context context) {
        if (thisInstance_ == null) {
            thisInstance_ = new DeviceInfo(context);
        }
        return thisInstance_;
    }
1039930
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
    public static boolean hasNfcFeature(Context context) {
        return hasNfcFeature(context.getPackageManager());
    }
146948
def get_all_hosting_devices(self, context):
        """"""
        cctxt = self.client.prepare()
        return cctxt.call(context,
                          'get_all_hosting_devices',
                          host=self.host)
924042
@TargetApi(Build.VERSION_CODES.HONEYCOMB_MR2)
    public static boolean hasJazzhandMultiFakeTouchFeature(Context context) {
        return hasJazzhandMultiFakeTouchFeature(context.getPackageManager());
    }
1347349
public static boolean isConnectedToWiFiOrMobileNetwork(Context context) {
    final String service = Context.CONNECTIVITY_SERVICE;
    final ConnectivityManager manager = (ConnectivityManager) context.getSystemService(service);
    final NetworkInfo networkInfo = manager.getActiveNetworkInfo();

    if (networkInfo == null) {
      return false;
    }

    final boolean isWifiNetwork = networkInfo.getType() == ConnectivityManager.TYPE_WIFI;
    final boolean isMobileNetwork = networkInfo.getType() == ConnectivityManager.TYPE_MOBILE;

    if (isWifiNetwork || isMobileNetwork) {
      return true;
    }

    return false;
  }
593884
public Locale inferDeviceLocale(Context context) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
      return context.getResources().getConfiguration().getLocales().get(0);
    } else {
      return context.getResources().getConfiguration().locale;
    }
  }
1373696
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
    public static boolean hasLowLatencyAudioFeature(Context context) {
        return hasLowLatencyAudioFeature(context.getPackageManager());
    }
1172215
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
    public static boolean hasCameraFeatureAtLeastOne(Context context) {
        return hasCameraFeatureAtLeastOne(context.getPackageManager());
    }
689640
@TargetApi(Build.VERSION_CODES.FROYO)
    public static boolean hasNetworkLocationFeature(Context context) {
        return hasNetworkLocationFeature(context.getPackageManager());
    }
763730
private synchronized static boolean isWorkingHost(String host) {
        if (workerHost == null) {
            workerHost = host;
            return true;
        } else {
            return host.equals(workerHost);
        }
    }
1005340
public boolean hasLegacyShards(ByteBuffer context)
    {
        int totalCount = (context.remaining() - headerLength(context)) / STEP_LENGTH;
        int localAndGlobalCount = Math.abs(context.getShort(context.position()));

        if (localAndGlobalCount < totalCount)
            return true; // remote shard(s) present

        for (int i = 0; i < localAndGlobalCount; i++)
            if (context.getShort(context.position() + HEADER_SIZE_LENGTH + i * HEADER_ELT_LENGTH) >= 0)
                return true; // found a local shard

        return false;
    }
245608
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
    public static boolean hasAppWidgetFeature(Context context) {
        return hasAppWidgetFeature(context.getPackageManager());
    }
748990
@TargetApi(Build.VERSION_CODES.GINGERBREAD)
    public static boolean hasBarometerSensorFeature(Context context) {
        return hasBarometerSensorFeature(context.getPackageManager());
    }
937297
@Override
  public boolean isSSPISupported() {
    try {
      /*
       * SSPI is windows-only. Attempt to use JNA to identify the platform. If Waffle is missing we
       * won't have JNA and this will throw a NoClassDefFoundError.
       */
      if (!Platform.isWindows()) {
        LOGGER.log(Level.FINE, "SSPI not supported: non-Windows host");
        return false;
      }
      /* Waffle must be on the CLASSPATH */
      Class.forName("waffle.windows.auth.impl.WindowsSecurityContextImpl");
      return true;
    } catch (NoClassDefFoundError ex) {
      LOGGER.log(Level.WARNING, "SSPI unavailable (no Waffle/JNA libraries?)", ex);
      return false;
    } catch (ClassNotFoundException ex) {
      LOGGER.log(Level.WARNING, "SSPI unavailable (no Waffle/JNA libraries?)", ex);
      return false;
    }
  }
680320
@NonNull
  public static LocationEngine getBestLocationEngine(@NonNull Context context) {
    checkNotNull(context, "context == null");

    boolean hasGoogleLocationServices = isOnClasspath(GOOGLE_LOCATION_SERVICES);
    if (isOnClasspath(GOOGLE_API_AVAILABILITY)) {
      // Check Google Play services APK is available and up-to-date on this device
      hasGoogleLocationServices &= GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context)
        == ConnectionResult.SUCCESS;
    }
    return getLocationEngine(context, hasGoogleLocationServices);
  }
558194
public synchronized boolean isAllowedHost(String host) {
    boolean isIncluded = includes.isEmpty() || includes.contains(host);
    boolean isExcluded = excludes.contains(host);
    return isIncluded && !isExcluded;
  }