mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Merge "Improving diagnostics when Launcher dies during a gesture" into ub-launcher3-master
This commit is contained in:
committed by
Android (Google) Code Review
commit
ac802c2bdc
@@ -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));
|
||||
|
||||
@@ -57,6 +57,8 @@ public class LogEventChecker {
|
||||
while (true) {
|
||||
rawEvents = mLauncher.getTestInfo(TestProtocol.REQUEST_GET_TEST_EVENTS)
|
||||
.getStringArrayList(TestProtocol.TEST_INFO_RESPONSE_FIELD);
|
||||
if (rawEvents == null) return null;
|
||||
|
||||
final int expectedCount = mExpectedEvents.entrySet()
|
||||
.stream().mapToInt(e -> e.getValue().size()).sum();
|
||||
if (rawEvents.size() >= expectedCount
|
||||
@@ -83,6 +85,7 @@ public class LogEventChecker {
|
||||
|
||||
String verify(long waitForExpectedCountMs, boolean successfulGesture) {
|
||||
final ListMap<String> actualEvents = finishSync(waitForExpectedCountMs);
|
||||
if (actualEvents == null) return "null event sequences because launcher likely died";
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
boolean hasMismatches = false;
|
||||
|
||||
Reference in New Issue
Block a user