/** * Do a potential asynchronous query for a system property. * * @param name the name of the value to return. * @return a {@link Future} which can be used to retrieve value of property. Future#get() can * return null if property can not be retrieved. */ @Override public Future<String> getSystemProperty(String name) { return device.getSystemProperty(name); }
@Override public String getProperty(String name) throws IOException, AndroidExecutionException { try { return delegate.getSystemProperty(name).get(); } catch (ExecutionException e) { throw new AndroidExecutionException("Unable to get property '" + name + "' value, not responsive", e); } catch (InterruptedException e) { throw new AndroidExecutionException("Unable to get property '" + name + "' value, not responsive", e); } }
@NonNull @Override public Future<String> getSystemProperty(@NonNull String name) { return iDevice.getSystemProperty(name); }
@Nullable private String getNullableProperty(@NonNull String propertyName) { try { Future<String> property = iDevice.getSystemProperty(propertyName); if (mTimeout > 0) { return property.get(mTimeout, mTimeUnit); } else { return property.get(); } } catch (InterruptedException e) { return null; } catch (ExecutionException e) { return null; } catch (java.util.concurrent.TimeoutException e) { return null; } }
@NonNull @Override public Future<String> getSystemProperty(@NonNull String name) { return iDevice.getSystemProperty(name); }