Home | History | Annotate | Download | only in util

Lines Matching refs:device

18 import com.android.tradefed.device.DeviceNotAvailableException;
19 import com.android.tradefed.device.ITestDevice;
28 * Android device compatibility.
45 /** Returns whether the device build is a user build */
46 public static boolean isUserBuild(ITestDevice device) throws DeviceNotAvailableException {
47 return propertyEquals(device, BUILD_TYPE_PROPERTY, "user");
50 /** Returns whether the device build is the factory ROM */
51 public static boolean isFactoryROM(ITestDevice device) throws DeviceNotAvailableException {
53 return device.getProperty(FIRST_API_LEVEL) == null;
57 public static boolean isDevKeysBuild(ITestDevice device) throws DeviceNotAvailableException {
58 String buildTags = device.getProperty(BUILD_TAGS_PROPERTY);
72 public static int getFirstApiLevel(ITestDevice device) throws DeviceNotAvailableException {
73 String propString = device.getProperty(FIRST_API_LEVEL);
74 return (propString == null) ? device.getApiLevel() : Integer.parseInt(propString);
80 public static String getManufacturer(ITestDevice device) throws DeviceNotAvailableException {
81 return device.getProperty(MANUFACTURER_PROPERTY);
85 public static Map<String, String> getClientIds(ITestDevice device)
88 String queryOutput = device.executeShellCommand(GOOGLE_SETTINGS_QUERY);
104 /** Returns whether the property exists on this device */
105 public static boolean propertyExists(ITestDevice device, String property)
107 return device.getProperty(property) != null;
111 public static boolean propertyEquals(ITestDevice device, String property, String value)
114 return !propertyExists(device, property); // null value implies property does not exist
116 return value.equals(device.getProperty(property));
123 public static boolean propertyMatches(ITestDevice device, String property, String regex)
127 return !propertyExists(device, property);
129 String value = device.getProperty(property);