Methods Summary |
---|
public void | connect()
if (mHandlerThread.isAlive()) {
throw new IllegalStateException("Already connected!");
}
mHandlerThread.start();
mUiAutomation = new UiAutomation(mHandlerThread.getLooper(),
new UiAutomationConnection());
mUiAutomation.connect();
|
public void | disconnect()
if (!mHandlerThread.isAlive()) {
throw new IllegalStateException("Already disconnected!");
}
mUiAutomation.disconnect();
mHandlerThread.quit();
|
public android.app.UiAutomation | getUiAutomation()
return mUiAutomation;
|
public void | setCompressedLayoutHierarchy(boolean compressed)
AccessibilityServiceInfo info = mUiAutomation.getServiceInfo();
if (compressed)
info.flags &= ~AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
else
info.flags |= AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
mUiAutomation.setServiceInfo(info);
|
public void | setRunAsMonkey(boolean isSet)Enable or disable monkey test mode.
Setting test as "monkey" indicates to some applications that a test framework is
running as a "monkey" type. Such applications may choose not to perform actions that
do submits so to avoid allowing monkey tests from doing harm or performing annoying
actions such as dialing 911 or posting messages to public forums, etc.
IActivityManager am = ActivityManagerNative.getDefault();
if (am == null) {
throw new RuntimeException("Can't manage monkey status; is the system running?");
}
try {
if (isSet) {
am.setActivityController(new DummyActivityController());
} else {
am.setActivityController(null);
}
} catch (RemoteException e) {
throw new RuntimeException(e);
}
|