package com.ss.android.ugc.aweme.legoImpl.task;

import X.8Zd;
import X.8Ze;
import X.8ec;
import X.9Ft;
import X.9Fx;
import X.9g3;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.bytedance.covode.number.Covode;
import com.bytedance.sysoptimizer.ReceiverRegisterCrashOptimizer;
import com.bytedance.sysoptimizer.ReceiverRegisterLancet;
import java.util.List;

public class RegisterSessionReceiver implements 8Ze {
    public 9g3 LIZ = new 9g3();

    static {
        Covode.recordClassIndex(90846);
    }

    public boolean meetTrigger() {
        return true;
    }

    public String prefix() {
        return "task_";
    }

    public boolean serialExecute() {
        return false;
    }

    public int targetProcess() {
        return 1;
    }

    public List triggerOtherLegoComponents() {
        return null;
    }

    public 9Ft triggerType() {
        return 8Zd.LIZ(this);
    }

    public 9Fx scenesType() {
        return 9Fx.DEFAULT;
    }

    public 8ec type() {
        return 8ec.MAIN;
    }

    public String key() {
        return getClass().getSimpleName();
    }

    public void run(Context context) {
        LIZ(context, this.LIZ, new IntentFilter());
    }

    public static Intent LIZ(Context context, BroadcastReceiver broadcastReceiver, IntentFilter intentFilter) {
        if (ReceiverRegisterCrashOptimizer.fixedOpen()) {
            ReceiverRegisterCrashOptimizer.doHWReceiverFix();
        }
        try {
            if (ReceiverRegisterCrashOptimizer.doRegisterHandler()) {
                return context.registerReceiver(broadcastReceiver, intentFilter, (String) null, ReceiverRegisterLancet.sReceiverHandler);
            }
            return context.registerReceiver(broadcastReceiver, intentFilter);
        } catch (Exception e) {
            if (ReceiverRegisterCrashOptimizer.fixedOpen()) {
                return ReceiverRegisterCrashOptimizer.registerReceiver(broadcastReceiver, intentFilter);
            }
            throw e;
        }
    }
}
