package com.bytedance.android.livesdk.livesetting.broadcast;

import com.bytedance.android.live.annotation.Group;
import com.bytedance.android.live.annotation.SettingsKey;
import com.bytedance.android.live_settings.SettingsManager;
import com.bytedance.android.livesdkapi.depend.model.live.Room;
import com.bytedance.covode.number.Covode;

@SettingsKey("live_extended_screen_config")
public final class LiveEnableExtendedScreenSetting {
    @Group(isDefault = true, value = "default group")
    public static final int DEFAULT = 0;
    public static final int EXTENDED_MODE1 = 1;
    public static final int EXTENDED_MODE2 = 2;
    public static final LiveEnableExtendedScreenSetting INSTANCE = new LiveEnableExtendedScreenSetting();

    public final int getValue() {
        return SettingsManager.INSTANCE.getIntValue(LiveEnableExtendedScreenSetting.class);
    }

    static {
        Covode.recordClassIndex(17680);
    }

    public static final boolean enable(Room room) {
        if (INSTANCE.getValue() == 0 || room == null || room.getCommerceStruct() == null || room.getCommerceStruct().commercePermission != 0) {
            return false;
        }
        return true;
    }

    public final boolean showTopInfo(Room room) {
        if (getValue() != EXTENDED_MODE2 || !enable(room)) {
            return false;
        }
        return true;
    }
}
