Skip to content

Commit

Permalink
sdk合规检测,使用腾讯连连做demo,网络检测使用动态注册方式。
Browse files Browse the repository at this point in the history
Change-Id: I300898d023fc5513ebf4a9c48bfe2476ac7bb2eb
  • Loading branch information
SundoggyNew committed Dec 26, 2023
1 parent 0b87522 commit 59d3e69
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
7 changes: 0 additions & 7 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@
android:screenOrientation="portrait"/>
<activity android:name=".kitlink.activity.rtcui.videocall.TRTCVideoCallActivity"
android:screenOrientation="portrait"/>
<receiver android:name=".kitlink.activity.rtcui.utils.NetWorkStateReceiver">
<intent-filter>
<!--检测网络变化的acton-->
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<activity
android:name=".kitlink.activity.ConfigNetFailedActivity"
android:launchMode="singleTask" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class ControlPanelActivity : PActivity(), CoroutineScope by MainScope(), Control
// App.setEnableEnterRoomCallback(false)
presenter = ControlPanelPresenter(this)
netWorkStateReceiver = NetWorkStateReceiver()
val filter = IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION)
registerReceiver(netWorkStateReceiver, filter)
netWorkStateReceiver!!.addListener(this)
deviceEntity = get("device")
deviceEntity?.run {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
Expand Down Expand Up @@ -522,6 +523,8 @@ protected void onPause() {

public void startNetworkBroadcastReceiver(Context currentContext) {
netWorkStateReceiver = new NetWorkStateReceiver();
IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(netWorkStateReceiver, filter);
netWorkStateReceiver.addListener((NetWorkStateReceiver.NetworkStateReceiverListener) currentContext);
registerNetworkBroadcastReceiver(currentContext);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.net.ConnectivityManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
Expand Down Expand Up @@ -592,6 +593,8 @@ protected void onPause() {

public void startNetworkBroadcastReceiver(Context currentContext) {
netWorkStateReceiver = new NetWorkStateReceiver();
IntentFilter filter = new IntentFilter(ConnectivityManager.CONNECTIVITY_ACTION);
registerReceiver(netWorkStateReceiver, filter);
netWorkStateReceiver.addListener((NetWorkStateReceiver.NetworkStateReceiverListener) currentContext);
registerNetworkBroadcastReceiver(currentContext);
}
Expand Down

0 comments on commit 59d3e69

Please sign in to comment.