Ejemplo n.º 1
0
    virtual void onZygoteInit()
    {
        if (PTR_atrace_set_tracing_enabled != NULL) {
            // Re-enable tracing now that we're no longer in Zygote.
            PTR_atrace_set_tracing_enabled(true);
        }

        sp<ProcessState> proc = ProcessState::self();
        ALOGV("App process: starting thread pool.\n");
        proc->startThreadPool();
    }
Ejemplo n.º 2
0
void _atrace_set_tracing_enabled(bool enabled)
{
    if (xposed::getSdkVersion() < 18)
        return;

    dlerror(); // Clear existing errors

    void (*PTR_atrace_set_tracing_enabled)(bool);
    *(void **) (&PTR_atrace_set_tracing_enabled) = dlsym(RTLD_DEFAULT, "atrace_set_tracing_enabled");

    const char *error;
    if ((error = dlerror()) != NULL) {
        ALOGE("Could not find address for function atrace_set_tracing_enabled: %s", error);
    } else {
        PTR_atrace_set_tracing_enabled(enabled);
    }
}