@@ -13,14 +13,12 @@ import com.tencent.android.tpush.XGPushConfig
1313import com.tencent.iot.explorer.link.core.auth.IoTAuth
1414import com.tencent.iot.explorer.link.core.auth.callback.MyCallback
1515import com.tencent.iot.explorer.link.core.auth.entity.DeviceEntity
16- import com.tencent.iot.explorer.link.core.auth.entity.ProductEntity
1716import com.tencent.iot.explorer.link.core.auth.message.MessageConst
1817import com.tencent.iot.explorer.link.core.auth.message.payload.Payload
1918import com.tencent.iot.explorer.link.core.auth.message.upload.ArrayString
2019import com.tencent.iot.explorer.link.core.auth.response.*
2120import com.tencent.iot.explorer.link.core.auth.socket.callback.ConnectionCallback
2221import com.tencent.iot.explorer.link.core.auth.socket.callback.PayloadMessageCallback
23- import com.tencent.iot.explorer.link.core.auth.util.JsonManager
2422import com.tencent.iot.explorer.link.core.auth.util.Weak
2523import com.tencent.iot.explorer.link.core.link.entity.TRTCParamsEntity
2624import com.tencent.iot.explorer.link.core.log.L
@@ -112,6 +110,8 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
112110 }
113111
114112 fun appStartBeingCall (callingType : Int , deviceId : String ) {
113+ L .e(" App isForeground ${data.isForeground} " )
114+ L .e(" App isCalling ${TRTCUIManager .getInstance().isCalling} " )
115115 if (data.isForeground && ! TRTCUIManager .getInstance().isCalling) { // 在前台,没有正在通话时,唤起通话页面
116116 TRTCUIManager .getInstance().setSessionManager(TRTCAppSessionManager ())
117117
@@ -164,13 +164,13 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
164164 }
165165
166166 private var activityReferences = 0
167- private var isActivityChangingConfigurations = false
168167
169168 override fun onActivityStarted (activity : Activity ) {
170169 Utils .clearMsgNotify(activity, data.notificationId)
171- if (++ activityReferences == 1 && ! isActivityChangingConfigurations ) {
170+ if (++ activityReferences == 1 ) {
172171 // App enters foreground
173172 data.isForeground = true
173+ L .e(" App foreground" )
174174 requestDeviceList()
175175 if (activity is AppLifeCircleListener ) {
176176 activity.onAppGoforeground()
@@ -179,10 +179,10 @@ class App : Application(), Application.ActivityLifecycleCallbacks, PayloadMessag
179179 }
180180
181181 override fun onActivityStopped (activity : Activity ) {
182- isActivityChangingConfigurations = activity.isChangingConfigurations
183- if (-- activityReferences == 0 && ! isActivityChangingConfigurations) {
182+ if (-- activityReferences == 0 ) {
184183 // App enters background
185184 data.isForeground = false
185+ L .e(" App background" )
186186 if (activity is AppLifeCircleListener ) {
187187 activity.onAppGoBackground()
188188 }
0 commit comments