Home
last modified time | relevance | path

Searched refs:device (Results 1 – 25 of 233) sorted by relevance

12345678910

/platform_testing/libraries/sts-common-util/host-side/src/com/android/sts/common/
DOverlayFsUtils.java36 import com.android.tradefed.device.DeviceNotAvailableException;
37 import com.android.tradefed.device.ITestDevice;
74 ITestDevice device = test.getDevice(); in makeWritable() local
75 assertNotNull("device not set.", device); in makeWritable()
80 if (!workingDirs.containsKey(device)) { in makeWritable()
82 workingDirs.put(device, dirs); in makeWritable()
84 dirs = workingDirs.get(device); in makeWritable()
96 CommandResult res = device.executeShellV2Command("mount | grep -q " + id); in makeWritable()
102 assertTrue("Can't acquire root for " + device.getSerialNumber(), device.enableAdbRoot()); in makeWritable()
105 String statOut = runAndCheck(device, "stat -c '%U %G %a %C' '" + dir + "'").getStdout(); in makeWritable()
[all …]
DMallocDebug.java24 import com.android.tradefed.device.DeviceNotAvailableException;
25 import com.android.tradefed.device.ITestDevice;
51 private ITestDevice device; field in MallocDebug
58 ITestDevice device, String mallocDebugOption, String processName, boolean isService) in MallocDebug() argument
60 this.device = device; in MallocDebug()
66 device.getProperty(MALLOC_DEBUG_OPTIONS_PROP)); in MallocDebug()
67 CommandUtil.runAndCheck(device, "logcat -c"); in MallocDebug()
71 SystemUtil.withProperty(device, MALLOC_DEBUG_OPTIONS_PROP, mallocDebugOption); in MallocDebug()
73 SystemUtil.withProperty(device, MALLOC_DEBUG_PROGRAM_PROP, processName); in MallocDebug()
78 this.killProcess = ProcessUtil.withProcessKill(device, processName, null); in MallocDebug()
[all …]
DProcessUtil.java21 import com.android.tradefed.device.DeviceNotAvailableException;
22 import com.android.tradefed.device.IFileEntry;
23 import com.android.tradefed.device.ITestDevice;
73 public static Optional<Map<Integer, String>> pidsOf(ITestDevice device, String pgrepRegex) in pidsOf() argument
78 device.executeShellV2Command(String.format("pgrep -f -l %s", pgrepRegex)); in pidsOf()
104 public static Optional<Integer> pidOf(ITestDevice device, String pgrepRegex) in pidOf() argument
106 Optional<Map<Integer, String>> pids = pidsOf(device, pgrepRegex); in pidOf()
123 public static Map<Integer, String> waitProcessRunning(ITestDevice device, String pgrepRegex) in waitProcessRunning() argument
125 return waitProcessRunning(device, pgrepRegex, PROCESS_WAIT_TIMEOUT_MS); in waitProcessRunning()
137 ITestDevice device, String pgrepRegex, long timeoutMs) in waitProcessRunning() argument
[all …]
DSystemUtil.java23 import com.android.tradefed.device.DeviceNotAvailableException;
24 import com.android.tradefed.device.ITestDevice;
42 final ITestDevice device, final String name, final String value) in withProperty() argument
44 final String oldValue = device.getProperty(name); in withProperty()
45 assumeTrue("Could not set property: " + name, device.setProperty(name, value)); in withProperty()
51 device.setProperty(name, oldValue == null ? "" : oldValue)); in withProperty()
66 final ITestDevice device, final String namespace, final String key, String value)
68 String getSettingRes = device.getSetting(namespace, key);
71 device.setSetting(namespace, key, value);
74 device.getSetting(namespace, key),
[all …]
DRootcanalUtils.java62 import com.android.tradefed.device.DeviceNotAvailableException;
63 import com.android.tradefed.device.ITestDevice;
85 ITestDevice device = test.getDevice(); in finished() local
86 assertNotNull("Device not set", device); in finished()
88 device.enableAdbRoot(); in finished()
90 device, "android\\.hardware\\.bluetooth@1\\.1-service\\.sim", 10_000, false); in finished()
91 runAndCheck(device, String.format("rm -rf '%s'", LOCK_FILENAME)); in finished()
92 device.disableAdbRoot(); in finished()
95 device.waitForDeviceAvailable(); in finished()
96 CommandResult res = device.executeShellV2Command("svc bluetooth enable"); in finished()
[all …]
DFridaUtils.java30 import com.android.tradefed.device.DeviceNotAvailableException;
31 import com.android.tradefed.device.ITestDevice;
78 private final ITestDevice device; field in FridaUtils
84 private FridaUtils(ITestDevice device, IBuildInfo buildInfo) in FridaUtils() argument
86 this.device = device; in FridaUtils()
94 fridaAbi = getFridaAbiFor(device); in FridaUtils()
127 device.enableAdbRoot(); in FridaUtils()
129 device.pushFile(localFridaExe, remoteFridaExeName); in FridaUtils()
130 runAndCheck(device, String.format("chmod a+x '%s'", remoteFridaExeName)); in FridaUtils()
132 device.disableAdbRoot(); in FridaUtils()
[all …]
DCommandUtil.java22 import com.android.tradefed.device.DeviceNotAvailableException;
23 import com.android.tradefed.device.ITestDevice;
39 public static CommandResult runAndCheck(ITestDevice device, String cmd) in runAndCheck() argument
41 return runAndCheck(device, cmd, 0); in runAndCheck()
52 public static CommandResult runAndCheck(ITestDevice device, String cmd, int retries) in runAndCheck() argument
59 res = device.executeShellV2Command(cmd); in runAndCheck()
DNativePocMallocDebugAsserter.java19 import com.android.tradefed.device.DeviceNotAvailableException;
20 import com.android.tradefed.device.ITestDevice;
52 public AutoCloseable withAutoCloseable(NativePoc nativePoc, ITestDevice device) in withAutoCloseable() argument
56 device, mallocDebugOptions, mallocDebugOnService.get()); in withAutoCloseable()
59 device, mallocDebugOptions, nativePoc.pocName()); in withAutoCloseable()
DNativePoc.java27 import com.android.tradefed.device.DeviceNotAvailableException;
28 import com.android.tradefed.device.ITestDevice;
238 ITestDevice device = test.getDevice(); in runPocAndAssert() local
240 try (AutoCloseable aPoc = withPoc(test, device); in runPocAndAssert() argument
241 AutoCloseable aRes = withResourcesUpload(device); in runPocAndAssert()
242 AutoCloseable aAssert = asserter().withAutoCloseable(this, device)) { in runPocAndAssert()
254 device.executeShellV2Command( in runPocAndAssert()
273 private AutoCloseable withPoc(final BaseHostJUnit4Test test, final ITestDevice device) in withPoc() argument
276 new PocPusher().setDevice(device).setBuild(test.getBuild()).setAbi(test.getAbi()); in withPoc()
285 device.executeShellV2Command(String.format("chmod 777 '%s'", remoteFile)); in withPoc()
[all …]
DPocPusher.java24 import com.android.tradefed.device.DeviceNotAvailableException;
25 import com.android.tradefed.device.ITestDevice;
40 private ITestDevice device = null; field in PocPusher
63 device.deleteFile(file); in finished()
72 public PocPusher setDevice(ITestDevice device) { in setDevice() argument
73 this.device = device; in setDevice()
135 device.pushFile(localFile, remoteFile); in pushFile()
DNativePocCrashAsserter.java20 import com.android.tradefed.device.DeviceNotAvailableException;
21 import com.android.tradefed.device.ITestDevice;
52 public AutoCloseable withAutoCloseable(NativePoc nativePoc, ITestDevice device) in withAutoCloseable() argument
57 return TombstoneUtils.withAssertNoSecurityCrashes(device, tombstoneConfig); in withAutoCloseable()
/platform_testing/libraries/aupt-lib/src/android/support/test/aupt/
DUiWatchers.java43 final UiDevice device = UiDevice.getInstance(instr); in registerAnrAndCrashWatchers() local
46 device.registerWatcher("AnrWatcher", new UiWatcher() { in registerAnrAndCrashWatchers()
49 UiObject2 window = device.findObject( in registerAnrAndCrashWatchers()
54 postHandler(device); in registerAnrAndCrashWatchers()
61 device.registerWatcher("CrashWatcher", new UiWatcher() { in registerAnrAndCrashWatchers()
64 UiObject2 window = device.findObject( in registerAnrAndCrashWatchers()
69 postHandler(device); in registerAnrAndCrashWatchers()
80 final UiDevice device = UiDevice.getInstance(instr); in removeAnrAndCrashWatchers() local
81 device.removeWatcher("AnrWatcher"); in removeAnrAndCrashWatchers()
82 device.removeWatcher("CrashWatcher"); in removeAnrAndCrashWatchers()
[all …]
/platform_testing/libraries/sts-common-util/host-side/tests/src/com/android/sts/common/
DNativePocTest.java32 import com.android.tradefed.device.ITestDevice;
77 @Mock private ITestDevice device; field in NativePocTest
108 iContext.addAllocatedDevice("device1", device); in setup()
116 when(device.executeShellV2Command(startsWith("chmod "))).thenReturn(SUCCESS_RESULT); in setup()
117 when(device.executeShellV2Command(startsWith("test "))).thenReturn(SUCCESS_RESULT); in setup()
127 when(device.executeShellV2Command(anyString(), anyLong(), any(), anyInt())) in testBasicPocExecution()
133 verify(device) in testBasicPocExecution()
139 verify(device).deleteFile(REMOTE_POC_FILE); in testBasicPocExecution()
140 verifyNoMoreInteractions(device); in testBasicPocExecution()
145 when(device.executeShellV2Command(anyString(), anyLong(), any(), anyInt())) in testPocExecutionWithArgsAndEnvVarsAndTimeout()
[all …]
/platform_testing/libraries/sts-common-util/host-side/src/com/android/sts/common/util/
DUnameVersionHost.java20 import com.android.tradefed.device.DeviceNotAvailableException;
21 import com.android.tradefed.device.ITestDevice;
29 private final ITestDevice device; field in UnameVersionHost
32 public UnameVersionHost(ITestDevice device) { in UnameVersionHost() argument
33 this.device = device; in UnameVersionHost()
43 CommandResult res = CommandUtil.runAndCheck(device, "uname -v"); in getUnameVersion()
/platform_testing/libraries/sts-common-util/sts-sdk/package/sts-test/src/main/java/android/security/sts/
DStsHostSideTestCase.java24 import com.android.tradefed.device.ITestDevice;
40 ITestDevice device = getDevice(); in testWithApp() local
41 device.enableAdbRoot(); in testWithApp()
42 uninstallPackage(device, TEST_PKG); in testWithApp()
44 runAndCheck(device, "input keyevent KEYCODE_WAKEUP"); in testWithApp()
45 runAndCheck(device, "input keyevent KEYCODE_MENU"); in testWithApp()
46 runAndCheck(device, "input keyevent KEYCODE_HOME"); in testWithApp()
/platform_testing/libraries/health/rules/src/android/platform/test/rule/
DBaseOrientationRule.kt97 private val device: UiDevice = constant
113 if (orientation == NATURAL) device.naturalOrientation else orientation in setOrientationOverride()
115 if (device.stableOrientation == expectedOrientation) { in setOrientationOverride()
120 device.stableOrientation == expectedOrientation in setOrientationOverride()
126 if (device.isNaturalOrientation) { in changeOrientation()
127 device.setOrientationLeft() in changeOrientation()
129 device.setOrientationNatural() in changeOrientation()
135 return device.stableOrientation in waitForOrientationToSettle()
139 device.setOrientationNatural() in clearOrientationOverride()
141 device.unfreezeRotation() in clearOrientationOverride()
/platform_testing/libraries/sts-common-util/host-side/src/com/android/sts/common/tradefed/testtype/
DSecurityTestCase.java34 import com.android.tradefed.device.DeviceNotAvailableException;
35 import com.android.tradefed.device.ITestDevice;
36 import com.android.tradefed.device.WifiHelper;
164 public static IBuildInfo getBuildInfo(ITestDevice device) { in getBuildInfo() argument
165 return sBuildInfo.get(device); in getBuildInfo()
168 public static IAbi getAbi(ITestDevice device) { in getAbi() argument
169 return sAbi.get(device); in getAbi()
172 public static String getTestName(ITestDevice device) { in getTestName() argument
173 return sTestName.get(device); in getTestName()
176 public static PocPusher getPocPusher(ITestDevice device) { in getPocPusher() argument
[all …]
/platform_testing/libraries/device-collectors/src/test/java/android/device/collectors/
DTotalPssMetricListenerTest.java17 package android.device.collectors;
19 import static android.device.collectors.TotalPssMetricListener.PROCESS_NAMES_KEY;
20 import static android.device.collectors.TotalPssMetricListener.PROCESS_SEPARATOR;
21 import static android.device.collectors.TotalPssMetricListener.MIN_ITERATIONS_KEY;
22 import static android.device.collectors.TotalPssMetricListener.MAX_ITERATIONS_KEY;
23 import static android.device.collectors.TotalPssMetricListener.SLEEP_TIME_KEY;
24 import static android.device.collectors.TotalPssMetricListener.THRESHOLD_KEY;
DShowmapSnapshotListenerTest.java17 package android.device.collectors;
19 import static android.device.collectors.ShowmapSnapshotListener.DROP_CACHE_KEY;
20 import static android.device.collectors.ShowmapSnapshotListener.METRIC_NAME_INDEX;
21 import static android.device.collectors.ShowmapSnapshotListener.OUTPUT_DIR_KEY;
22 import static android.device.collectors.ShowmapSnapshotListener.PROCESS_NAMES_KEY;
23 import static android.device.collectors.ShowmapSnapshotListener.PROCESS_SEPARATOR;
/platform_testing/libraries/device-collectors/src/main/java/android/device/loggers/
DLogFileLogger.java16 package android.device.loggers;
18 import android.device.collectors.BaseMetricListener;
19 import android.device.collectors.DataRecord;
20 import android.device.collectors.util.SendToInstrumentation;
/platform_testing/libraries/audio-test-harness/proto/
Daudio_device.proto23 // Models an audio device within the Audio Test Harness service.
25 // Capabilities that an audio device can have.
29 // Indicates that a given device can capture audio.
33 // The name of the device.
36 // The serial number of the device, if available.
39 // The capabilities of the device.
/platform_testing/libraries/device-collectors/src/main/java/android/device/preparers/
DMemhogPreparer.java16 package android.device.preparers;
18 import android.device.collectors.BaseMetricListener;
19 import android.device.collectors.DataRecord;
20 import android.device.collectors.annotations.OptionClass;
/platform_testing/libraries/audio-test-harness/tradefed/src/main/java/com/android/media/audiotestharness/tradefed/
DAudioTestHarnessHermeticServerManagingMetricCollector.java27 import com.android.tradefed.device.DeviceNotAvailableException;
28 import com.android.tradefed.device.ITestDevice;
29 import com.android.tradefed.device.metric.BaseDeviceMetricCollector;
30 import com.android.tradefed.device.metric.DeviceMetricData;
140 for (ITestDevice device : getDevices()) { in onTestRunStart()
141 reversePort(device, mAudioTestHarnessGrpcServer.getPort()); in onTestRunStart()
153 for (ITestDevice device : getDevices()) { in onTestRunEnd()
154 undoPortReversals(device); in onTestRunEnd()
/platform_testing/libraries/flicker/test/src/com/android/server/wm/flicker/service/
DRotationMockTest.kt45 val device = UiDevice.getInstance(instrumentation) in startRotationServiceTest() constant
48 device.wakeUpAndGoToHomeScreen() in startRotationServiceTest()
51 device.setOrientationLeft() in startRotationServiceTest()
53 device.setOrientationNatural() in startRotationServiceTest()
/platform_testing/libraries/flicker/src/com/android/server/wm/flicker/rules/
DChangeDisplayOrientationRule.kt57 val device: UiDevice = UiDevice.getInstance(instrumentation) in setRotation() constant
61 Surface.ROTATION_270 -> device.setOrientationRight() in setRotation()
62 Surface.ROTATION_90 -> device.setOrientationLeft() in setRotation()
63 Surface.ROTATION_0 -> device.setOrientationNatural() in setRotation()
64 else -> device.setOrientationNatural() in setRotation()

12345678910