562935844@qq.com
2022-05-13 a3f9e5ce8dce3d86a60a79b85ce44424a612c6fa
HDLSDK/hdl-common/src/main/java/com/hdl/sdk/common/event/EventDispatcher.java
@@ -1,14 +1,12 @@
package com.hdl.sdk.common.event;
import androidx.annotation.NonNull;
import androidx.collection.ArrayMap;
import com.hdl.sdk.common.utils.LogUtils;
import com.hdl.sdk.common.utils.ThreadToolUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
@@ -21,9 +19,9 @@
    private static final List<EventListener> ALL_TOPICS_EVENT = new ArrayList<>();//所有主题消息
    private static final ArrayMap<Object, List<EventListener>> EVENT = new ArrayMap<>();
    private static final Map<Object, List<EventListener>> EVENT = new HashMap<>();
    private static final ArrayMap<EventListener, Integer> TYPE = new ArrayMap<>();
    private static final Map<EventListener, Integer> TYPE = new HashMap<>();
    private static final int MAIN_TYPE = 0;
    private static final int IO_TYPE = 1;
@@ -125,7 +123,7 @@
        }
    }
    public synchronized void post(Object tag, @NonNull Object o) {
    public synchronized void post(Object tag, Object o) {
        if (tag == null) {
            LogUtils.i("post tag为空");
            return;
@@ -139,6 +137,7 @@
                        if (listener == null) {
                            continue;
                        }
                        ThreadToolUtils.getInstance().runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
@@ -180,6 +179,7 @@
    /**
     * 注册所有主题消息的监听
     *
     * @param listener
     */
    public synchronized void registerAllTopicsListener(EventListener listener) {
@@ -198,6 +198,7 @@
    /**
     * 取消所有主题消息的监听
     *
     * @param listener
     */
    public synchronized void removeAllTopicsListener(EventListener listener) {