Improving diagnostics when Launcher dies during a gesture

Instead of crashing upon getting uninitialized event sequence, we show a
meaningful message.

Bug: 159921830
Change-Id: Ie42039b39a453c60bd5df3e54058d582137bba06
This commit is contained in:
vadimt
2020-06-25 13:32:20 -07:00
parent 072e4c276d
commit 56fe9150fa
2 changed files with 9 additions and 0 deletions

View File

@@ -164,6 +164,12 @@ public class DebugTestInformationHandler extends TestInformationHandler {
}
case TestProtocol.REQUEST_GET_TEST_EVENTS: {
if (sEvents == null) {
// sEvents can be null if Launcher died and restarted after
// REQUEST_START_EVENT_LOGGING.
return response;
}
synchronized (sEvents) {
response.putStringArrayList(
TestProtocol.TEST_INFO_RESPONSE_FIELD, new ArrayList<>(sEvents));