package com.ss.android.ugc.aweme.video.preload;

import android.text.TextUtils;
import android.util.LruCache;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;

public final class PreloadSessionManager {
    public static final PreloadSessionManager LIZ = new PreloadSessionManager();
    public LruCache<String, PreloadSession> LIZIZ = new LruCache<>(100);

    public static class PreloadSession {
        public String key;
        public String sourceId;
        public int speed = -3;

        static {
            Covode.recordClassIndex(122844);
        }

        public static PreloadSession instance() {
            return new PreloadSession();
        }
    }

    static {
        Covode.recordClassIndex(122843);
    }

    public final synchronized PreloadSession LIZ(String str) {
        MethodCollector.i(9975);
        if (TextUtils.isEmpty(str)) {
            MethodCollector.o(9975);
            return null;
        }
        PreloadSession preloadSession = this.LIZIZ.get(str);
        if (preloadSession == null) {
            preloadSession = PreloadSession.instance();
            preloadSession.key = str;
            preloadSession.speed = -3;
        }
        this.LIZIZ.put(str, preloadSession);
        MethodCollector.o(9975);
        return preloadSession;
    }

    public final synchronized PreloadSession LIZIZ(String str) {
        MethodCollector.i(9976);
        if (TextUtils.isEmpty(str)) {
            MethodCollector.o(9976);
            return null;
        }
        PreloadSession preloadSession = this.LIZIZ.get(str);
        MethodCollector.o(9976);
        return preloadSession;
    }
}
