[Android][Feature] CSS Renaming (#638)
This commit is contained in:
Родитель
653bac7b17
Коммит
ac22669f73
|
@ -11,7 +11,7 @@ import com.azure.android.communication.ui.calling.configuration.CallCompositeCon
|
|||
import com.azure.android.communication.ui.calling.configuration.CallConfiguration;
|
||||
import com.azure.android.communication.ui.calling.configuration.CallType;
|
||||
import com.azure.android.communication.ui.calling.di.DependencyInjectionContainer;
|
||||
import com.azure.android.communication.ui.calling.models.CallCompositeDiagnostics;
|
||||
import com.azure.android.communication.ui.calling.models.CallCompositeDebugInfo;
|
||||
import com.azure.android.communication.ui.calling.models.CallCompositeGroupCallLocator;
|
||||
import com.azure.android.communication.ui.calling.models.CallCompositeJoinLocator;
|
||||
import com.azure.android.communication.ui.calling.models.CallCompositeLocalOptions;
|
||||
|
@ -22,9 +22,9 @@ import com.azure.android.communication.ui.calling.models.CallCompositeParticipan
|
|||
import com.azure.android.communication.ui.calling.models.CallCompositeSetParticipantViewDataResult;
|
||||
import com.azure.android.communication.ui.calling.models.CallCompositeTeamsMeetingLinkLocator;
|
||||
import com.azure.android.communication.ui.calling.presentation.CallCompositeActivity;
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DiagnosticsManager;
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DebugInfoManager;
|
||||
|
||||
import static com.azure.android.communication.ui.calling.models.CallCompositeDiagnosticsExtensionsKt.buildCallCompositeDiagnostics;
|
||||
import static com.azure.android.communication.ui.calling.models.CallCompositeDebugInfoExtensionsKt.buildCallCompositeDebugInfo;
|
||||
import static com.azure.android.communication.ui.calling.service.sdk.TypeConversionsKt.into;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
@ -209,23 +209,23 @@ public final class CallComposite {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get Call Composite Diagnostics information.
|
||||
* Get Call Composite Debug information.
|
||||
*
|
||||
* @return {@link CallCompositeDiagnostics}
|
||||
* @return {@link CallCompositeDebugInfo}
|
||||
*/
|
||||
public CallCompositeDiagnostics getDiagnostics() {
|
||||
final DiagnosticsManager diagnosticsManager = getDiagnosticsManger();
|
||||
return diagnosticsManager != null
|
||||
? diagnosticsManager.getDiagnostics()
|
||||
: buildCallCompositeDiagnostics();
|
||||
public CallCompositeDebugInfo getDebugInfo() {
|
||||
final DebugInfoManager debugInfoManager = getDebugInfoManager();
|
||||
return debugInfoManager != null
|
||||
? debugInfoManager.getDebugInfo()
|
||||
: buildCallCompositeDebugInfo();
|
||||
}
|
||||
|
||||
void setDependencyInjectionContainer(final DependencyInjectionContainer diContainer) {
|
||||
this.diContainer = new WeakReference<DependencyInjectionContainer>(diContainer);
|
||||
}
|
||||
|
||||
private DiagnosticsManager getDiagnosticsManger() {
|
||||
return diContainer != null ? diContainer.get().getDiagnosticsManager() : null;
|
||||
private DebugInfoManager getDebugInfoManager() {
|
||||
return diContainer != null ? diContainer.get().getDebugInfoManager() : null;
|
||||
}
|
||||
|
||||
private void launchComposite(final Context context,
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.azure.android.communication.ui.calling.presentation.navigation.Naviga
|
|||
import com.azure.android.communication.ui.calling.redux.Store
|
||||
import com.azure.android.communication.ui.calling.redux.middleware.handler.CallingMiddlewareActionHandler
|
||||
import com.azure.android.communication.ui.calling.redux.state.ReduxState
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DiagnosticsManager
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DebugInfoManager
|
||||
import com.azure.android.communication.ui.calling.service.NotificationService
|
||||
|
||||
// Dependency Container for the Call Composite Activity
|
||||
|
@ -50,7 +50,7 @@ internal interface DependencyInjectionContainer {
|
|||
val notificationService: NotificationService
|
||||
val audioFocusManager: AudioFocusManager
|
||||
val networkManager: NetworkManager
|
||||
val diagnosticsManager: DiagnosticsManager
|
||||
val debugInfoManager: DebugInfoManager
|
||||
|
||||
// UI
|
||||
val videoViewManager: VideoViewManager
|
||||
|
|
|
@ -43,8 +43,8 @@ import com.azure.android.communication.ui.calling.redux.reducer.Reducer
|
|||
import com.azure.android.communication.ui.calling.redux.state.AppReduxState
|
||||
import com.azure.android.communication.ui.calling.redux.state.ReduxState
|
||||
import com.azure.android.communication.ui.calling.service.CallingService
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DiagnosticsManager
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DiagnosticsManagerImpl
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DebugInfoManager
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DebugInfoManagerImpl
|
||||
import com.azure.android.communication.ui.calling.service.NotificationService
|
||||
import com.azure.android.communication.ui.calling.service.sdk.CallingSDK
|
||||
import com.azure.android.communication.ui.calling.service.sdk.CallingSDKEventHandler
|
||||
|
@ -109,8 +109,8 @@ internal class DependencyInjectionContainerImpl(
|
|||
applicationContext,
|
||||
)
|
||||
}
|
||||
override val diagnosticsManager: DiagnosticsManager by lazy {
|
||||
DiagnosticsManagerImpl(
|
||||
override val debugInfoManager: DebugInfoManager by lazy {
|
||||
DebugInfoManagerImpl(
|
||||
appStore,
|
||||
)
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.calling.models;
|
||||
|
||||
/**
|
||||
* A Call Composite Debug information.
|
||||
*/
|
||||
public final class CallCompositeDebugInfo {
|
||||
|
||||
private String lastCallId;
|
||||
|
||||
CallCompositeDebugInfo() { }
|
||||
|
||||
/**
|
||||
* Set last call id.
|
||||
* @param lastCallId last call id.
|
||||
* @return {@link CallCompositeDebugInfo}
|
||||
*/
|
||||
CallCompositeDebugInfo setLastCallId(final String lastCallId) {
|
||||
this.lastCallId = lastCallId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last call id.
|
||||
* @return {@link String}
|
||||
*/
|
||||
public String getLastCallId() {
|
||||
return lastCallId;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.calling.models
|
||||
|
||||
internal fun CallCompositeDebugInfo.setCallId(lastKnownCallId: String?) {
|
||||
this.lastCallId = lastKnownCallId
|
||||
}
|
||||
|
||||
internal fun buildCallCompositeDebugInfo(): CallCompositeDebugInfo = CallCompositeDebugInfo()
|
|
@ -1,32 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.calling.models;
|
||||
|
||||
/**
|
||||
* A Call Composite Diagnostics information.
|
||||
*/
|
||||
public final class CallCompositeDiagnostics {
|
||||
|
||||
private String lastKnownCallId;
|
||||
|
||||
CallCompositeDiagnostics() { }
|
||||
|
||||
/**
|
||||
* Set last known call id.
|
||||
* @param lastKnownCallId last known call id.
|
||||
* @return {@link CallCompositeDiagnostics}
|
||||
*/
|
||||
CallCompositeDiagnostics setLastKnownCallId(final String lastKnownCallId) {
|
||||
this.lastKnownCallId = lastKnownCallId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get last known call id.
|
||||
* @return {@link String}
|
||||
*/
|
||||
public String getLastKnownCallId() {
|
||||
return lastKnownCallId;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License.
|
||||
|
||||
package com.azure.android.communication.ui.calling.models
|
||||
|
||||
internal fun CallCompositeDiagnostics.setCallId(lastKnownCallId: String?) {
|
||||
this.lastKnownCallId = lastKnownCallId
|
||||
}
|
||||
|
||||
internal fun buildCallCompositeDiagnostics(): CallCompositeDiagnostics = CallCompositeDiagnostics()
|
|
@ -61,7 +61,7 @@ internal class CallCompositeActivity : AppCompatActivity() {
|
|||
private val callingMiddlewareActionHandler get() = container.callingMiddlewareActionHandler
|
||||
private val videoViewManager get() = container.videoViewManager
|
||||
private val instanceId get() = intent.getIntExtra(KEY_INSTANCE_ID, -1)
|
||||
private val diagnosticsService get() = container.diagnosticsManager
|
||||
private val diagnosticsService get() = container.debugInfoManager
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -88,7 +88,7 @@ internal class DependencyInjectionContainerHolder(
|
|||
container.appStore,
|
||||
ParticipantGridCellViewModelFactory(),
|
||||
application.resources.getInteger(R.integer.azure_communication_ui_calling_max_remote_participants),
|
||||
container.diagnosticsManager
|
||||
container.debugInfoManager
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
|
||||
package com.azure.android.communication.ui.calling.presentation.fragment.calling.controlbar.more
|
||||
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DiagnosticsManager
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DebugInfoManager
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
|
||||
internal class MoreCallOptionsListViewModel(
|
||||
private val diagnosticsManager: DiagnosticsManager
|
||||
private val debugInfoManager: DebugInfoManager
|
||||
) {
|
||||
private val unknown = "UNKNOWN"
|
||||
val callId: String
|
||||
get() {
|
||||
val lastKnownCallId = diagnosticsManager.diagnostics.lastKnownCallId
|
||||
val lastKnownCallId = debugInfoManager.debugInfo.lastCallId
|
||||
return "Call ID: \"${if (lastKnownCallId.isNullOrEmpty()) unknown else lastKnownCallId}\""
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ import com.azure.android.communication.ui.calling.presentation.fragment.calling.
|
|||
import com.azure.android.communication.ui.calling.presentation.fragment.common.audiodevicelist.AudioDeviceListViewModel
|
||||
import com.azure.android.communication.ui.calling.presentation.fragment.calling.controlbar.more.MoreCallOptionsListViewModel
|
||||
import com.azure.android.communication.ui.calling.presentation.fragment.setup.components.ErrorInfoViewModel
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DiagnosticsManager
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DebugInfoManager
|
||||
import com.azure.android.communication.ui.calling.redux.Store
|
||||
import com.azure.android.communication.ui.calling.redux.state.ReduxState
|
||||
|
||||
|
@ -23,11 +23,11 @@ internal class CallingViewModelFactory(
|
|||
private val store: Store<ReduxState>,
|
||||
private val participantGridCellViewModelFactory: ParticipantGridCellViewModelFactory,
|
||||
private val maxRemoteParticipants: Int,
|
||||
private val diagnosticsManager: DiagnosticsManager
|
||||
private val debugInfoManager: DebugInfoManager
|
||||
) {
|
||||
|
||||
val moreCallOptionsListViewModel by lazy {
|
||||
MoreCallOptionsListViewModel(diagnosticsManager)
|
||||
MoreCallOptionsListViewModel(debugInfoManager)
|
||||
}
|
||||
|
||||
val participantGridViewModel by lazy {
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
|
||||
package com.azure.android.communication.ui.calling.presentation.manager
|
||||
|
||||
import com.azure.android.communication.ui.calling.models.CallCompositeDiagnostics
|
||||
import com.azure.android.communication.ui.calling.models.buildCallCompositeDiagnostics
|
||||
import com.azure.android.communication.ui.calling.models.CallCompositeDebugInfo
|
||||
import com.azure.android.communication.ui.calling.models.buildCallCompositeDebugInfo
|
||||
import com.azure.android.communication.ui.calling.models.setCallId
|
||||
import com.azure.android.communication.ui.calling.redux.Store
|
||||
import com.azure.android.communication.ui.calling.redux.state.ReduxState
|
||||
|
@ -12,24 +12,24 @@ import kotlinx.coroutines.CoroutineScope
|
|||
import kotlinx.coroutines.flow.collect
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
internal interface DiagnosticsManager {
|
||||
internal interface DebugInfoManager {
|
||||
fun start(coroutineScope: CoroutineScope)
|
||||
val diagnostics: CallCompositeDiagnostics
|
||||
val debugInfo: CallCompositeDebugInfo
|
||||
}
|
||||
|
||||
internal class DiagnosticsManagerImpl(
|
||||
internal class DebugInfoManagerImpl(
|
||||
private val store: Store<ReduxState>,
|
||||
) : DiagnosticsManager {
|
||||
) : DebugInfoManager {
|
||||
|
||||
override var diagnostics = buildCallCompositeDiagnostics()
|
||||
override var debugInfo = buildCallCompositeDebugInfo()
|
||||
|
||||
override fun start(coroutineScope: CoroutineScope) {
|
||||
coroutineScope.launch {
|
||||
store.getStateFlow().collect {
|
||||
if (!it.callState.callId.isNullOrEmpty()) {
|
||||
val newDiagnostics = buildCallCompositeDiagnostics()
|
||||
newDiagnostics.setCallId(it.callState.callId)
|
||||
diagnostics = newDiagnostics
|
||||
val newDebugInfo = buildCallCompositeDebugInfo()
|
||||
newDebugInfo.setCallId(it.callState.callId)
|
||||
debugInfo = newDebugInfo
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,8 +4,8 @@
|
|||
package com.azure.android.communication.ui.presentation.manager
|
||||
|
||||
import com.azure.android.communication.ui.ACSBaseTestCoroutine
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DiagnosticsManager
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DiagnosticsManagerImpl
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DebugInfoManager
|
||||
import com.azure.android.communication.ui.calling.presentation.manager.DebugInfoManagerImpl
|
||||
import com.azure.android.communication.ui.calling.redux.AppStore
|
||||
import com.azure.android.communication.ui.calling.redux.state.AppReduxState
|
||||
import com.azure.android.communication.ui.calling.redux.state.CallingState
|
||||
|
@ -22,7 +22,7 @@ import org.mockito.kotlin.doAnswer
|
|||
import org.mockito.kotlin.mock
|
||||
|
||||
@RunWith(MockitoJUnitRunner::class)
|
||||
internal class DiagnosticsManagerTest : ACSBaseTestCoroutine() {
|
||||
internal class DebugInfoManagerTest : ACSBaseTestCoroutine() {
|
||||
|
||||
@Test
|
||||
@ExperimentalCoroutinesApi
|
||||
|
@ -37,14 +37,14 @@ internal class DiagnosticsManagerTest : ACSBaseTestCoroutine() {
|
|||
on { getStateFlow() } doAnswer { stateFlow }
|
||||
}
|
||||
|
||||
val diagnosticsManager: DiagnosticsManager = DiagnosticsManagerImpl(mockAppStore)
|
||||
val debugInfoManager: DebugInfoManager = DebugInfoManagerImpl(mockAppStore)
|
||||
val flowJob = launch {
|
||||
diagnosticsManager.start(coroutineScope = this)
|
||||
debugInfoManager.start(coroutineScope = this)
|
||||
}
|
||||
|
||||
val diagnostics1 = diagnosticsManager.diagnostics
|
||||
val diagnostics1 = debugInfoManager.debugInfo
|
||||
Assert.assertNotNull(diagnostics1)
|
||||
Assert.assertNull(diagnostics1.lastKnownCallId)
|
||||
Assert.assertNull(diagnostics1.lastCallId)
|
||||
|
||||
// update state
|
||||
val appState2 = AppReduxState("")
|
||||
|
@ -52,10 +52,10 @@ internal class DiagnosticsManagerTest : ACSBaseTestCoroutine() {
|
|||
appState2.callState = CallingState(CallingStatus.CONNECTING, callID)
|
||||
stateFlow.value = appState2
|
||||
|
||||
val diagnostics2 = diagnosticsManager.diagnostics
|
||||
val diagnostics2 = debugInfoManager.debugInfo
|
||||
Assert.assertNotSame(diagnostics1, diagnostics2)
|
||||
Assert.assertNotNull(diagnostics2)
|
||||
Assert.assertEquals(callID, diagnostics2.lastKnownCallId)
|
||||
Assert.assertEquals(callID, diagnostics2.lastCallId)
|
||||
|
||||
// redux state loosing CallID
|
||||
|
||||
|
@ -64,10 +64,10 @@ internal class DiagnosticsManagerTest : ACSBaseTestCoroutine() {
|
|||
appState3.callState = CallingState(CallingStatus.CONNECTING, null)
|
||||
stateFlow.value = appState3
|
||||
|
||||
val diagnostics3 = diagnosticsManager.diagnostics
|
||||
val diagnostics3 = debugInfoManager.debugInfo
|
||||
Assert.assertSame(diagnostics2, diagnostics3)
|
||||
Assert.assertNotNull(diagnostics3)
|
||||
Assert.assertEquals(callID, diagnostics3.lastKnownCallId)
|
||||
Assert.assertEquals(callID, diagnostics3.lastCallId)
|
||||
flowJob.cancel()
|
||||
}
|
||||
}
|
|
@ -22,10 +22,11 @@ class CallLauncherActivityErrorHandler(
|
|||
|
||||
override fun handle(it: CallCompositeErrorEvent) {
|
||||
println("================= application is logging exception =================")
|
||||
println("call id: " + (callComposite.diagnostics.lastKnownCallId ?: ""))
|
||||
println("call id: " + (callComposite.debugInfo.lastCallId ?: ""))
|
||||
println(it.cause)
|
||||
println(it.errorCode)
|
||||
activityWr.get()?.showAlert("${it.errorCode} ${it.cause?.message}. Call id: ${callComposite.diagnostics.lastKnownCallId ?: ""}")
|
||||
activityWr.get()
|
||||
?.showAlert("${it.errorCode} ${it.cause?.message}. Call id: ${callComposite.debugInfo.lastCallId ?: ""}")
|
||||
println("====================================================================")
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче