Merge "Make sure no handlers have id = 0" into udc-dev

This commit is contained in:
Pablo Gamito
2023-04-28 10:14:03 +00:00
committed by Android (Google) Code Review

View File

@@ -73,7 +73,8 @@ public class Tracer implements ShellCommandHandler.ShellCommandActionHandler {
if (mHandlerIds.containsKey(handler)) {
handlerId = mHandlerIds.get(handler);
} else {
handlerId = mHandlerIds.size();
// + 1 to avoid 0 ids which can be confused with missing value when dumped to proto
handlerId = mHandlerIds.size() + 1;
mHandlerIds.put(handler, handlerId);
}