package com.lynx.tasm.base;

import android.os.Handler;
import android.os.Message;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;

public class SystemMessageHandler extends Handler {
    public long LIZ;
    public boolean LIZIZ = true;

    static {
        Covode.recordClassIndex(46423);
    }

    private native void nativeRunWork(long j);

    private void stop() {
        this.LIZIZ = false;
    }

    private void scheduleWork() {
        sendMessage(Message.obtain(this, 1));
    }

    public static SystemMessageHandler create(long j) {
        return new SystemMessageHandler(j);
    }

    public SystemMessageHandler(long j) {
        this.LIZ = j;
    }

    private void scheduleDelayedWork(long j) {
        sendMessageDelayed(Message.obtain(this, 1), j);
    }

    public void handleMessage(Message message) {
        MethodCollector.i(3477);
        if (this.LIZIZ) {
            TraceEvent.LIZ(0, "Looper::handleMessage");
            nativeRunWork(this.LIZ);
            TraceEvent.LIZIZ(0, "Looper::handleMessage");
        }
        MethodCollector.o(3477);
    }
}
