碰撞预警对外接口调通

This commit is contained in:
liujing
2021-03-25 14:24:19 +08:00
parent 05472a2716
commit 6156ef4679
6 changed files with 22 additions and 13 deletions

View File

@@ -2,6 +2,7 @@ package com.mogo.service.impl.v2x;
import android.content.Context;
import android.content.Intent;
import android.nfc.Tag;
import android.util.Log;
import com.alibaba.android.arouter.facade.annotation.Route;
@@ -28,11 +29,11 @@ public class V2XManager implements IV2XProvider {
@Override
public void registerIntentListener(String intent, IV2XListener listener) {
if (listener == null || intent == null) {
Log.d("V2XManager", "listener/intent null");
Log.d("V2XManager","listener == null || intent == null");
return;
}
Log.d("V2XManager", "intent=="+intent+"/listener=="+listener);
if (!mListeners.containsKey(intent)) {
Log.d("V2XManager","intent=="+intent+"listener"+listener);
mListeners.put(intent, new CopyOnWriteArrayList<>());
}
mListeners.get(intent).add(listener);
@@ -46,7 +47,7 @@ public class V2XManager implements IV2XProvider {
}
@Override
public void warningChangedWithType(int type, String command) {
public void warningChangedForListenerWithType(int type, String command) {
List<IV2XListener> listeners = mListeners.get(command);
if (listeners != null && !listeners.isEmpty()) {
Iterator<IV2XListener> iterator = listeners.iterator();