Loading api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -4642,6 +4642,7 @@ package android.app { method public android.content.Context getContext(); method public android.content.Context getTargetContext(); method public android.app.UiAutomation getUiAutomation(); method public android.app.UiAutomation getUiAutomation(int); method public boolean invokeContextMenuAction(android.app.Activity, int, int); method public boolean invokeMenuActionSync(android.app.Activity, int, int); method public boolean isProfiling(); Loading Loading @@ -5538,6 +5539,7 @@ package android.app { public final class UiAutomation { method public void clearWindowAnimationFrameStats(); method public boolean clearWindowContentFrameStats(int); method public void destroy(); method public android.view.accessibility.AccessibilityEvent executeAndWaitForEvent(java.lang.Runnable, android.app.UiAutomation.AccessibilityEventFilter, long) throws java.util.concurrent.TimeoutException; method public android.os.ParcelFileDescriptor executeShellCommand(java.lang.String); method public android.view.accessibility.AccessibilityNodeInfo findFocus(int); Loading @@ -5554,6 +5556,7 @@ package android.app { method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo); method public android.graphics.Bitmap takeScreenshot(); method public void waitForIdle(long, long) throws java.util.concurrent.TimeoutException; field public static final int FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES = 1; // 0x1 field public static final int ROTATION_FREEZE_0 = 0; // 0x0 field public static final int ROTATION_FREEZE_180 = 2; // 0x2 field public static final int ROTATION_FREEZE_270 = 3; // 0x3 api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -4774,6 +4774,7 @@ package android.app { method public android.content.Context getContext(); method public android.content.Context getTargetContext(); method public android.app.UiAutomation getUiAutomation(); method public android.app.UiAutomation getUiAutomation(int); method public boolean invokeContextMenuAction(android.app.Activity, int, int); method public boolean invokeMenuActionSync(android.app.Activity, int, int); method public boolean isProfiling(); Loading Loading @@ -5670,6 +5671,7 @@ package android.app { public final class UiAutomation { method public void clearWindowAnimationFrameStats(); method public boolean clearWindowContentFrameStats(int); method public void destroy(); method public android.view.accessibility.AccessibilityEvent executeAndWaitForEvent(java.lang.Runnable, android.app.UiAutomation.AccessibilityEventFilter, long) throws java.util.concurrent.TimeoutException; method public android.os.ParcelFileDescriptor executeShellCommand(java.lang.String); method public android.view.accessibility.AccessibilityNodeInfo findFocus(int); Loading @@ -5686,6 +5688,7 @@ package android.app { method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo); method public android.graphics.Bitmap takeScreenshot(); method public void waitForIdle(long, long) throws java.util.concurrent.TimeoutException; field public static final int FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES = 1; // 0x1 field public static final int ROTATION_FREEZE_0 = 0; // 0x0 field public static final int ROTATION_FREEZE_180 = 2; // 0x2 field public static final int ROTATION_FREEZE_270 = 3; // 0x3 api/test-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -4642,6 +4642,7 @@ package android.app { method public android.content.Context getContext(); method public android.content.Context getTargetContext(); method public android.app.UiAutomation getUiAutomation(); method public android.app.UiAutomation getUiAutomation(int); method public boolean invokeContextMenuAction(android.app.Activity, int, int); method public boolean invokeMenuActionSync(android.app.Activity, int, int); method public boolean isProfiling(); Loading Loading @@ -5538,6 +5539,7 @@ package android.app { public final class UiAutomation { method public void clearWindowAnimationFrameStats(); method public boolean clearWindowContentFrameStats(int); method public void destroy(); method public android.view.accessibility.AccessibilityEvent executeAndWaitForEvent(java.lang.Runnable, android.app.UiAutomation.AccessibilityEventFilter, long) throws java.util.concurrent.TimeoutException; method public android.os.ParcelFileDescriptor executeShellCommand(java.lang.String); method public android.view.accessibility.AccessibilityNodeInfo findFocus(int); Loading @@ -5556,6 +5558,7 @@ package android.app { method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo); method public android.graphics.Bitmap takeScreenshot(); method public void waitForIdle(long, long) throws java.util.concurrent.TimeoutException; field public static final int FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES = 1; // 0x1 field public static final int ROTATION_FREEZE_0 = 0; // 0x0 field public static final int ROTATION_FREEZE_180 = 2; // 0x2 field public static final int ROTATION_FREEZE_270 = 3; // 0x3 core/java/android/app/IUiAutomationConnection.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import android.os.ParcelFileDescriptor; * {@hide} */ interface IUiAutomationConnection { void connect(IAccessibilityServiceClient client); void connect(IAccessibilityServiceClient client, int flags); void disconnect(); boolean injectInputEvent(in InputEvent event, boolean sync); boolean setRotation(int rotation); Loading core/java/android/app/Instrumentation.java +47 −4 Original line number Diff line number Diff line Loading @@ -1837,16 +1837,59 @@ public class Instrumentation { * {@link Instrumentation} APIs. Using both APIs at the same time is not * a mistake by itself but a client has to be aware of the APIs limitations. * </p> * @return The UI automation instance. * @return The UI automation instance. If none exists, a new one is created with no flags set. * * @see UiAutomation */ public UiAutomation getUiAutomation() { if (mUiAutomationConnection != null) { if (mUiAutomation == null) { return getUiAutomation(0); } return mUiAutomation; } return null; } /** * Gets the {@link UiAutomation} instance with flags set. * <p> * <strong>Note:</strong> Only one UiAutomation can be obtained. Calling this method * twice with different flags will fail unless the UiAutomation obtained in the first call * is released with {@link UiAutomation#destroy()}. * </p> * <p> * <strong>Note:</strong> The APIs exposed via the returned {@link UiAutomation} * work across application boundaries while the APIs exposed by the instrumentation * do not. For example, {@link Instrumentation#sendPointerSync(MotionEvent)} will * not allow you to inject the event in an app different from the instrumentation * target, while {@link UiAutomation#injectInputEvent(android.view.InputEvent, boolean)} * will work regardless of the current application. * </p> * <p> * A typical test case should be using either the {@link UiAutomation} or * {@link Instrumentation} APIs. Using both APIs at the same time is not * a mistake by itself but a client has to be aware of the APIs limitations. * </p> * * @param flags The flags to be passed to the UiAutomation, for example * {@link UiAutomation#FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES}. * * @return The UI automation instance. * * @see UiAutomation */ public UiAutomation getUiAutomation(int flags) { if (mUiAutomationConnection != null) { if ((mUiAutomation == null) || (mUiAutomation.isDestroyed())) { mUiAutomation = new UiAutomation(getTargetContext().getMainLooper(), mUiAutomationConnection); mUiAutomation.connect(); mUiAutomation.connect(flags); } else { if (mUiAutomation.getFlags() != flags) { throw new RuntimeException( "Cannot get a UiAutomation with different flags from the existing one"); } } return mUiAutomation; } Loading Loading
api/current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -4642,6 +4642,7 @@ package android.app { method public android.content.Context getContext(); method public android.content.Context getTargetContext(); method public android.app.UiAutomation getUiAutomation(); method public android.app.UiAutomation getUiAutomation(int); method public boolean invokeContextMenuAction(android.app.Activity, int, int); method public boolean invokeMenuActionSync(android.app.Activity, int, int); method public boolean isProfiling(); Loading Loading @@ -5538,6 +5539,7 @@ package android.app { public final class UiAutomation { method public void clearWindowAnimationFrameStats(); method public boolean clearWindowContentFrameStats(int); method public void destroy(); method public android.view.accessibility.AccessibilityEvent executeAndWaitForEvent(java.lang.Runnable, android.app.UiAutomation.AccessibilityEventFilter, long) throws java.util.concurrent.TimeoutException; method public android.os.ParcelFileDescriptor executeShellCommand(java.lang.String); method public android.view.accessibility.AccessibilityNodeInfo findFocus(int); Loading @@ -5554,6 +5556,7 @@ package android.app { method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo); method public android.graphics.Bitmap takeScreenshot(); method public void waitForIdle(long, long) throws java.util.concurrent.TimeoutException; field public static final int FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES = 1; // 0x1 field public static final int ROTATION_FREEZE_0 = 0; // 0x0 field public static final int ROTATION_FREEZE_180 = 2; // 0x2 field public static final int ROTATION_FREEZE_270 = 3; // 0x3
api/system-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -4774,6 +4774,7 @@ package android.app { method public android.content.Context getContext(); method public android.content.Context getTargetContext(); method public android.app.UiAutomation getUiAutomation(); method public android.app.UiAutomation getUiAutomation(int); method public boolean invokeContextMenuAction(android.app.Activity, int, int); method public boolean invokeMenuActionSync(android.app.Activity, int, int); method public boolean isProfiling(); Loading Loading @@ -5670,6 +5671,7 @@ package android.app { public final class UiAutomation { method public void clearWindowAnimationFrameStats(); method public boolean clearWindowContentFrameStats(int); method public void destroy(); method public android.view.accessibility.AccessibilityEvent executeAndWaitForEvent(java.lang.Runnable, android.app.UiAutomation.AccessibilityEventFilter, long) throws java.util.concurrent.TimeoutException; method public android.os.ParcelFileDescriptor executeShellCommand(java.lang.String); method public android.view.accessibility.AccessibilityNodeInfo findFocus(int); Loading @@ -5686,6 +5688,7 @@ package android.app { method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo); method public android.graphics.Bitmap takeScreenshot(); method public void waitForIdle(long, long) throws java.util.concurrent.TimeoutException; field public static final int FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES = 1; // 0x1 field public static final int ROTATION_FREEZE_0 = 0; // 0x0 field public static final int ROTATION_FREEZE_180 = 2; // 0x2 field public static final int ROTATION_FREEZE_270 = 3; // 0x3
api/test-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -4642,6 +4642,7 @@ package android.app { method public android.content.Context getContext(); method public android.content.Context getTargetContext(); method public android.app.UiAutomation getUiAutomation(); method public android.app.UiAutomation getUiAutomation(int); method public boolean invokeContextMenuAction(android.app.Activity, int, int); method public boolean invokeMenuActionSync(android.app.Activity, int, int); method public boolean isProfiling(); Loading Loading @@ -5538,6 +5539,7 @@ package android.app { public final class UiAutomation { method public void clearWindowAnimationFrameStats(); method public boolean clearWindowContentFrameStats(int); method public void destroy(); method public android.view.accessibility.AccessibilityEvent executeAndWaitForEvent(java.lang.Runnable, android.app.UiAutomation.AccessibilityEventFilter, long) throws java.util.concurrent.TimeoutException; method public android.os.ParcelFileDescriptor executeShellCommand(java.lang.String); method public android.view.accessibility.AccessibilityNodeInfo findFocus(int); Loading @@ -5556,6 +5558,7 @@ package android.app { method public final void setServiceInfo(android.accessibilityservice.AccessibilityServiceInfo); method public android.graphics.Bitmap takeScreenshot(); method public void waitForIdle(long, long) throws java.util.concurrent.TimeoutException; field public static final int FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES = 1; // 0x1 field public static final int ROTATION_FREEZE_0 = 0; // 0x0 field public static final int ROTATION_FREEZE_180 = 2; // 0x2 field public static final int ROTATION_FREEZE_270 = 3; // 0x3
core/java/android/app/IUiAutomationConnection.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ import android.os.ParcelFileDescriptor; * {@hide} */ interface IUiAutomationConnection { void connect(IAccessibilityServiceClient client); void connect(IAccessibilityServiceClient client, int flags); void disconnect(); boolean injectInputEvent(in InputEvent event, boolean sync); boolean setRotation(int rotation); Loading
core/java/android/app/Instrumentation.java +47 −4 Original line number Diff line number Diff line Loading @@ -1837,16 +1837,59 @@ public class Instrumentation { * {@link Instrumentation} APIs. Using both APIs at the same time is not * a mistake by itself but a client has to be aware of the APIs limitations. * </p> * @return The UI automation instance. * @return The UI automation instance. If none exists, a new one is created with no flags set. * * @see UiAutomation */ public UiAutomation getUiAutomation() { if (mUiAutomationConnection != null) { if (mUiAutomation == null) { return getUiAutomation(0); } return mUiAutomation; } return null; } /** * Gets the {@link UiAutomation} instance with flags set. * <p> * <strong>Note:</strong> Only one UiAutomation can be obtained. Calling this method * twice with different flags will fail unless the UiAutomation obtained in the first call * is released with {@link UiAutomation#destroy()}. * </p> * <p> * <strong>Note:</strong> The APIs exposed via the returned {@link UiAutomation} * work across application boundaries while the APIs exposed by the instrumentation * do not. For example, {@link Instrumentation#sendPointerSync(MotionEvent)} will * not allow you to inject the event in an app different from the instrumentation * target, while {@link UiAutomation#injectInputEvent(android.view.InputEvent, boolean)} * will work regardless of the current application. * </p> * <p> * A typical test case should be using either the {@link UiAutomation} or * {@link Instrumentation} APIs. Using both APIs at the same time is not * a mistake by itself but a client has to be aware of the APIs limitations. * </p> * * @param flags The flags to be passed to the UiAutomation, for example * {@link UiAutomation#FLAG_DONT_SUPPRESS_ACCESSIBILITY_SERVICES}. * * @return The UI automation instance. * * @see UiAutomation */ public UiAutomation getUiAutomation(int flags) { if (mUiAutomationConnection != null) { if ((mUiAutomation == null) || (mUiAutomation.isDestroyed())) { mUiAutomation = new UiAutomation(getTargetContext().getMainLooper(), mUiAutomationConnection); mUiAutomation.connect(); mUiAutomation.connect(flags); } else { if (mUiAutomation.getFlags() != flags) { throw new RuntimeException( "Cannot get a UiAutomation with different flags from the existing one"); } } return mUiAutomation; } Loading