change the callerlogger
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.notice;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths;
|
||||
@@ -19,8 +18,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
@Route(path = MogoServicePaths.PATH_AI_NOTICE)
|
||||
public class NoticeProvider implements IMoGoNoticeProvider {
|
||||
private String TAG = "AINotice";
|
||||
private Context mContext;
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
@@ -35,8 +32,6 @@ public class NoticeProvider implements IMoGoNoticeProvider {
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
Log.d(TAG, "init");
|
||||
mContext = context;
|
||||
NoticeSocketManager.getInstance().registerSocketMessageListener(context);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package com.mogo.eagle.core.function.notice;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_NOTICE;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
import com.mogo.module.common.MogoApisHandler;
|
||||
import com.mogo.service.cloud.socket.IMogoOnMessageListener;
|
||||
|
||||
@@ -31,27 +32,24 @@ class NoticeSocketManager {
|
||||
}
|
||||
|
||||
public void registerSocketMessageListener(Context context) {
|
||||
Log.d(TAG, "registerSocketMessage");
|
||||
mContext = context;
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(context).
|
||||
registerOnMessageListener(301001, mtrafficNoticeListener);
|
||||
registerOnMessageListener(301001, mTrafficNoticeListener);
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(context).
|
||||
registerOnMessageListener(100, mNormalNoticeListener);
|
||||
}
|
||||
|
||||
public void unRegisterSocketMessageListener() {
|
||||
if (mtrafficNoticeListener != null) {
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(mContext).
|
||||
unregisterOnMessageListener(301001, mtrafficNoticeListener);
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(mContext).
|
||||
unregisterOnMessageListener(100, mNormalNoticeListener);
|
||||
}
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(mContext).
|
||||
unregisterOnMessageListener(301001, mTrafficNoticeListener);
|
||||
MogoApisHandler.getInstance().getApis().getSocketManagerApi(mContext).
|
||||
unregisterOnMessageListener(100, mNormalNoticeListener);
|
||||
}
|
||||
|
||||
/**
|
||||
* 普通云公告
|
||||
*/
|
||||
private IMogoOnMessageListener<NoticeNormalData> mNormalNoticeListener = new IMogoOnMessageListener<NoticeNormalData>() {
|
||||
private final IMogoOnMessageListener<NoticeNormalData> mNormalNoticeListener = new IMogoOnMessageListener<NoticeNormalData>() {
|
||||
@Override
|
||||
public Class<NoticeNormalData> target() {
|
||||
return NoticeNormalData.class;
|
||||
@@ -59,11 +57,10 @@ class NoticeSocketManager {
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(NoticeNormalData obj) {
|
||||
Logger.i(TAG, "100-- 普通公告数据:" + GsonUtil.jsonFromObject(obj));
|
||||
CallerLogger.INSTANCE.d(M_NOTICE + TAG, "100-- 普通公告数据:" + GsonUtil.jsonFromObject(obj));
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
CallerHmiManager.INSTANCE.showNoticeNormalData(obj);
|
||||
}
|
||||
};
|
||||
@@ -71,7 +68,7 @@ class NoticeSocketManager {
|
||||
/**
|
||||
* 交警类型公告弹窗
|
||||
*/
|
||||
private IMogoOnMessageListener<NoticeTrafficStylePushData> mtrafficNoticeListener = new IMogoOnMessageListener<NoticeTrafficStylePushData>() {
|
||||
private final IMogoOnMessageListener<NoticeTrafficStylePushData> mTrafficNoticeListener = new IMogoOnMessageListener<NoticeTrafficStylePushData>() {
|
||||
|
||||
@Override
|
||||
public Class<NoticeTrafficStylePushData> target() {
|
||||
@@ -80,7 +77,7 @@ class NoticeSocketManager {
|
||||
|
||||
@Override
|
||||
public void onMsgReceived(NoticeTrafficStylePushData obj) {
|
||||
Logger.i(TAG, "301001-- 交警类型公告数据:" + GsonUtil.jsonFromObject(obj));
|
||||
CallerLogger.INSTANCE.d(M_NOTICE + TAG, "301001-- 交警类型公告数据:" + GsonUtil.jsonFromObject(obj));
|
||||
CallerHmiManager.INSTANCE.showTrafficBanner(obj);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package com.mogo.eagle.core.function.notice.network;
|
||||
|
||||
import android.util.ArrayMap;
|
||||
import android.util.Log;
|
||||
|
||||
import com.mogo.cloud.network.NetConstants;
|
||||
import com.mogo.cloud.network.RetrofitFactory;
|
||||
@@ -12,7 +11,6 @@ import com.mogo.eagle.core.data.notice.NoticeTrafficStyleInfo;
|
||||
|
||||
import com.mogo.eagle.core.function.api.notice.NoticeNetCallBack;
|
||||
import com.mogo.eagle.core.network.utils.GsonUtil;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -31,7 +29,6 @@ import okhttp3.RequestBody;
|
||||
* @since: 10/28/21
|
||||
*/
|
||||
public class NoticeNetWorkManager {
|
||||
private String TAG = "AINotice";
|
||||
private static volatile NoticeNetWorkManager requestNoticeManager;
|
||||
private final NoticeApiService mNoticeApiService;
|
||||
|
||||
@@ -68,12 +65,10 @@ public class NoticeNetWorkManager {
|
||||
.subscribe(new Observer<NoticeTrafficStyleInfo>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
Log.d(TAG, "onSubscribe");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull NoticeTrafficStyleInfo noticeTrafficStyleInfo) {
|
||||
Log.d(TAG, "onNext:"+noticeTrafficStyleInfo);
|
||||
if (noticeTrafficStyleInfo.getResult().getAccidentInfo() != null) {
|
||||
callBack.callBackWithResult(noticeTrafficStyleInfo);
|
||||
}
|
||||
@@ -81,12 +76,10 @@ public class NoticeNetWorkManager {
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Log.d(TAG, "requestAccidentInfo--error" + e.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Log.d(TAG, "onComplete");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -150,18 +143,15 @@ public class NoticeNetWorkManager {
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull NoticeNormalDetail noticeNormalDetail) {
|
||||
Logger.d(TAG, "onNext ------ ");
|
||||
// CallerHmiManager.INSTANCE.showNormalBanner(noticeNormalDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logger.e(TAG, " onError e = " + e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logger.d(TAG, "onComplete ------ ");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -3,15 +3,15 @@ package com.mogo.eagle.core.function.notice.repository
|
||||
import android.content.Context
|
||||
import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Log
|
||||
import androidx.room.Room
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_NOTICE
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.function.notice.PushUIConstants
|
||||
import com.mogo.eagle.core.function.notice.dao.PushBeanDatabase
|
||||
import com.mogo.eagle.core.function.notice.model.PushBean
|
||||
import com.mogo.eagle.core.function.notice.utils.HandlerUtils
|
||||
import com.mogo.eagle.core.function.notice.view.getApis
|
||||
import com.mogo.eagle.core.function.notice.viewmodel.PushViewModel
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
import com.mogo.service.statusmanager.IMogoStatusChangedListener
|
||||
import com.mogo.service.statusmanager.StatusDescriptor
|
||||
import java.util.*
|
||||
@@ -20,7 +20,9 @@ import kotlin.collections.HashSet
|
||||
class PushRepository(mContext: Context) {
|
||||
|
||||
companion object {
|
||||
private const val TAG: String = "PushRepository"
|
||||
private lateinit var appContext: Context
|
||||
|
||||
fun init(context: Context) {
|
||||
appContext = context.applicationContext
|
||||
pushRepository
|
||||
@@ -33,8 +35,6 @@ class PushRepository(mContext: Context) {
|
||||
val pushRepository: PushRepository by lazy {
|
||||
PushRepository(appContext)
|
||||
}
|
||||
|
||||
private const val TAG: String = "PushRepository.kt"
|
||||
}
|
||||
|
||||
// 被中断的push消息仅再次展示一次
|
||||
@@ -54,7 +54,7 @@ class PushRepository(mContext: Context) {
|
||||
|
||||
private val statusChangedListener: IMogoStatusChangedListener =
|
||||
IMogoStatusChangedListener { sd, open ->
|
||||
Log.d("PushRepository", "sd = $sd open = $open")
|
||||
CallerLogger.d("$M_NOTICE$TAG", "sd = $sd , open = $open")
|
||||
}
|
||||
|
||||
init {
|
||||
@@ -74,7 +74,7 @@ class PushRepository(mContext: Context) {
|
||||
}
|
||||
|
||||
private fun startIterate() {
|
||||
Log.d("PushRepository", "startIterate ${pushViewModel.pushBean}")
|
||||
CallerLogger.d("$M_NOTICE$TAG", "startIterate : ${pushViewModel.pushBean}")
|
||||
if (!pushViewModel.isAddWindow()) {
|
||||
val bean = pushBeanQueue.peek()
|
||||
if (bean != null) {
|
||||
@@ -99,7 +99,7 @@ class PushRepository(mContext: Context) {
|
||||
if (singleRePushSet.contains(pushBean)) {
|
||||
return
|
||||
}
|
||||
Logger.d(TAG, "保存待下一次开启")
|
||||
CallerLogger.d("$M_NOTICE$TAG", "保存待下一次开启")
|
||||
singleRePushSet.add(pushBean)
|
||||
pushBeanQueue.offer(pushBean)
|
||||
}
|
||||
@@ -111,7 +111,10 @@ class PushRepository(mContext: Context) {
|
||||
private fun needDelay(bean: PushBean): Boolean {
|
||||
if (locationClient.lastKnowLocation != null) {
|
||||
if (bean.speedLimit > 0 && bean.speedLimit <= locationClient.lastKnowLocation.speed * 18 / 5) {
|
||||
Log.d("PushRepository", "speedLimit" + locationClient.lastKnowLocation.speed)
|
||||
CallerLogger.d(
|
||||
"$M_NOTICE$TAG",
|
||||
"speedLimit : " + locationClient.lastKnowLocation.speed
|
||||
)
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -140,7 +143,7 @@ class PushRepository(mContext: Context) {
|
||||
}
|
||||
pushViewModel.pushBean = pushBeanQueue.poll()
|
||||
} catch (e: Exception) {
|
||||
Logger.e(TAG, e, "")
|
||||
CallerLogger.e("$M_NOTICE$TAG", "$e")
|
||||
}
|
||||
if (pushViewModel.pushBean != null) {
|
||||
statusManager.registerStatusChangedListener(
|
||||
|
||||
@@ -3,10 +3,8 @@ package com.mogo.eagle.core.function.notice.test
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.util.Log
|
||||
import com.mogo.eagle.core.data.notice.NoticeTrafficStylePushData
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
@@ -14,14 +12,12 @@ import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
* @since: 10/29/21
|
||||
*/
|
||||
class TestNoticeBroadcastReceiver : BroadcastReceiver() {
|
||||
private val TAG = "AINotice"
|
||||
private var mContext: Context? = null
|
||||
|
||||
override fun onReceive(context: Context?, intent: Intent) {
|
||||
try {
|
||||
mContext = context
|
||||
val sceneType = intent.getIntExtra("sceneType", 0)
|
||||
Logger.d(TAG, "textPanelOpenType:$sceneType")
|
||||
// 分发场景
|
||||
dispatchSceneTest(sceneType)
|
||||
} catch (e: Exception) {
|
||||
@@ -30,7 +26,6 @@ class TestNoticeBroadcastReceiver : BroadcastReceiver() {
|
||||
}
|
||||
|
||||
private fun dispatchSceneTest(sceneType: Int) {
|
||||
Log.d(TAG, "dispatchSceneTest::" + sceneType.toString());
|
||||
if (sceneType == 301001) {
|
||||
val pushData = NoticeTrafficStylePushData()
|
||||
pushData.msg = "交警任务公告"
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.get
|
||||
import androidx.core.view.isNotEmpty
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
|
||||
|
||||
const val TAG: String = "AnimatorUtils.kt"
|
||||
|
||||
@@ -19,7 +18,6 @@ fun startClearAnimator(root: ViewGroup, runnable: Runnable) {
|
||||
try {
|
||||
withEndAction(runnable)
|
||||
} catch (e: Exception) {
|
||||
Logger.e(TAG, e, "startClearAnimator->withEndAction")
|
||||
}
|
||||
}
|
||||
duration = 200
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
|
||||
private const val ACTION = "AUTONAVI_STANDARD_BROADCAST_RECV"
|
||||
private const val KEY_TYPE = "KEY_TYPE"
|
||||
@@ -110,7 +109,6 @@ private fun startMap(context: Context, uri: Uri): Boolean {
|
||||
context.sendBroadcast(intent)
|
||||
true
|
||||
} catch (e: NumberFormatException) {
|
||||
Log.e("CustomMessageInfo", e.localizedMessage)
|
||||
false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +277,6 @@ class FloatView constructor(
|
||||
// this.x,
|
||||
// -ResourcesHelper.getDimension(context, R.dimen.module_push_ui_width_vertical)
|
||||
// ) {
|
||||
// Logger.d(TAG, "here")
|
||||
// this.x = 0f
|
||||
// mWindowManager.removeViewImmediate(this)
|
||||
// }
|
||||
|
||||
@@ -384,7 +384,6 @@ public class SwipeItemLayout extends ViewGroup {
|
||||
|
||||
void startScroll(int startX, int endX) {
|
||||
if (startX != endX) {
|
||||
// Log.e("scroll - startX - endX", "" + startX + " " + endX);
|
||||
setTouchMode(Mode.FLING);
|
||||
mAbort = false;
|
||||
mScrollToLeft = endX < startX;
|
||||
@@ -394,8 +393,6 @@ public class SwipeItemLayout extends ViewGroup {
|
||||
}
|
||||
|
||||
void startFling(int startX, int xVel) {
|
||||
// Log.e("fling - startX", "" + startX);
|
||||
|
||||
if (xVel > mMinVelocity && startX != 0) {
|
||||
startScroll(startX, 0);
|
||||
return;
|
||||
@@ -426,12 +423,9 @@ public class SwipeItemLayout extends ViewGroup {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// Log.e("abort", Boolean.toString(mAbort));
|
||||
if (!mAbort) {
|
||||
boolean more = mScroller.computeScrollOffset();
|
||||
int curX = mScroller.getCurrX();
|
||||
// Log.e("curX", "" + curX);
|
||||
|
||||
boolean atEdge = trackMotionScroll(curX - mScrollOffset);
|
||||
if (more && !atEdge) {
|
||||
ViewCompat.postOnAnimation(SwipeItemLayout.this, this);
|
||||
|
||||
@@ -32,7 +32,6 @@ import android.graphics.Shader;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.util.Log;
|
||||
import android.widget.ImageView.ScaleType;
|
||||
|
||||
import androidx.annotation.ColorInt;
|
||||
@@ -139,7 +138,6 @@ public class RoundedDrawable extends Drawable {
|
||||
drawable.draw(canvas);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Log.w(TAG, "Failed to create bitmap from drawable!");
|
||||
bitmap = null;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.notice.viewmodel
|
||||
|
||||
import android.content.Context
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import com.mogo.commons.voice.AIAssist
|
||||
import com.mogo.commons.voice.IMogoVoiceCmdCallBack
|
||||
import com.mogo.eagle.core.function.notice.Config
|
||||
@@ -117,7 +116,6 @@ class PushViewModel(
|
||||
return
|
||||
}
|
||||
field?.showTimeoutShadow = field?.showTimeout?:0
|
||||
Log.d("yilz", "pushbean = $value")
|
||||
if (value.imageUrl.isBlank()) {
|
||||
value.imageUrl = ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user