示例#1
0
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
示例#2
0
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
示例#3
0
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,
        ]
示例#4
0
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
示例#5
0
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