Commit b70e6f2f by YKai

feat: mdt代码优化

parent 81cf0c56
......@@ -9,11 +9,15 @@ import android.content.ServiceConnection
import android.net.Uri
import android.os.IBinder
import android.provider.Settings
import android.text.TextUtils
import android.util.Log
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper
import com.tbruyelle.rxpermissions2.RxPermissions
import com.tencent.qcloud.tuicore.calling.trtccalling.model.TRTCCalling
import com.tencent.qcloud.tuicore.calling.videocall.Constant
import com.tencent.qcloud.tuicore.calling.videocall.YDLInvitionActivity
import com.umeng.analytics.MobclickAgent
import com.ydl.audioim.YDLavManager
import com.ydl.component.music.FragmentContainerActivity
......@@ -34,7 +38,6 @@ import com.yidianling.muse.event.MeditationFloatEvent
import com.yidianling.muse.helper.MediaPlayerManager
import com.yidianling.muse.service.MeditationWindowService
import com.yidianling.tests.home.NewTestHomeActivity
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.service.IUserService
import com.yidianling.user.ui.collect.CollectSexAndBirthActivity
import com.yidianling.user.ui.login.OneKeyLoginHelp
......@@ -52,7 +55,7 @@ import kotlinx.android.synthetic.main.activity_main.*
@Route(path = "/main/main")
class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(),
DemoContract.View {
private var secretDescriptionDialog: SecretDescriptionDialog? = null
// private var secretDescriptionDialog: SecretDescriptionDialog? = null
private var serviceConnection: ServiceConnection? = null
private var meditationServiceConnection:ServiceConnection? = null
......@@ -227,7 +230,6 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bt_to_privacy.setOnClickListener {
startActivity(Intent(this@MainActivity, TestAppActivity::class.java))
}
}
......@@ -281,6 +283,16 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// ModularServiceManager.provide(IConsultantService::class.java)
// .
// (this)
val trtcCalling = TRTCCalling.sharedInstance(this)
if (!TextUtils.isEmpty(trtcCalling.mRoomId)&&!TextUtils.isEmpty(trtcCalling.mUserId)){
val intent = Intent(mContext, YDLInvitionActivity::class.java)
intent.putExtra(Constant.ROOM_ID, trtcCalling.mRoomId)
intent.putExtra(Constant.USER_ID, trtcCalling.mUserId)
intent.putExtra(Constant.INVITE_ID, trtcCalling.mInviteId)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
mContext.startActivity(intent)
}
}
override fun onPause() {
......
......@@ -117,7 +117,13 @@ public class TRTCCalling {
* 是否正在接听界面
*/
public boolean mIsBeingInvited = false;
private String mRoomId = "0";
/**
* 记录进入房间需要的一些信息(vivo,小米手机有后台弹出界面的权限,导致app后台状态下,消费掉通话邀请信令,再进入app无法打开通话邀请界面)
*/
public String mRoomId = "";
public String mUserId = "";
public String mInviteId = "";
/**
* 当前邀请列表
* C2C通话时会记录自己邀请的用户
......@@ -340,18 +346,20 @@ public class TRTCCalling {
public void onReceiveNewInvitation(String inviteID, String inviter, String groupID, List<String> inviteeList, String data) {
TRTCLogger.e(TAG, "onReceiveNewInvitation inviteID:" + inviteID + ", inviter:" + inviter
+ ", groupID:" + groupID + ", inviteeList:" + inviteeList + " data:" + data);
mRoomId = groupID;
final UserModel userModel = UserModelManager.getInstance().getUserModel();
for (String s : inviteeList) {
if (s.equals(userModel.userId)){
mRoomId = groupID;
mUserId = userModel.userId;
mInviteId = inviter;
Intent intent = new Intent(mContext, YDLInvitionActivity.class);
intent.putExtra(Constant.ROOM_ID, groupID);
intent.putExtra(Constant.USER_ID, userModel.userId);
intent.putExtra(Constant.INVITE_ID, inviter);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
mContext.startActivity(intent);
}
}
if (!mIsInRoom){
......@@ -1194,13 +1202,6 @@ public class TRTCCalling {
return;
}
final UserModel userModel = UserModelManager.getInstance().getUserModel();
// Intent intent = new Intent(mContext, YDLInvitionActivity.class);
// intent.putExtra(Constant.ROOM_ID, groupId);
// intent.putExtra(Constant.USER_ID, userModel.userId);
// intent.putExtra(Constant.INVITE_ID, userIdList.get(0));
// intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// internalCall(userIdList, type, groupId);
}
/**
......
......@@ -59,10 +59,15 @@ public class YDLInvitionActivity extends TRTCBaseActivity {
MDTRxActivityTool.addActivity(this);
handleIntent();
setContentView(R.layout.video_invition_activity);
TRTCCalling trtcCalling = TRTCCalling.sharedInstance(this);
// 响铃
TRTCCalling.sharedInstance(this).startRing();
trtcCalling.startRing();
// 正在被邀请
TRTCCalling.sharedInstance(this).mIsBeingInvited = true;
trtcCalling.mIsBeingInvited = true;
// 清除TRTCCalling类中记录的邀请信息
trtcCalling.mRoomId = "";
trtcCalling.mUserId = "";
trtcCalling.mInviteId = "";
// 发送清空通知栏的通知
EventBus.getDefault().post(new ClearJPushEvent());
initView();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment