Methods Summary |
---|
public IAutomationSupport | getAutomationSupport()Provides support for running tests to report interim status
return mAutomationSupport;
|
public android.os.Bundle | getParams()Get command line parameters. On the command line when passing -e key value
pairs, the {@link Bundle} will have the key value pairs conveniently available to the
tests.
return mParams;
|
public com.android.uiautomator.core.UiDevice | getUiDevice()Get current instance of {@link UiDevice}. Works similar to calling the static
{@link UiDevice#getInstance()} from anywhere in the test classes.
return mUiDevice;
|
private void | restoreActiveIme()
// TODO: figure out a way to restore active IME
// Currently retrieving active IME requires querying secure settings provider, which is hard
// to do without a Context; so the caveat here is that to make the post test device usable,
// the active IME needs to be manually switched.
|
void | setAutomationSupport(IAutomationSupport automationSupport)
mAutomationSupport = automationSupport;
|
private void | setDummyIme()
IInputMethodManager im = IInputMethodManager.Stub.asInterface(ServiceManager
.getService(Context.INPUT_METHOD_SERVICE));
List<InputMethodInfo> infos = im.getInputMethodList();
String id = null;
for (InputMethodInfo info : infos) {
if (DUMMY_IME_PACKAGE.equals(info.getComponent().getPackageName())) {
id = info.getId();
}
}
if (id == null) {
throw new RuntimeException(String.format(
"Required testing fixture missing: IME package (%s)", DUMMY_IME_PACKAGE));
}
im.setInputMethod(null, id);
|
void | setParams(android.os.Bundle params)package private
mParams = params;
|
void | setUiDevice(com.android.uiautomator.core.UiDevice uiDevice)package private
mUiDevice = uiDevice;
|
protected void | setUp()
super.setUp();
mShouldDisableIme = "true".equals(mParams.getString(DISABLE_IME));
if (mShouldDisableIme) {
setDummyIme();
}
|
public void | sleep(long ms)Calls {@link SystemClock#sleep(long)} to sleep
SystemClock.sleep(ms);
|
protected void | tearDown()
if (mShouldDisableIme) {
restoreActiveIme();
}
super.tearDown();
|