diff options
author | Guang Zhu <guangzhu@google.com> | 2020-07-30 17:24:50 -0700 |
---|---|---|
committer | Guang Zhu <guangzhu@google.com> | 2020-07-31 21:10:17 +0000 |
commit | 6e634c03c624860ba7afed6df3673d4c276bd5e6 (patch) | |
tree | 80da782a0ea8d1c8f6722fedb18bc419201e1bc5 /cmds | |
parent | 98973ea7064bf6caa32e515f15dc2ea7eab930b9 (diff) |
address use of DummyIME in UI Automator
See https://source.android.com/setup/contribute/respectful-code for reference
Bug: 161896447
Test: compile (code is not active in use)
Change-Id: Ice71490ff09969f229943d6ef952a09f4e283d14
Merged-In: Ice71490ff09969f229943d6ef952a09f4e283d14
Diffstat (limited to 'cmds')
2 files changed, 8 insertions, 8 deletions
diff --git a/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/UiAutomationShellWrapper.java b/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/UiAutomationShellWrapper.java index 71561c3c7023..39248730802f 100644 --- a/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/UiAutomationShellWrapper.java +++ b/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/core/UiAutomationShellWrapper.java @@ -49,7 +49,7 @@ public class UiAutomationShellWrapper { } try { if (isSet) { - am.setActivityController(new DummyActivityController(), true); + am.setActivityController(new NoOpActivityController(), true); } else { am.setActivityController(null, true); } @@ -80,9 +80,9 @@ public class UiAutomationShellWrapper { } /** - * Dummy, no interference, activity controller. + * No-op, no interference, activity controller. */ - private class DummyActivityController extends IActivityController.Stub { + private class NoOpActivityController extends IActivityController.Stub { @Override public boolean activityStarting(Intent intent, String pkg) throws RemoteException { /* do nothing and let activity proceed normally */ diff --git a/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java b/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java index d862e1c2babb..e6fb7aa76e58 100644 --- a/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java +++ b/cmds/uiautomator/library/testrunner-src/com/android/uiautomator/testrunner/UiAutomatorTestCase.java @@ -45,7 +45,7 @@ import java.util.List; public class UiAutomatorTestCase extends TestCase { private static final String DISABLE_IME = "disable_ime"; - private static final String DUMMY_IME_PACKAGE = "com.android.testing.dummyime"; + private static final String STUB_IME_PACKAGE = "com.android.testing.stubime"; private static final int NOT_A_SUBTYPE_ID = -1; private UiDevice mUiDevice; @@ -58,7 +58,7 @@ public class UiAutomatorTestCase extends TestCase { super.setUp(); mShouldDisableIme = "true".equals(mParams.getString(DISABLE_IME)); if (mShouldDisableIme) { - setDummyIme(); + setStubIme(); } } @@ -128,7 +128,7 @@ public class UiAutomatorTestCase extends TestCase { SystemClock.sleep(ms); } - private void setDummyIme() { + private void setStubIme() { Context context = ActivityThread.currentApplication(); if (context == null) { throw new RuntimeException("ActivityThread.currentApplication() is null."); @@ -138,13 +138,13 @@ public class UiAutomatorTestCase extends TestCase { List<InputMethodInfo> infos = im.getInputMethodList(); String id = null; for (InputMethodInfo info : infos) { - if (DUMMY_IME_PACKAGE.equals(info.getComponent().getPackageName())) { + if (STUB_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)); + "Required testing fixture missing: IME package (%s)", STUB_IME_PACKAGE)); } if (context.checkSelfPermission(android.Manifest.permission.WRITE_SECURE_SETTINGS) != PackageManager.PERMISSION_GRANTED) { |