def BinderConsumeHandler(event): if Global.IsUserInSystemUI(): return ctors = Global.Connectors() threads = Global.ActiveThreads() # find a connector ctor_key = binder_key_func(event) if ctor_key in ctors: key = Global.AddNode(event) Global.AddEdge(ctors[ctor_key], key) del ctors[ctor_key] threads[event.pid] = key
def FindConnectorAndUpdate(event, connector_key_func): ctors = Global.Connectors() threads = Global.ActiveThreads() # find the connector ctor_key = connector_key_func(event) if ctor_key in ctors: # connects previous event to the current event key = Global.AddNode(event) Global.AddEdge(ctors[ctor_key], key) del ctors[ctor_key] # decouple the previous event with the current event in the same thread threads[event.pid] = key
def UIInvalidateV2Handler(event): if Global.IsUserInSystemUI(): return key = DefaultHandlerInternal(event) # insert a connector if key is None: return ctors = Global.Connectors() ctor_key = ui_invalidate_key_func(event) if ctor_key in ctors: ctors[ctor_key].append(key) else: ctors[ctor_key] = [ key, ]
def UIUpdateV2Handler(event): if Global.IsUserInSystemUI(): return ctors = Global.Connectors() threads = Global.ActiveThreads() event.thread_name = Global.ThreadName(event.pid) # find the connector ctor_key = ui_invalidate_key_func(event) if ctor_key in ctors: # connects all previous events to the current event key = Global.AddNode(event) for n in ctors[ctor_key]: Global.AddEdge(n, key) del ctors[ctor_key] # decouple the previous event with the current event in the same thread threads[event.pid] = key
def AddConnector(event, connector_key_func, key): if key is None: return ctors = Global.Connectors() ctor_key = connector_key_func(event) ctors[ctor_key] = key