package com.bytedance.sysoptimizer.suspension;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import com.bytedance.covode.number.Covode;

public class ThreadSuspensionManager {
    public static ThreadSuspensionHandler mHanderThread;
    public static final Handler mMainHandler = new Handler(Looper.getMainLooper()) {
        static {
            Covode.recordClassIndex(38455);
        }

        public final void handleMessage(Message message) {
            if (message.what == 0) {
                ThreadSuspensionManager.stopTask();
            }
            super.handleMessage(message);
        }
    };

    public static void start(SuspensionParam suspensionParam, ThreadSuspendedCallback threadSuspendedCallback, Runnable runnable) {
    }

    public static void stop() {
        Handler handler = mMainHandler;
        handler.removeMessages(0);
        Message obtain = Message.obtain();
        obtain.what = 0;
        handler.sendMessage(obtain);
    }

    public static void stopTask() {
        ThreadSuspensionHandler threadSuspensionHandler = mHanderThread;
        if (threadSuspensionHandler != null) {
            threadSuspensionHandler.stopTask();
            mHanderThread = null;
        }
    }

    static {
        Covode.recordClassIndex(38454);
    }
}
