fix:修复个播PK声音状态异常(多线程不同步导致)
fix:PK数据接口字段适配 fix:修复PK麦克风状态更新不及时问题(接收到PK数据后就更新麦位状态)
This commit is contained in:
@@ -28,6 +28,7 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.BaseViewHolder
|
||||
import com.chuhai.utils.log.LogUtil
|
||||
import com.netease.nim.uikit.common.antispam.AntiSpamEvent
|
||||
import com.netease.nimlib.sdk.StatusCode
|
||||
import com.netease.nimlib.sdk.chatroom.ChatRoomMessageBuilder
|
||||
@@ -604,6 +605,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
//獲取當前是否有麥克風權限
|
||||
val isPermission = isHavingMicPermissions
|
||||
if (!isPermission) {
|
||||
LogUtil.d(TAG, "isPermission mute:"+true, false)
|
||||
AudioEngineManager.get().isMute = true
|
||||
}
|
||||
bottomView.setMicBtnOpen(isPermission)
|
||||
@@ -1232,6 +1234,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
rxPermissions.request(Manifest.permission.RECORD_AUDIO)
|
||||
.subscribe { aBoolean: Boolean ->
|
||||
if (aBoolean) {
|
||||
LogUtil.d(TAG, "onOpenMicBtnClick mute:"+(!AudioEngineManager.get().isMute), false)
|
||||
AudioEngineManager.get().isMute = !AudioEngineManager.get().isMute
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER)
|
||||
updateMicBtn()
|
||||
@@ -1241,6 +1244,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
}
|
||||
return
|
||||
}
|
||||
LogUtil.d(TAG, "onOpenMicBtnClick2 mute:"+(!AudioEngineManager.get().isMute), false)
|
||||
AudioEngineManager.get().isMute = !AudioEngineManager.get().isMute
|
||||
updateMicBtn()
|
||||
if (AudioEngineManager.get().isMute) {
|
||||
|
||||
@@ -154,6 +154,7 @@ public class AvRoomPresenter extends BaseMvpPresenter<IAvRoomView> {
|
||||
.subscribe(roomPkBean -> {
|
||||
AvRoomDataManager.get().roomPkLiveData.setValue(roomPkBean);
|
||||
if (AvRoomDataManager.get().isSingleRoom()){
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "initAnotherPKData() uid:"+(roomPkBean.getAUid()) +" mute:"+(roomPkBean.getAMicStatus() == 0), false);
|
||||
AudioEngineManager.get().setRemoteMute(roomPkBean.getAUid(), roomPkBean.getAMicStatus() == 0);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.yizhuan.xchat_android_core.utils.ifNotNullOrEmpty
|
||||
import com.yizhuan.xchat_android_core.utils.subAndReplaceDot
|
||||
import com.yizhuan.xchat_android_core.utils.toIntOrDef
|
||||
import com.yizhuan.xchat_android_core.utils.toast
|
||||
import com.yizhuan.xchat_android_library.common.application.Env
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil
|
||||
|
||||
class SingleRoomPKCreateActivity : BaseViewBindingActivity<ActivitySingleRoomPkCreateBinding>() {
|
||||
@@ -93,9 +94,12 @@ class SingleRoomPKCreateActivity : BaseViewBindingActivity<ActivitySingleRoomPkC
|
||||
})
|
||||
|
||||
binding.tvOk.setOnClickListener {
|
||||
if (pkTime < 5 || pkTime > 30) {
|
||||
ResUtil.getString(R.string.avroom_singleroompk_singleroompkcreateactivity_01).toast()
|
||||
return@setOnClickListener
|
||||
if (!Env.isDebug()) {
|
||||
if (pkTime < 5 || pkTime > 30) {
|
||||
ResUtil.getString(R.string.avroom_singleroompk_singleroompkcreateactivity_01)
|
||||
.toast()
|
||||
return@setOnClickListener
|
||||
}
|
||||
}
|
||||
currSimpleRoomInfo?.let {
|
||||
SingleRoomPKModel.initiateRoomPK(
|
||||
|
||||
@@ -21,6 +21,7 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.chuhai.utils.log.LogUtil;
|
||||
import com.netease.nim.uikit.api.NimUIKit;
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil;
|
||||
import com.netease.nimlib.sdk.msg.model.RecentContact;
|
||||
@@ -33,6 +34,7 @@ import com.yizhuan.tutu.room_chat.activity.RoomMsgActivity;
|
||||
import com.yizhuan.xchat_android_core.helper.ImHelperUtils;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMMessageManager;
|
||||
import com.yizhuan.xchat_android_core.manager.agora.RtcEngineManager;
|
||||
import com.yizhuan.xchat_android_core.pay.event.FirstChargeEvent;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomInfo;
|
||||
import com.yizhuan.xchat_android_core.room.bean.RoomModeType;
|
||||
@@ -212,6 +214,7 @@ public class BottomView extends FrameLayout implements View.OnClickListener {
|
||||
}
|
||||
|
||||
public void setMicBtnOpen(boolean isOpen) {
|
||||
LogUtil.INSTANCE.d("BottomView", "setMicBtnOpen() isOpen:"+isOpen+" mute:"+ RtcEngineManager.get().isMute, false);
|
||||
if (isOpen) {
|
||||
openMic.setImageResource(R.drawable.icon_room_open_mic);
|
||||
} else {
|
||||
|
||||
@@ -107,6 +107,7 @@ public class AudioEngineManager {
|
||||
* @param role CLIENT_ROLE_AUDIENCE: 听众 ,ROLE_BROADCASTER: 主播
|
||||
*/
|
||||
public boolean setRole(int role) {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "setRole() role:"+role, false);
|
||||
LogUtils.d("setRole() role:" + role);
|
||||
return this.iAudioEngine != null && this.iAudioEngine.setRole(role);
|
||||
}
|
||||
@@ -125,6 +126,7 @@ public class AudioEngineManager {
|
||||
* @param mute true:静音,false:不静音
|
||||
*/
|
||||
public void setMute(boolean mute) {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "setMute() mute:"+mute, false);
|
||||
LogUtils.d("setMute() mute:" + mute);
|
||||
if (this.iAudioEngine == null) return;
|
||||
this.iAudioEngine.setMute(mute);
|
||||
@@ -233,6 +235,7 @@ public class AudioEngineManager {
|
||||
|
||||
|
||||
public void setRemoteMute(long uid, boolean mute) {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "setRemoteMute() uid:"+uid +" mute:"+mute, false);
|
||||
LogUtils.d("setRemoteMute() uid:" + uid + " mute:" + mute);
|
||||
if (this.iAudioEngine == null) return;
|
||||
this.iAudioEngine.setRemoteMute(uid, mute);
|
||||
|
||||
@@ -1299,6 +1299,8 @@ public final class IMNetEaseManager {
|
||||
case CUSTOM_MSG_SUB_ROOM_PK_UPDATE:
|
||||
case CUSTOM_MSG_SUB_SINGLE_ROOM_PK_UPDATE:
|
||||
AvRoomDataManager.get().roomPkLiveData.postValue(roomPkBean);
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "CUSTOM_MSG_SUB_SINGLE_ROOM_PK_UPDATE()", false);
|
||||
AudioEngineManager.get().setRemoteMute(roomPkBean.getAUid(), roomPkBean.getAMicStatus() == 0);
|
||||
break;
|
||||
case CUSTOM_MSG_SUB_ROOM_PK_FINISH:
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_PK_FINISH);
|
||||
@@ -1326,6 +1328,7 @@ public final class IMNetEaseManager {
|
||||
noticeRoomEvent(msg, RoomEvent.ROOM_PK_ORDER);
|
||||
break;
|
||||
case CUSTOM_MSG_SUB_SINGLE_ROOM_PK_MUTE_MIC:
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "CUSTOM_MSG_SUB_SINGLE_ROOM_PK_MUTE_MIC()", false);
|
||||
AudioEngineManager.get().setRemoteMute(roomPkBean.getAUid(), roomPkBean.getAMicStatus() == 0);
|
||||
RoomPkBean currRoomPkBean = AvRoomDataManager.get().roomPkLiveData.getValue();
|
||||
if (currRoomPkBean != null) {
|
||||
@@ -2097,6 +2100,7 @@ public final class IMNetEaseManager {
|
||||
}
|
||||
// 允許接收所有人的聲網音頻流,不會影響本來麥上的靜音狀態,也不會影響自己操作過的靜音按鈕
|
||||
if (temp.mChatRoomMember != null) {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "upMicroQueue() mChatRoomMember != null", false);
|
||||
AudioEngineManager.get().setRemoteMute(Long.parseLong(temp.mChatRoomMember.getAccount()), false);
|
||||
}
|
||||
}
|
||||
@@ -2117,6 +2121,7 @@ public final class IMNetEaseManager {
|
||||
chatRoomMember.setExtension(extension);
|
||||
roomQueueInfo.mChatRoomMember = chatRoomMember;
|
||||
// 這個人上麥後,恢復之前他因為是黑麥被禁言
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "upMicroQueue() 恢復之前他因為是黑麥被禁言", false);
|
||||
AudioEngineManager.get().setRemoteMute(Long.parseLong(chatRoomMember.getAccount()), false);
|
||||
|
||||
//重新更新隊列,隊列上是否還有自己
|
||||
@@ -2129,6 +2134,7 @@ public final class IMNetEaseManager {
|
||||
//開麥
|
||||
AudioEngineManager.get().setRole(Constants.CLIENT_ROLE_BROADCASTER);
|
||||
if (!roomQueueInfo.mChatRoomMember.isNoProhibitMic()) {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "isOwner.isNoProhibitMic mute:"+(roomQueueInfo.mRoomMicInfo.isMicMute() || AvRoomDataManager.get().mIsNeedOpenMic), false);
|
||||
AudioEngineManager.get().setMute(roomQueueInfo.mRoomMicInfo.isMicMute() || AvRoomDataManager.get().mIsNeedOpenMic);
|
||||
//默認閉麥去掉聲音采集
|
||||
AudioEngineManager.get().stopLocalAudio();
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.yizhuan.xchat_android_core.manager.agora;
|
||||
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
|
||||
import com.chuhai.utils.log.LogUtil;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.xchat_android_core.R;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
|
||||
@@ -15,6 +18,11 @@ import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
import io.agora.rtc2.ClientRoleOptions;
|
||||
import io.agora.rtc2.Constants;
|
||||
import io.agora.rtc2.IRtcEngineEventHandler;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.ObservableEmitter;
|
||||
import io.reactivex.ObservableOnSubscribe;
|
||||
import io.reactivex.Scheduler;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
||||
|
||||
/**
|
||||
@@ -24,6 +32,8 @@ public class EngineEventHandler extends IRtcEngineEventHandler {
|
||||
|
||||
public static String TAG = EngineEventHandler.class.getSimpleName();
|
||||
|
||||
public Handler handler = new Handler(Looper.getMainLooper());
|
||||
|
||||
@Override
|
||||
public void onError(int err) {
|
||||
super.onError(err);
|
||||
@@ -134,15 +144,19 @@ public class EngineEventHandler extends IRtcEngineEventHandler {
|
||||
super.onClientRoleChanged(oldRole, newRole, newRoleOptions);
|
||||
//角色切换 麦克风切换
|
||||
if (newRole == Constants.CLIENT_ROLE_BROADCASTER) {
|
||||
RtcEngineManager.get().setMute(RtcEngineManager.get().isMute);
|
||||
if (AvRoomDataManager.get().isRoomOwner() &&
|
||||
AvRoomDataManager.get().isSingleRoom() &&
|
||||
AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
RoomPkBean pkBean = AvRoomDataManager.get().roomPkLiveData.getValue();
|
||||
if (pkBean != null) {
|
||||
AudioEngineManager.get().connectOtherRoom(String.valueOf(pkBean.getARoomId()), pkBean.getAUid());
|
||||
LogUtil.INSTANCE.d(TAG, "onClientRoleChanged() mute:"+RtcEngineManager.get().isMute, false);
|
||||
Observable.create((ObservableOnSubscribe) emitter -> {
|
||||
RtcEngineManager.get().setMute(RtcEngineManager.get().isMute);
|
||||
if (AvRoomDataManager.get().isRoomOwner() &&
|
||||
AvRoomDataManager.get().isSingleRoom() &&
|
||||
AvRoomDataManager.get().isOpenAnotherPKMode()) {
|
||||
RoomPkBean pkBean = AvRoomDataManager.get().roomPkLiveData.getValue();
|
||||
if (pkBean != null) {
|
||||
AudioEngineManager.get().connectOtherRoom(String.valueOf(pkBean.getARoomId()), pkBean.getAUid());
|
||||
}
|
||||
}
|
||||
}
|
||||
emitter.onComplete();
|
||||
}).subscribeOn(AndroidSchedulers.mainThread()).subscribe();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,11 +182,16 @@ public class EngineEventHandler extends IRtcEngineEventHandler {
|
||||
@Override
|
||||
public void onRemoteAudioStats(RemoteAudioStats remoteAudioStats) {
|
||||
super.onRemoteAudioStats(remoteAudioStats);
|
||||
LogUtil.INSTANCE.d(TAG, "onRemoteAudioStats()", false);
|
||||
Logger.t(TAG).d("onRemoteAudioStats uid%d", remoteAudioStats.uid);
|
||||
long uid = (long) remoteAudioStats.uid;
|
||||
// 如果麦上没有这个人,不接收这个人的声音
|
||||
if (!(AvRoomDataManager.get().isSingleRoom() && AvRoomDataManager.get().isOpenAnotherPKMode())) {
|
||||
RtcEngineManager.get().setRemoteMute(uid, !AvRoomDataManager.get().checkIsOnMicByAccount(uid + ""));
|
||||
Observable.create((ObservableOnSubscribe) emitter -> {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "onRemoteAudioStats() uid:"+uid +" mute:"+(!AvRoomDataManager.get().checkIsOnMicByAccount(uid + "")), false);
|
||||
RtcEngineManager.get().setRemoteMute(uid, !AvRoomDataManager.get().checkIsOnMicByAccount(uid + ""));
|
||||
emitter.onComplete();
|
||||
}).subscribeOn(AndroidSchedulers.mainThread()).subscribe();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.os.Environment;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
|
||||
import com.chuhai.utils.log.LogUtil;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
import com.yizhuan.xchat_android_core.manager.AudioEngineManager;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
@@ -36,6 +37,7 @@ public class RtcEngineHandler extends Handler {
|
||||
@Override
|
||||
public void handleMessage(@NotNull Message msg) {
|
||||
super.handleMessage(msg);
|
||||
LogUtil.INSTANCE.d("RtcEngineHandler", "handleMessage()", false);
|
||||
RtcEngineManager rtcEngineManager = RtcEngineManager.get();
|
||||
if (rtcEngineManager == null) return;
|
||||
if (msg.what == notifyJoinAvRoom) {
|
||||
@@ -75,6 +77,7 @@ public class RtcEngineHandler extends Handler {
|
||||
uid != AuthModel.get().getCurrentUid() &&
|
||||
!(AvRoomDataManager.get().isSingleRoom() && AvRoomDataManager.get().isOpenAnotherPKMode())) {
|
||||
// 如果麦上没有这个人,要把他静音
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d("RtcEngineHandler", "如果麦上没有这个人,要把他静音", false);
|
||||
AudioEngineManager.get().setRemoteMute(uid, true);
|
||||
}
|
||||
if (micPosition == Integer.MIN_VALUE) continue;
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.util.Log;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.chuhai.utils.log.LogUtil;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.xchat_android_constants.XChatConstants;
|
||||
import com.yizhuan.xchat_android_core.auth.AuthModel;
|
||||
@@ -30,6 +31,7 @@ import io.agora.rtc2.Constants;
|
||||
import io.agora.rtc2.RtcEngine;
|
||||
import io.agora.rtc2.video.ChannelMediaInfo;
|
||||
import io.agora.rtc2.video.ChannelMediaRelayConfiguration;
|
||||
import kotlin.jvm.Synchronized;
|
||||
|
||||
|
||||
/**
|
||||
@@ -111,6 +113,7 @@ public class RtcEngineManager extends BaseEngine {
|
||||
public void reEnterChannel(long channelId, long uid) {
|
||||
enterChannel(channelId, uid);
|
||||
setRemoteMute(isRemoteMute);
|
||||
LogUtil.INSTANCE.d(TAG, "reEnterChannel() mute:"+isMute, false);
|
||||
setMute(isMute);
|
||||
}
|
||||
|
||||
@@ -180,6 +183,7 @@ public class RtcEngineManager extends BaseEngine {
|
||||
|
||||
@Override
|
||||
public void setRemoteMute(long uid, boolean mute) {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "setRemoteMute() uid:"+uid +" mute:"+mute, false);
|
||||
Logger.t(TAG).d("setRemoteMute uid:%s mute:%s", uid, mute);
|
||||
|
||||
if (mRtcEngine != null && !isRemoteMute) {
|
||||
@@ -189,6 +193,7 @@ public class RtcEngineManager extends BaseEngine {
|
||||
|
||||
@Override
|
||||
public boolean setRole(int role) {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "setRole() role:"+role, false);
|
||||
Logger.t(TAG).d("setRole role=" + role + ",isAudienceRole:" + isAudienceRole);
|
||||
|
||||
if (mRtcEngine != null) {
|
||||
@@ -200,6 +205,7 @@ public class RtcEngineManager extends BaseEngine {
|
||||
|
||||
@Override
|
||||
public void setMute(boolean mute) {
|
||||
LogUtil.INSTANCE.d(TAG, "setMute() mute:"+mute, false);
|
||||
Logger.t(TAG).d("setMute bool:" + mute);
|
||||
if (mRtcEngine == null) {
|
||||
return;
|
||||
@@ -207,6 +213,7 @@ public class RtcEngineManager extends BaseEngine {
|
||||
mRtcEngine.muteLocalAudioStream(mute);
|
||||
mRtcEngine.enableLocalAudio(!mute);
|
||||
isMute = mute;
|
||||
LogUtil.INSTANCE.d(TAG, "setMute().end mute:"+mute, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.yizhuan.xchat_android_core.manager.trtc;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Message;
|
||||
|
||||
import com.chuhai.utils.log.LogUtil;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.tencent.trtc.TRTCCloudDef;
|
||||
import com.yizhuan.xchat_android_core.R;
|
||||
@@ -12,6 +13,7 @@ import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.IMNetEaseManager;
|
||||
import com.yizhuan.xchat_android_core.manager.RoomEvent;
|
||||
import com.yizhuan.xchat_android_core.manager.agora.RtcEngineHandler;
|
||||
import com.yizhuan.xchat_android_core.manager.agora.RtcEngineManager;
|
||||
import com.yizhuan.xchat_android_library.utils.ResUtil;
|
||||
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
|
||||
|
||||
@@ -209,6 +211,7 @@ public class TRtcEngineEventHandler implements IRTCEngineHandler {
|
||||
public void onClientRoleChanged(int oldRole, int newRole) {
|
||||
//角色切换 麦克风切换
|
||||
if (newRole == Constants.CLIENT_ROLE_BROADCASTER) {
|
||||
LogUtil.INSTANCE.d(TAG, "onClientRoleChanged() mute:"+ RtcEngineManager.get().isMute, false);
|
||||
TRtcEngineManager.get().setMute(TRtcEngineManager.get().isMute);
|
||||
if (AvRoomDataManager.get().isRoomOwner() &&
|
||||
AvRoomDataManager.get().isSingleRoom() &&
|
||||
|
||||
@@ -75,6 +75,7 @@ public class TRtcEngineHandler extends Handler {
|
||||
uid != AuthModel.get().getCurrentUid() &&
|
||||
!(AvRoomDataManager.get().isSingleRoom() && AvRoomDataManager.get().isOpenAnotherPKMode())) {
|
||||
// 如果麦上没有这个人,要把他静音
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d("TRtcEngineHandler", "如果麦上没有这个人,要把他静音", false);
|
||||
AudioEngineManager.get().setRemoteMute(uid, true);
|
||||
}
|
||||
if (micPosition == Integer.MIN_VALUE || speaker.volume == 0) continue;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.yizhuan.xchat_android_core.im.custom.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@@ -118,6 +120,7 @@ public class RoomPkBean implements Serializable {
|
||||
/**
|
||||
* 个播PK匹配新增字段
|
||||
*/
|
||||
@SerializedName(value = "aMicStatus", alternate = "amicStatus")
|
||||
private int aMicStatus;
|
||||
|
||||
@Data
|
||||
|
||||
@@ -18,6 +18,8 @@ object LogUtil {
|
||||
// 是否启动文件打印
|
||||
var filePrinterEnabled: Boolean = true
|
||||
|
||||
var tagPrefix: String = "->#"
|
||||
|
||||
/**
|
||||
* 设置文件打印
|
||||
*/
|
||||
@@ -46,7 +48,7 @@ object LogUtil {
|
||||
}
|
||||
|
||||
fun d(tag: String, message: String, filePrinter: Boolean = false) {
|
||||
log(Log.DEBUG, tag, message, filePrinter)
|
||||
log(Log.DEBUG, tag, message+" #thread:${Thread.currentThread().name}", filePrinter)
|
||||
}
|
||||
|
||||
fun i(tag: String, message: String, filePrinter: Boolean = false) {
|
||||
@@ -72,7 +74,7 @@ object LogUtil {
|
||||
return
|
||||
}
|
||||
// 输出控制台
|
||||
logConsole(level, tag, message)
|
||||
logConsole(level, "${tagPrefix}${tag}", message)
|
||||
// 输出文件
|
||||
if (filePrinter) {
|
||||
logFile(level, tag, message)
|
||||
|
||||
Reference in New Issue
Block a user