Make InputDevice getAssociatedDisplayId part of the test API

While investigating test flakiness, a case where input events
could be dispatched before an input device is associated to a
display has been identified. The issue is that this association
is asynchronous, so we need a way to ensure that the change has
gone through. A way to do this is to monitor the input device
associated display through the API, but at the moment it was
hidden, so this CL will make it available to tests.

Bug: 288321659
Test: No functional changes
Change-Id: I6b9535c160683f7865e766f80fad00dfa4ae52ad
This commit is contained in:
Josep del Rio
2023-07-26 10:03:12 +00:00
parent 5757440e42
commit d7bb5198c8
2 changed files with 2 additions and 0 deletions

View File

@@ -3526,6 +3526,7 @@ package android.view {
public final class InputDevice implements android.os.Parcelable {
method @RequiresPermission("android.permission.DISABLE_INPUT_DEVICE") public void disable();
method @RequiresPermission("android.permission.DISABLE_INPUT_DEVICE") public void enable();
method public int getAssociatedDisplayId();
method @NonNull public android.hardware.input.InputDeviceIdentifier getIdentifier();
method @Nullable public String getKeyboardLanguageTag();
method @Nullable public String getKeyboardLayoutType();

View File

@@ -1319,6 +1319,7 @@ public final class InputDevice implements Parcelable {
}
/** @hide */
@TestApi
public int getAssociatedDisplayId() {
return mAssociatedDisplayId;
}