package com.bytedance.sdk.component.ajl.fm.lb;

import android.text.TextUtils;
import com.bytedance.sdk.component.ajl.fm.jnr;
import com.bytedance.sdk.component.ajl.fm.ro.yz;
import com.bytedance.sdk.component.ajl.fm.wsy;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import u.a;

/* JADX INFO: loaded from: classes.dex */
public class fm {
    private static final LinkedList<String> fm = new LinkedList<>();
    private static final LinkedList<String> ro = new LinkedList<>();

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private static final LinkedList<String> f6579lb = new LinkedList<>();
    private static final LinkedList<String> yz = new LinkedList<>();
    private static final Map<String, Integer> jnr = new HashMap();
    private static HashMap<String, Integer> ajl = null;
    private static String wsy = "upload_init";
    private static int wu = 0;

    /* JADX INFO: renamed from: ef, reason: collision with root package name */
    private static int f6578ef = 0;

    private static synchronized String ajl() {
        StringBuilder sb;
        try {
            sb = new StringBuilder();
            Iterator<String> it = yz.iterator();
            while (it.hasNext()) {
                sb.append(it.next());
                sb.append(",");
            }
        } catch (Throwable th) {
            throw th;
        }
        return sb.toString();
    }

    public static long ef(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        if (fmVar == null || fmVar.ajl() == null || !ro()) {
            return 0L;
        }
        try {
            return new JSONObject(fmVar.ajl().optString("ad_extra_data")).optLong("sdk_event_valid_index");
        } catch (Exception e10) {
            e10.getMessage();
            return 0L;
        }
    }

    public static String fm(int i10) {
        switch (i10) {
            case 1:
                return "flush once";
            case 2:
                return "flush memory db";
            case 3:
                return "flush memory";
            case 4:
                return "new event";
            case 5:
                return "server busy";
            case 6:
                return "empty message";
            case 7:
                return "net error";
            default:
                return "default";
        }
    }

    public static String jnr(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        if (fmVar == null || fmVar.ajl() == null || lb()) {
            return null;
        }
        String strOptString = fmVar.ajl().optString("log_extra");
        if (!TextUtils.isEmpty(strOptString)) {
            try {
                return new JSONObject(strOptString).optString("req_id");
            } catch (JSONException unused) {
            }
        }
        return null;
    }

    private static String ku(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        if (fmVar == null || fmVar.ajl() == null || !ro()) {
            return null;
        }
        JSONObject jSONObjectAjl = fmVar.ajl();
        try {
            return new JSONObject(fmVar.yz() == 1 ? jSONObjectAjl.optString("event_extra") : jSONObjectAjl.optString("ad_extra_data")).optString("sdk_session_id");
        } catch (JSONException e10) {
            e10.getMessage();
            return null;
        }
    }

    private static synchronized String lb(String str) {
        StringBuilder sb;
        try {
            LinkedList<String> linkedList = f6579lb;
            if (linkedList.size() >= 10) {
                linkedList.removeFirst();
                linkedList.add(str);
            } else {
                linkedList.add(str);
            }
            sb = new StringBuilder();
            Iterator<String> it = linkedList.iterator();
            while (it.hasNext()) {
                sb.append(it.next());
                sb.append(",");
            }
        } catch (Throwable th) {
            throw th;
        }
        return sb.toString();
    }

    private static synchronized String ro(String str) {
        StringBuilder sb;
        try {
            LinkedList<String> linkedList = ro;
            if (linkedList.size() >= 10) {
                linkedList.removeFirst();
                linkedList.add(str);
            } else {
                linkedList.add(str);
            }
            sb = new StringBuilder();
            Iterator<String> it = linkedList.iterator();
            while (it.hasNext()) {
                sb.append(it.next());
                sb.append(",");
            }
        } catch (Throwable th) {
            throw th;
        }
        return sb.toString();
    }

    public static void vt(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        try {
            if (ro()) {
                jnr jnrVarFhx = wsy.ajl().fhx();
                if (!TextUtils.isEmpty(fmVar.lb())) {
                    ro.fm(yz.yz.mj(), 1);
                }
                if (jnrVarFhx == null || !jnrVarFhx.ro()) {
                    return;
                }
                if (fmVar.yz() == 1) {
                    ro(fmVar);
                    lb(fmVar);
                    fmVar.lb();
                    ku(fmVar);
                    return;
                }
                if (fmVar.yz() == 0) {
                    if (fmVar.ro() != 3) {
                        if (ef(fmVar) != 0) {
                            fm(fmVar);
                        } else {
                            fm(fmVar);
                        }
                        wu(fmVar);
                        fmVar.lb();
                        ku(fmVar);
                        return;
                    }
                    if (fmVar.ajl() != null) {
                        fmVar.ajl().optString("event");
                        wu(fmVar);
                        ef(fmVar);
                        fmVar.lb();
                        ku(fmVar);
                    }
                }
            }
        } catch (Exception e10) {
            e10.getMessage();
        }
    }

    public static void wsy(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        try {
            if (wsy.ajl().fhx().wsy()) {
                yz.yz.fm(System.currentTimeMillis() - fmVar.wsy());
                fmVar.ro(System.currentTimeMillis());
                if (fmVar.yz() == 0 && wsy.ajl().fhx() != null && wsy.ajl().fhx().fm()) {
                    String strFm = fm(fmVar);
                    if (fm(strFm)) {
                        return;
                    }
                    JSONObject jSONObjectAjl = fmVar.ajl();
                    String strOptString = fmVar.ajl().optString("ad_extra_data");
                    if (TextUtils.isEmpty(strOptString)) {
                        JSONObject jSONObject = new JSONObject();
                        jSONObject.put("save_success_labels", ro(strFm + "_" + ef(fmVar)));
                        jSONObjectAjl.put("ad_extra_data", jSONObject.toString());
                        return;
                    }
                    JSONObject jSONObject2 = new JSONObject(strOptString);
                    if (TextUtils.isEmpty(jSONObject2.optString("save_success_labels"))) {
                        jSONObject2.put("save_success_labels", ro(strFm + "_" + ef(fmVar)));
                    }
                    jSONObjectAjl.put("ad_extra_data", jSONObject2.toString());
                }
            }
        } catch (Exception unused) {
        }
    }

    public static long wu(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        if (fmVar == null || fmVar.ajl() == null || !ro()) {
            return 0L;
        }
        try {
            return new JSONObject(fmVar.ajl().optString("ad_extra_data")).optLong("sdk_event_index");
        } catch (Exception e10) {
            e10.getMessage();
            return 0L;
        }
    }

    private static synchronized void yz(String str) {
        LinkedList<String> linkedList = yz;
        if (linkedList.size() < 10) {
            linkedList.add(str);
        } else {
            linkedList.removeFirst();
            linkedList.add(str);
        }
    }

    public static void fm() {
        if (ajl != null) {
            return;
        }
        String[] strArr = {"first_view", "open_splash", "ad_landing_webview_init", "show_failed_topview", "adstyle_template_show", "splash_init_monitor_first", "download_video_succeed", "shake_skip", "receive", "video_over_auto", "render_time", "splash_ad", "preload_start", "mute", "covered", "download_image_failed", "splash_init_monitor_all", "preload_success_time", "download_video_start_sdk", "download_video_count", "not_showing_reason", "download_image_succeed", "load_video_success", "launch_covered", "download_video_prepare", "download_video_start", "boarding", "ad_wap_stat", "splash_pick", "preload_fail", "should_show", "adstyle_template_fill", "unmute", "preload_success", "show_failed", "stop_showing_monitor", "download_video_no_download", "track_url", "download_creative_duration", "adstyle_template_render", "download_video_count_splash_sdk", "landing_preload_finish", "adstyle_template_load", "load_ad_duration", "client_false_show", "client_false", "download_video_failed", "data_invalid", "topview_boarding", "topview_start_download", "topview_show_confirmed", "splash_start_download", "topview_show_rejected", "splash_no_download", "redownload_video_count", "topview_other_show", "topview_no_download", "ad_selected", "invalid_model", "topview_deliver", "ad_no_selected", "topview_ad_download_retry_label", "request", "response", "parse_finished", "front_performance", "ad_resp", "ad_resp_nodata", "preload_finish", "transit_show", "splash_switch", "block_splash_F2", "render_picture_time", "network_type", "play_start_error", "load_video_error", "render_picture_timeout", "py_loading_success", "download_status", "first_screen_load_finish", "landing_preload_failed", "data_received", "preload_result", "show_result", "reponse", "valid_time", "brand_satefy_context", "topview_ad_link_fail_label", "end_feed_request", "start_feed_request", "set_feed_data", "delayinstall_conflict_with_back_dialog", "clean_fetch_apk_head_failed", "cleanspace_download_after_quite_clean", "fps_too_low", "open_policy", "landing_perf_stats", "preload_topview", "show_effect_start", "dislike_monitor", "hour_show", "hour_skip", "triggered", "click_sound_switch", "enter_loft", "download_resume", "install_view_result", "contiguous_ad_event", "contiguous_ad_remove_event", "report_monitor", "open_landing_blank", "dynamic_ad", "report_load_failed", "ad_download_failed", "download_video_start_first_sdk", "splash_receive", "video_play", "clean_fetch_apk_head_switch_close", "label_external_permission", "pause_reserve_wifi_switch_status", "landing_download_dialog_show", "download_connect", "download_uncompleted", "pause_reserve_wifi_dialog_show", "download_io", "pause_reserve_wifi_confirm", "skvc_load_time", "segment_io", "click_no", "pause_reserve_wifi_cancel_on_wifi", "udp_stop", "mma_url", "error_save_sp", "download_notification_try_show", "ttd_pref_monitor", "item_above_the_fold_stay_time", "ttdownloader_unity", "bdad_query_log", "bdad_load_finish", "bdad_load", "bdad_load_fail", "undefined", "valid_stock", "show_filter", "splash_pk_result", "endcard_page_info", "page_on_create", "statistics_feed_docker", "show_search_card_word", "ad_new_video_render_start_label", "ad_new_video_play_start_label", "ad_new_video_ad_patch_data_set_null_label", "ad_new_video_ad_patch_play_label", "ad_new_video_ad_patch_render_label", "debug_touch_start", "try_second_request", "egg_unzip_success", "tap_2", "anti_0_result", "anti_2_result", "egg_unzip_no_start", "preload_no_start", "bind_impression_212202", "guide_auth_dialog_cancel", "show_im_entry", "sub_reco_impression_v2", "sync_request_log_mask", "no_send_sync_request", "load_timeout", "send_sync_request", "sync_request_not_show", "show_subv_tt_video_food", "track", "custom_event", "rd_landing_page_stat", "update_local_data", "showlimit", "upload_result", "debug_othershow", "debug_otherclick", "ad_show_time", "push_launch", "union_send_duplicate", "mnpl_js_finish_load", "mnpl_resource_finish_load", "mnpl_material_render_timeout", "mnpl_render_timing", "mnpl_vedio_interactive_timegap", "click_non_rectify_area", "start_impression", "end_impression", "picture_render_time", "splash_stop_show", "skip_post", "skan_show_start", "skan_show_end", "load_video_start", "rifle_ad_monitor", "download_video_redownload", "splash_video_quality", "splash_video_end", "splash_video_pause", "splash_video_failed", "adtrace_start_clear", "adtrace_clear_past_data", "adtrace_end_clear", "adtrace_write_success", "adtrace_write_failed", "adtrace_read_result", "adtrace_read_success", "adtrace_read_failed", "pick_model", "cache_model", "adtrace_reparse_file", "deeplink_failed_all", "ad_live_degenerate", "ad_live_miss", "live_play_fail", "sko_show_success", "sko_show_fail", "commerce_apps_open", "commerce_apps_jump", "pic_card_show", "live_ad_card_render_finish", "adtrace_select", "received_card_status", "live_ad_page_load_success", "mp_download_result", "download_video_cancel", "jump_count", "adtrace_try_show", "show_cart_entrance", "live_ad_page_load_fail", "click_interacted", "pop_up", "pop_up_cancel", "stream_loadtime", "mnpl_guide_comp_render", "thirdquartile", "customer_feed_pause", "customer_play_start", "customer_feed_break", "click_area_log", "customer_feed_continue", "customer_feed_play", "mnpl_resource_start_preload", "mnpl_resource_finish_preload", "customer_feed_over", "get_preload_ad", "web_inspect_status", "web_report_status", "preload_begin", "preload_end", "open_begin", "open_end", "pangle_live_sdk_monitor", "success", "rifle_load_state", "rifle_uri_load_state", "component_init", "component_release", "ad_lynx_download_sendAdLog", "dynamic2_render", "lynx_card_show", "pop_up_download", "live_shelf_commodity_show", "unity_fe_click", "enter_ads_explain", "adx_ads_switch", "personal_ads_switch", "qc_product_picture_cancel", "qc_product_picture_save", "qc_product_picture_press", "qc_product_detail_show", "qc_price_instruction_click", "qc_edit_sku_num_click", "service_description_page_duration", "enter_business_qualification_page ", "service_description_page_show", "order_words_fe", "qc_payment_mode_show", "qc_click_ali_pay", "qc_district_addr_click", "qc_auto_information_add", "qc_dial_consult_cancel_btn_click", "qc_dial_consult_show", "qc_maomadeng_click", "qc_maomadeng_show", "slide_product_big_picture", "qc_service_description_close", "appstore_manager_request", "preload_video_result", "preload_video_start", "adtrace_bind", "topview_ad_link_match_event", "skip_leisure_interact_render", "click_start_download", "ad_lynx_landing_page_exception", "lynx_page_res_download_monitor_event", "live_fail", "live_over", "render_live_picture_success", "render_live_picture_fail", "live_play_success", "live_play_close", "item_play_pver", "ad_gap_info", "item_play_over", "has_period_first_chance", "enter_live_auto", "mnpl_material_video_scene_show", "ad_rerank", "in_web_click", "post_request_failed", "destroy", "bidding_load", "bidding_receive", "in_web_scroll", "tobsdk_livesdk_live_show", "xigua_ad_rerank", "applink_unity", "top_ad_show", "top_button_show", "skip_button_show", "skip_click", "shake_show", "skip_result", "show_personal_compliance_button_click", "personal_compliance_click", "ad_click_result", "ad_preload_video", "popup_show", "topview_feed_down", "qr_scan", "qr_show", "topview_popup_show", "topview_feed_over", "topview_feed_show", "feed_down", "engine_ad_send", "permission_click", "policy_click", "download_start_click", "mini_playable_style_report", "load_detect", "aweme_show_info", "click_convert_anchor_detail_page", "click_anchor_gift_button", "show_anchor_gift_page", "click_anchor_gift_card", "show_anchor_gift_card", "anchor_convert_button", "show_anchor_page", "search_result_click", "sdk_session_launch", "not_use_app_link_sdk", "click_ios_check", "auto_open", "bind_click_area", "page_load", "show_finish", "next_fresh", "play_ready", "splash_pk_time", "unshow", "feed_show_failed", "othershow_cancel", "lu_cache", "realtime_splash_result", "channel_override_result", "internal_jump_live_status", "mnpl_video_play_backward", "splash_enter_foreground", "splash_enter_background", "button_light", "long_press", "webview_material_missing_key_error", "live_life_project_click_card", "mnpl_click_event", "show_anchor_convert_button", "bdar_log_info", "bdar_ad_request", "bdar_lynx_template_load_time", "bdar_lynx_fallback", "bdar_fetch_template_data", "bdar_lynx_render_time", "bdar_video_play_effective", "bdar_video_first_frame", "bdar_lynx_jsb_error", "invalidate_back_url_monitor_event", "lynx_page_plugin_exception_event", "live_custom_interaction", "pinch", "if_splash_card", "splash_card_show", "card_show_fail", "splash_card_click", "splash_card_close", "wind_icon_click", "excluded", "show_error", "toutiao_ad_receive", "show_ad", "toutiao_ad_excluded", "close_card", "lynx_status", "qpon_join", "apk_download_user", "comment_key_word_show", "v3_show_ad", "show_wish_button", "enterSection", "single_comment_show", "enter_product_detail", "xigua_ad_request", "qpon_apply", "splash_total_duration", "splash_render_duration", "download_template_duration", "homepage_hot", "homepage_follow", "homepage_fresh", "video_play_success", "general_search", "video_render_cost", "single_ad_render_cost", "unexpected_accurate_pause", "mnpl_interact_skip", "web_report_request_url", "web_report_init_status", "first_request", "video_ended", "mnpl_script_error", "open_wechat_failed_shake", "open_wechat_shacke", "open_wechat_success_shake", "options_popup", "close_pers_ads_type", "check_closed_type", "ad_guide_panel", "learn_ads", "learn_adx_ads", "learn_pers_ads", "resume_closed_type", "twist", "open_wechat_shake"};
        ajl = new HashMap<>(446);
        for (int i10 = 0; i10 < 446; i10++) {
            ajl.put(strArr[i10], 1);
        }
    }

    public static void ajl(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        try {
            if (fmVar.yz() == 0 && wsy.ajl().fhx() != null && wsy.ajl().fhx().fm()) {
                JSONObject jSONObjectAjl = fmVar.ajl();
                String strFm = fm(fmVar);
                if (fm(strFm)) {
                    return;
                }
                jnr(fmVar);
                String strOptString = jSONObjectAjl.optString("ad_extra_data");
                if (!TextUtils.isEmpty(strOptString)) {
                    JSONObject jSONObject = new JSONObject(strOptString);
                    if (TextUtils.isEmpty(jSONObject.optString("will_send_labels"))) {
                        jSONObject.put("will_send_labels", lb(strFm + "_" + ef(fmVar)));
                        jSONObject.put("send_success_valid_labels", ajl());
                    }
                    jSONObjectAjl.put("ad_extra_data", jSONObject.toString());
                    return;
                }
                JSONObject jSONObject2 = new JSONObject();
                jSONObject2.put("will_send_labels", lb(strFm + "_" + ef(fmVar)));
                jSONObject2.put("send_success_valid_labels", ajl());
                jSONObjectAjl.put("ad_extra_data", jSONObject2.toString());
            }
        } catch (Exception e10) {
            e10.getMessage();
        }
    }

    public static String fm(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        if (fmVar == null || fmVar.ajl() == null || lb()) {
            return null;
        }
        if (fmVar.ro() == 3) {
            return fmVar.ajl().optString("event");
        }
        return fmVar.ajl().optString("label");
    }

    public static synchronized int yz(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        if (fmVar != null) {
            if (fmVar.ajl() != null) {
                if (!ro()) {
                    return 0;
                }
                try {
                    return new JSONObject(fmVar.ajl().optString("ad_extra_data")).optInt("sdk_event_self_count");
                } catch (Exception unused) {
                    return 0;
                }
            }
        }
        return 0;
    }

    public static boolean jnr() {
        return ro() || yz();
    }

    public static int lb(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        if (fmVar == null || fmVar.ajl() == null || !ro()) {
            return -1;
        }
        try {
            return new JSONObject(fmVar.ajl().optString("event_extra")).optInt("stats_index");
        } catch (JSONException unused) {
            return -1;
        }
    }

    public static String ro(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        if (fmVar == null || fmVar.ajl() == null || lb()) {
            return null;
        }
        return fmVar.ajl().optString("type");
    }

    public static boolean fm(String str) {
        HashMap<String, Integer> map = ajl;
        if (map == null || str == null) {
            return false;
        }
        return map.containsKey(str);
    }

    public static void fm(List<com.bytedance.sdk.component.ajl.fm.yz.fm> list, int i10) {
        try {
            if (wsy.ajl().fhx().wsy()) {
                for (com.bytedance.sdk.component.ajl.fm.yz.fm fmVar : list) {
                    if (fmVar != null && fmVar.wu() != 0) {
                        long jCurrentTimeMillis = System.currentTimeMillis() - fmVar.wu();
                        com.bytedance.sdk.component.ajl.fm.ro.fm.fm fmVar2 = yz.yz;
                        fmVar2.ib().incrementAndGet();
                        fmVar2.mpp().getAndAdd(jCurrentTimeMillis);
                        fmVar.lb(System.currentTimeMillis());
                    }
                    if (fmVar != null) {
                        ajl(fmVar);
                    }
                }
                yz.yz.kwx().getAndAdd(list.size());
            }
        } catch (Exception unused) {
        }
    }

    public static boolean ro() {
        jnr jnrVarFhx = wsy.ajl().fhx();
        return jnrVarFhx != null && jnrVarFhx.ajl() == 0;
    }

    public static boolean lb() {
        jnr jnrVarFhx = wsy.ajl().fhx();
        return jnrVarFhx != null && jnrVarFhx.ajl() == 2;
    }

    public static boolean yz() {
        jnr jnrVarFhx = wsy.ajl().fhx();
        return jnrVarFhx != null && jnrVarFhx.ajl() == 1;
    }

    public static void fm(JSONObject jSONObject, com.bytedance.sdk.component.ajl.fm.yz.fm.fm fmVar) {
        jnr jnrVarFhx = wsy.ajl().fhx();
        if (jnrVarFhx != null && jnrVarFhx.ro() && jnr()) {
            jSONObject.optString("label");
            fmVar.jnr();
        }
    }

    public static void fm(List<com.bytedance.sdk.component.ajl.fm.yz.fm> list, int i10, String str) {
        jnr jnrVarFhx = wsy.ajl().fhx();
        if (jnrVarFhx == null || !jnrVarFhx.ro() || list == null || lb()) {
            return;
        }
        StringBuilder sb = new StringBuilder();
        boolean z10 = false;
        for (com.bytedance.sdk.component.ajl.fm.yz.fm fmVar : list) {
            if (fmVar.yz() == 0) {
                JSONObject jSONObjectAjl = fmVar.ajl();
                String strFm = fm(fmVar);
                if (fmVar.ro() == 3) {
                    if (jSONObjectAjl != null) {
                        strFm = jSONObjectAjl.optString("event");
                    }
                    sb.append(" [v3:");
                    sb.append(strFm);
                    sb.append("] ");
                } else {
                    long jWu = wu(fmVar);
                    long jEf = ef(fmVar);
                    int iYz = yz(fmVar);
                    sb.append(" [");
                    sb.append(jWu);
                    sb.append("_");
                    sb.append(strFm);
                    if (jEf != 0) {
                        sb.append("_");
                        sb.append(jEf);
                    }
                    if (iYz == 0) {
                        sb.append("] ");
                    } else {
                        sb.append("_");
                        sb.append(iYz);
                        sb.append("] ");
                    }
                }
                z10 = true;
            } else if (fmVar.yz() == 1) {
                String strRo = ro(fmVar);
                int iLb = lb(fmVar);
                sb.append(" [");
                sb.append(iLb);
                sb.append("_");
                sb.append(strRo);
                sb.append("] ");
            }
        }
        if (z10) {
            fm(i10);
            list.size();
        } else {
            fm(i10);
            list.size();
        }
    }

    private static void fm(com.bytedance.sdk.component.ajl.fm.yz.fm fmVar, String str, jnr jnrVar) {
        String strFm = fm(fmVar);
        if (fm(strFm)) {
            return;
        }
        String strJnr = jnr(fmVar);
        if (fmVar.yz() == 0 && jnrVar.fm()) {
            StringBuilder sbD = a.d(strFm, "_");
            sbD.append(ef(fmVar));
            sbD.append("_");
            sbD.append(strJnr);
            sbD.append("_");
            sbD.append(str);
            yz(sbD.toString());
        }
    }

    public static void fm(boolean z10, int i10, com.bytedance.sdk.component.ajl.fm.yz.fm fmVar) {
        jnr jnrVarFhx = wsy.ajl().fhx();
        if (lb() || jnrVarFhx == null || !jnrVarFhx.ro()) {
            return;
        }
        fm(i10);
        TextUtils.isEmpty(ro(fmVar));
        TextUtils.isEmpty(fm(fmVar));
    }

    public static void fm(int i10, List<com.bytedance.sdk.component.ajl.fm.yz.fm> list, long j10) {
        if (wsy.ajl().fhx().wsy()) {
            long jCurrentTimeMillis = System.currentTimeMillis() - j10;
            if (i10 == 200) {
                com.bytedance.sdk.component.ajl.fm.ro.fm.fm fmVar = yz.yz;
                fmVar.pbk().getAndAdd(jCurrentTimeMillis);
                fmVar.aws().incrementAndGet();
                fmVar.ywr().getAndAdd(list.size());
                fmVar.zan().getAndAdd(list.size());
                return;
            }
            if (i10 == -1) {
                yz.yz.pcm().getAndAdd(list.size());
            } else {
                yz.yz.si().getAndAdd(list.size());
            }
            com.bytedance.sdk.component.ajl.fm.ro.fm.fm fmVar2 = yz.yz;
            fmVar2.jm().getAndAdd(jCurrentTimeMillis);
            fmVar2.rka().incrementAndGet();
        }
    }

    public static void fm(List<com.bytedance.sdk.component.ajl.fm.yz.fm> list, String str) {
        try {
            jnr jnrVarFhx = wsy.ajl().fhx();
            if (jnrVarFhx == null || !jnrVarFhx.wsy() || list == null) {
                return;
            }
            for (com.bytedance.sdk.component.ajl.fm.yz.fm fmVar : list) {
                if (fmVar != null) {
                    fm(fmVar, str, jnrVarFhx);
                }
            }
        } catch (Exception e10) {
            e10.getMessage();
        }
    }
}
