Merge "address use of DummyIME in UI Automator" am: 54bac103d2

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1381318

Change-Id: I8f049883aefd5900e7264ea6d00a298cad245601
This commit is contained in:
Treehugger Robot
2020-07-31 22:20:06 +00:00
committed by Automerger Merge Worker
7 changed files with 20 additions and 20 deletions

View File

@@ -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 */

View File

@@ -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) {

View File

@@ -15,7 +15,7 @@
//
android_test {
name: "DummyIME",
name: "StubIME",
srcs: ["src/**/*.java"],
sdk_version: "current",
}

View File

@@ -17,16 +17,16 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.testing.dummyime">
<application android:label="Dummy IME">
<service android:name="DummyIme"
package="com.android.testing.stubime">
<application android:label="Stub IME">
<service android:name="StubIme"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
<meta-data android:name="android.view.im" android:resource="@xml/method" />
</service>
<activity android:name=".ImePreferences" android:label="Dummy IME Settings">
<activity android:name=".ImePreferences" android:label="Stub IME Settings">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
</intent-filter>

View File

@@ -21,9 +21,9 @@
<!-- for the Search Manager. -->
<input-method xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.android.testing.dummyime.ImePreferences">
android:settingsActivity="com.android.testing.stubime.ImePreferences">
<subtype
android:label="Generic"
android:imeSubtypeLocale="en_US"
android:imeSubtypeMode="keyboard" />
</input-method>
</input-method>

View File

@@ -14,12 +14,12 @@
* limitations under the License.
*/
package com.android.testing.dummyime;
package com.android.testing.stubime;
import android.preference.PreferenceActivity;
/**
* Dummy IME preference activity
* Stub IME preference activity
*/
public class ImePreferences extends PreferenceActivity {

View File

@@ -14,14 +14,14 @@
* limitations under the License.
*/
package com.android.testing.dummyime;
package com.android.testing.stubime;
import android.inputmethodservice.InputMethodService;
/**
* Dummy IME implementation that basically does nothing
* Stub IME implementation that basically does nothing
*/
public class DummyIme extends InputMethodService {
public class StubIme extends InputMethodService {
@Override
public boolean onEvaluateFullscreenMode() {