Recycling accessibility event as the docs require

Change-Id: I94a2ea7ab93690d0216110b5f77f0116177788a7
This commit is contained in:
vadimt 2019-12-12 17:43:38 -08:00
parent a11ff18d6b
commit a45ee97074
1 changed files with 3 additions and 1 deletions

View File

@ -519,7 +519,9 @@ public final class LauncherInstrumentation {
mInstrumentation.getUiAutomation().executeAndWaitForEvent(
command, eventFilter, WAIT_TIME_MS);
assertNotNull("executeAndWaitForEvent returned null (this can't happen)", event);
return event.getParcelableData();
final Parcelable parcelableData = event.getParcelableData();
event.recycle();
return parcelableData;
} catch (TimeoutException e) {
fail(message.get());
return null;