feat:去掉调试日志
This commit is contained in:
@@ -28,7 +28,6 @@ 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
|
||||
@@ -605,7 +604,6 @@ 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)
|
||||
@@ -1234,7 +1232,6 @@ 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()
|
||||
@@ -1244,7 +1241,6 @@ 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) {
|
||||
|
@@ -9,7 +9,6 @@ import android.util.SparseArray;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.chuhai.utils.log.LogUtil;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
@@ -156,10 +155,8 @@ 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);
|
||||
if (AvRoomDataManager.get().isRoomOwner()) {
|
||||
com.chuhai.utils.log.LogUtil.INSTANCE.d(TAG, "initAnotherPKData() connectOtherRoom", false);
|
||||
AudioEngineManager.get().connectOtherRoom(String.valueOf(roomPkBean.getARoomId()), roomPkBean.getAUid());
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,6 @@ 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;
|
||||
@@ -34,7 +33,6 @@ 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;
|
||||
@@ -214,7 +212,6 @@ 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,7 +107,6 @@ 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);
|
||||
}
|
||||
@@ -126,7 +125,6 @@ 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);
|
||||
@@ -235,7 +233,6 @@ 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,7 +1299,6 @@ 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:
|
||||
@@ -1328,7 +1327,6 @@ 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) {
|
||||
@@ -2100,7 +2098,6 @@ 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);
|
||||
}
|
||||
}
|
||||
@@ -2121,7 +2118,6 @@ 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);
|
||||
|
||||
//重新更新隊列,隊列上是否還有自己
|
||||
@@ -2134,7 +2130,6 @@ 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();
|
||||
|
@@ -4,8 +4,6 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Message;
|
||||
|
||||
import com.chuhai.utils.log.LogUtil;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.orhanobut.logger.Logger;
|
||||
import com.yizhuan.xchat_android_core.R;
|
||||
import com.yizhuan.xchat_android_core.im.custom.bean.RoomPkBean;
|
||||
@@ -145,14 +143,12 @@ public class EngineEventHandler extends IRtcEngineEventHandler {
|
||||
super.onClientRoleChanged(oldRole, newRole, newRoleOptions);
|
||||
//角色切换 麦克风切换
|
||||
if (newRole == Constants.CLIENT_ROLE_BROADCASTER) {
|
||||
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();
|
||||
LogUtil.INSTANCE.d(TAG, "onClientRoleChanged() pkBean!=null:"+(pkBean!=null), false);
|
||||
if (pkBean != null) {
|
||||
AudioEngineManager.get().connectOtherRoom(String.valueOf(pkBean.getARoomId()), pkBean.getAUid());
|
||||
}
|
||||
@@ -187,13 +183,11 @@ 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())) {
|
||||
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,7 +6,6 @@ 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;
|
||||
@@ -76,7 +75,6 @@ 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,10 +11,8 @@ 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;
|
||||
import com.yizhuan.xchat_android_core.manager.AvRoomDataManager;
|
||||
import com.yizhuan.xchat_android_core.manager.BaseEngine;
|
||||
import com.yizhuan.xchat_android_core.music.db.bean.LocalMusicBean;
|
||||
@@ -31,7 +29,6 @@ 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;
|
||||
|
||||
|
||||
/**
|
||||
@@ -113,7 +110,6 @@ 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);
|
||||
}
|
||||
|
||||
@@ -183,7 +179,6 @@ 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) {
|
||||
@@ -193,7 +188,6 @@ 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) {
|
||||
@@ -205,7 +199,6 @@ 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;
|
||||
@@ -213,7 +206,6 @@ public class RtcEngineManager extends BaseEngine {
|
||||
mRtcEngine.muteLocalAudioStream(mute);
|
||||
mRtcEngine.enableLocalAudio(!mute);
|
||||
isMute = mute;
|
||||
LogUtil.INSTANCE.d(TAG, "setMute().end mute:"+mute, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -3,7 +3,6 @@ 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;
|
||||
@@ -13,7 +12,6 @@ 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;
|
||||
|
||||
@@ -211,7 +209,6 @@ 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,7 +75,6 @@ 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;
|
||||
|
Reference in New Issue
Block a user