diff --git a/python/perfetto/trace_processor/protos.py b/python/perfetto/trace_processor/protos.py index b2ac388732..5cd40b579f 100644 --- a/python/perfetto/trace_processor/protos.py +++ b/python/perfetto/trace_processor/protos.py @@ -43,7 +43,10 @@ def __init__(self, platform_delegate: PlatformDelegate): def create_message_factory(message_type): message_desc = self.descriptor_pool.FindMessageTypeByName(message_type) - return message_factory.GetMessageClass(message_desc) + if hasattr(message_factory, 'GetMessageClass'): + return message_factory.GetMessageClass(message_desc) + # AOSP is stil using the old libprotobuf to create message classes. + return message_factory.MessageFactory().GetPrototype(message_desc) # Create proto messages to correctly communicate with the RPC API by sending # and receiving data as protos