Merge "Add Intrsumentation#resetInTouchMode for instrumenting" into tm-dev

This commit is contained in:
Ming-Shin Lu
2022-03-16 05:11:24 +00:00
committed by Android (Google) Code Review
2 changed files with 10 additions and 0 deletions

View File

@@ -5630,6 +5630,7 @@ package android.app {
method public boolean onException(Object, Throwable);
method public void onStart();
method public void removeMonitor(android.app.Instrumentation.ActivityMonitor);
method public void resetInTouchMode();
method public void runOnMainSync(Runnable);
method public void sendCharacterSync(int);
method public void sendKeyDownUpSync(int);

View File

@@ -392,6 +392,15 @@ public class Instrumentation {
}
}
/**
* Resets the {@link #setInTouchMode touch mode} to the device default.
*/
public void resetInTouchMode() {
final boolean defaultInTouchMode = getContext().getResources().getBoolean(
com.android.internal.R.bool.config_defaultInTouchMode);
setInTouchMode(defaultInTouchMode);
}
/**
* Schedule a callback for when the application's main thread goes idle
* (has no more events to process).