public DeviceFeatureMatcher(DeviceSpec deviceSpec) { super(deviceSpec); deviceFeatures = ImmutableSet.copyOf(deviceSpec.getDeviceFeaturesList()); }
ImmutableList.copyOf(deviceSpec.getSupportedAbisList()), deviceSpec.getScreenDensity(), ImmutableList.copyOf(deviceSpec.getDeviceFeaturesList()), properties); device.injectShellCommandOutput( () -> LINE_JOINER.join( deviceSpec.getDeviceFeaturesList().stream() .map(feature -> "feature:" + feature) .collect(toImmutableList())));
@Test public void extractsDeviceFeatures() { FakeDevice fakeDevice = FakeDevice.fromDeviceSpec( "id1", DeviceState.ONLINE, mergeSpecs( density(240), locales("en-US"), abis("x86"), sdkVersion(21), deviceFeatures("com.feature1", "com.feature2"))); FakeAdbServer fakeAdbServer = new FakeAdbServer( /* hasInitialDeviceList= */ true, /* devices= */ ImmutableList.of(fakeDevice)); fakeAdbServer.init(Paths.get("path/to/adb")); DeviceAnalyzer analyzer = new DeviceAnalyzer(fakeAdbServer); DeviceSpec deviceSpec = analyzer.getDeviceSpec(Optional.empty()); assertThat(deviceSpec.getDeviceFeaturesList()).containsExactly("com.feature1", "com.feature2"); }
@Override protected boolean isDeviceDimensionPresent() { return !getDeviceSpec().getDeviceFeaturesList().isEmpty(); }