Java Code Examples for com.android.ddmlib.IDevice#HardwareFeature

The following examples show how to use com.android.ddmlib.IDevice#HardwareFeature . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MyDeviceChooser.java    From ADB-Duang with MIT License 5 votes vote down vote up
private static EnumSet<IDevice.HardwareFeature> getRequiredHardwareFeatures(List<UsesFeature> requiredFeatures) {
  // Currently, this method is hardcoded to only search if the list of required features includes a watch.
  // We may not want to search the device for every possible feature, but only a small subset of important
  // features, starting with hardware type watch..

  for (UsesFeature feature : requiredFeatures) {
    AndroidAttributeValue<String> name = feature.getName();
    if (name != null && UsesFeature.HARDWARE_TYPE_WATCH.equals(name.getStringValue())) {
      return EnumSet.of(IDevice.HardwareFeature.WATCH);
    }
  }

  return EnumSet.noneOf(IDevice.HardwareFeature.class);
}
 
Example 2
Source File: GetRequiredHardwareFeaturesCompat.java    From ADBWIFI with Apache License 2.0 5 votes vote down vote up
@Override
// Android studio 1.5 - 2.0-Preview5
protected EnumSet<IDevice.HardwareFeature> getCurrentImplementation() throws Throwable {
    if (new IsWatchFeatureRequiredCompat(facet).get()) {
        return EnumSet.of(IDevice.HardwareFeature.WATCH);
    } else {
        return EnumSet.noneOf(IDevice.HardwareFeature.class);
    }
}
 
Example 3
Source File: GetRequiredHardwareFeaturesCompat.java    From ADBWIFI with Apache License 2.0 5 votes vote down vote up
@Override
// Android studio 1.4 and below
protected EnumSet<IDevice.HardwareFeature> getPreviousImplementation() {
    ManifestInfo manifestInfo = ManifestInfo.get(facet.getModule(), true);
    List<UsesFeature> requiredFeatures = Reflect.on(manifestInfo).call("getRequiredFeatures").get();

    for (UsesFeature feature : requiredFeatures) {
        AndroidAttributeValue<String> name = feature.getName();
        if (name != null && UsesFeature.HARDWARE_TYPE_WATCH.equals(name.getStringValue())) {
            return EnumSet.of(IDevice.HardwareFeature.WATCH);
        }
    }

    return EnumSet.noneOf(IDevice.HardwareFeature.class);
}
 
Example 4
Source File: MyDeviceChooser.java    From ADBWIFI with Apache License 2.0 5 votes vote down vote up
private static EnumSet<IDevice.HardwareFeature> getRequiredHardwareFeatures(List<UsesFeature> requiredFeatures) {
  // Currently, this method is hardcoded to only search if the list of required features includes a watch.
  // We may not want to search the device for every possible feature, but only a small subset of important
  // features, starting with hardware type watch..

  for (UsesFeature feature : requiredFeatures) {
    AndroidAttributeValue<String> name = feature.getName();
    if (name != null && UsesFeature.HARDWARE_TYPE_WATCH.equals(name.getStringValue())) {
      return EnumSet.of(IDevice.HardwareFeature.WATCH);
    }
  }

  return EnumSet.noneOf(IDevice.HardwareFeature.class);
}
 
Example 5
Source File: CanRunOnDeviceCompatBefore2_0.java    From ADBWIFI with Apache License 2.0 4 votes vote down vote up
public CanRunOnDeviceCompatBefore2_0(AndroidVersion myMinSdkVersion, IAndroidTarget myProjectTarget, EnumSet<IDevice.HardwareFeature> myRequiredHardwareFeatures, IDevice device) {
    this.myMinSdkVersion = myMinSdkVersion;
    this.myProjectTarget = myProjectTarget;
    this.myRequiredHardwareFeatures = myRequiredHardwareFeatures;
    this.device = device;
}
 
Example 6
Source File: CanRunOnDeviceCompat.java    From ADBWIFI with Apache License 2.0 4 votes vote down vote up
public CanRunOnDeviceCompat(AndroidVersion myMinSdkVersion, IAndroidTarget myProjectTarget, EnumSet<IDevice.HardwareFeature> myRequiredHardwareFeatures, IDevice device) {
    this.myMinSdkVersion = myMinSdkVersion;
    this.myProjectTarget = myProjectTarget;
    this.myRequiredHardwareFeatures = myRequiredHardwareFeatures;
    this.device = device;
}
 
Example 7
Source File: TestDevice.java    From buck with Apache License 2.0 4 votes vote down vote up
@Override
public boolean supportsFeature(IDevice.HardwareFeature feature) {
  return false;
}