Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,7 @@ package android.app { method public android.os.ParcelFileDescriptor[] executeShellCommandRw(String); method @Deprecated public boolean grantRuntimePermission(String, String, android.os.UserHandle); method @Deprecated public boolean revokeRuntimePermission(String, String, android.os.UserHandle); method public void syncInputTransactions(); } public class UiModeManager { Loading core/java/android/app/IUiAutomationConnection.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ interface IUiAutomationConnection { void connect(IAccessibilityServiceClient client, int flags); void disconnect(); boolean injectInputEvent(in InputEvent event, boolean sync); void syncInputTransactions(); boolean setRotation(int rotation); Bitmap takeScreenshot(in Rect crop, int rotation); boolean clearWindowContentFrameStats(int windowId); Loading core/java/android/app/UiAutomation.java +19 −0 Original line number Diff line number Diff line Loading @@ -601,6 +601,25 @@ public final class UiAutomation { return false; } /** * A request for WindowManagerService to wait until all animations have completed and input * information has been sent from WindowManager to native InputManager. * * @hide */ @TestApi public void syncInputTransactions() { synchronized (mLock) { throwIfNotConnectedLocked(); } try { // Calling out without a lock held. mUiAutomationConnection.syncInputTransactions(); } catch (RemoteException re) { Log.e(LOG_TAG, "Error while syncing input transactions!", re); } } /** * Sets the device rotation. A client can freeze the rotation in * desired state or freeze the rotation to its current state or Loading core/java/android/app/UiAutomationConnection.java +18 −7 Original line number Diff line number Diff line Loading @@ -128,18 +128,29 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { : InputManager.INJECT_INPUT_EVENT_MODE_ASYNC; final long identity = Binder.clearCallingIdentity(); try { IWindowManager manager = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); try { return manager.injectInputAfterTransactionsApplied(event, mode); return mWindowManager.injectInputAfterTransactionsApplied(event, mode); } catch (RemoteException e) { } return false; } finally { Binder.restoreCallingIdentity(identity); } return false; } @Override public void syncInputTransactions() { synchronized (mLock) { throwIfCalledByNotTrustedUidLocked(); throwIfShutdownLocked(); throwIfNotConnectedLocked(); } try { mWindowManager.syncInputTransactions(); } catch (RemoteException e) { } } @Override public boolean setRotation(int rotation) { synchronized (mLock) { Loading core/java/android/view/IWindowManager.aidl +10 −1 Original line number Diff line number Diff line Loading @@ -641,4 +641,13 @@ interface IWindowManager * quick enough that the windows don't have time to get sent to InputManager. */ boolean injectInputAfterTransactionsApplied(in InputEvent ev, int mode); /** * Waits until all animations have completed and input information has been sent from * WindowManager to native InputManager. * * This is needed for testing since we need to ensure input information has been propagated to * native InputManager before proceeding with tests. */ void syncInputTransactions(); } Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,7 @@ package android.app { method public android.os.ParcelFileDescriptor[] executeShellCommandRw(String); method @Deprecated public boolean grantRuntimePermission(String, String, android.os.UserHandle); method @Deprecated public boolean revokeRuntimePermission(String, String, android.os.UserHandle); method public void syncInputTransactions(); } public class UiModeManager { Loading
core/java/android/app/IUiAutomationConnection.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ interface IUiAutomationConnection { void connect(IAccessibilityServiceClient client, int flags); void disconnect(); boolean injectInputEvent(in InputEvent event, boolean sync); void syncInputTransactions(); boolean setRotation(int rotation); Bitmap takeScreenshot(in Rect crop, int rotation); boolean clearWindowContentFrameStats(int windowId); Loading
core/java/android/app/UiAutomation.java +19 −0 Original line number Diff line number Diff line Loading @@ -601,6 +601,25 @@ public final class UiAutomation { return false; } /** * A request for WindowManagerService to wait until all animations have completed and input * information has been sent from WindowManager to native InputManager. * * @hide */ @TestApi public void syncInputTransactions() { synchronized (mLock) { throwIfNotConnectedLocked(); } try { // Calling out without a lock held. mUiAutomationConnection.syncInputTransactions(); } catch (RemoteException re) { Log.e(LOG_TAG, "Error while syncing input transactions!", re); } } /** * Sets the device rotation. A client can freeze the rotation in * desired state or freeze the rotation to its current state or Loading
core/java/android/app/UiAutomationConnection.java +18 −7 Original line number Diff line number Diff line Loading @@ -128,18 +128,29 @@ public final class UiAutomationConnection extends IUiAutomationConnection.Stub { : InputManager.INJECT_INPUT_EVENT_MODE_ASYNC; final long identity = Binder.clearCallingIdentity(); try { IWindowManager manager = IWindowManager.Stub.asInterface( ServiceManager.getService(Context.WINDOW_SERVICE)); try { return manager.injectInputAfterTransactionsApplied(event, mode); return mWindowManager.injectInputAfterTransactionsApplied(event, mode); } catch (RemoteException e) { } return false; } finally { Binder.restoreCallingIdentity(identity); } return false; } @Override public void syncInputTransactions() { synchronized (mLock) { throwIfCalledByNotTrustedUidLocked(); throwIfShutdownLocked(); throwIfNotConnectedLocked(); } try { mWindowManager.syncInputTransactions(); } catch (RemoteException e) { } } @Override public boolean setRotation(int rotation) { synchronized (mLock) { Loading
core/java/android/view/IWindowManager.aidl +10 −1 Original line number Diff line number Diff line Loading @@ -641,4 +641,13 @@ interface IWindowManager * quick enough that the windows don't have time to get sent to InputManager. */ boolean injectInputAfterTransactionsApplied(in InputEvent ev, int mode); /** * Waits until all animations have completed and input information has been sent from * WindowManager to native InputManager. * * This is needed for testing since we need to ensure input information has been propagated to * native InputManager before proceeding with tests. */ void syncInputTransactions(); }