Loading packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/ScreenRecordTileTest.java +0 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor; import com.android.systemui.qs.tileimpl.QSTileImpl; import com.android.systemui.res.R; import com.android.systemui.screencapture.domain.interactor.ScreenCaptureUiInteractorKosmosKt; import com.android.systemui.screencapture.record.domain.interactor.ScreenCaptureRecordFeaturesInteractorKosmosKt; import com.android.systemui.screenrecord.ScreenRecordUxController; import com.android.systemui.settings.UserContextProvider; import com.android.systemui.statusbar.phone.KeyguardDismissUtil; Loading Loading @@ -160,8 +159,6 @@ public class ScreenRecordTileTest extends SysuiTestCase { mDialogTransitionAnimator, mPanelInteractor, mMediaProjectionMetricsLogger, ScreenCaptureRecordFeaturesInteractorKosmosKt .getScreenCaptureRecordFeaturesInteractor(mKosmos), ScreenCaptureUiInteractorKosmosKt.getScreenCaptureUiInteractor(mKosmos), mUserContextProvider ); Loading packages/SystemUI/multivalentTests/src/com/android/systemui/screencapture/record/domain/interactor/ScreenCaptureRecordFeaturesInteractorTest.kt→packages/SystemUI/multivalentTests/src/com/android/systemui/screencapture/domain/interactor/ScreenCaptureUiInteractorTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.systemui.screencapture.record.domain.interactor package com.android.systemui.screencapture.domain.interactor import android.content.testableContext import android.platform.test.flag.junit.SetFlagsRule Loading @@ -33,13 +33,13 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class ScreenCaptureRecordFeaturesInteractorTest : SysuiTestCase() { class ScreenCaptureUiInteractorTest : SysuiTestCase() { @get:Rule val setFlagsRule = SetFlagsRule() private val kosmos = testKosmos() private val underTest by lazy { kosmos.screenCaptureRecordFeaturesInteractor } private val underTest by lazy { kosmos.screenCaptureUiInteractor } @Test fun isLargeScreenReturnsConfigValue() = Loading packages/SystemUI/src/com/android/systemui/qs/tiles/ScreenRecordTile.java +1 −4 Original line number Diff line number Diff line Loading @@ -83,7 +83,6 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> private final MediaProjectionMetricsLogger mMediaProjectionMetricsLogger; private final UserContextProvider mUserContextProvider; private final ScreenCaptureUiInteractor mScreenCaptureUiInteractor; private final ScreenCaptureRecordFeaturesInteractor mScreenCaptureRecordFeaturesInteractor; private long mMillisUntilFinished = 0; Loading @@ -105,7 +104,6 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> DialogTransitionAnimator dialogTransitionAnimator, PanelInteractor panelInteractor, MediaProjectionMetricsLogger mediaProjectionMetricsLogger, ScreenCaptureRecordFeaturesInteractor screenCaptureRecordFeaturesInteractor, ScreenCaptureUiInteractor screenCaptureUiInteractor, UserContextProvider userContextProvider ) { Loading @@ -119,7 +117,6 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> mDialogTransitionAnimator = dialogTransitionAnimator; mPanelInteractor = panelInteractor; mMediaProjectionMetricsLogger = mediaProjectionMetricsLogger; mScreenCaptureRecordFeaturesInteractor = screenCaptureRecordFeaturesInteractor; mScreenCaptureUiInteractor = screenCaptureUiInteractor; mUserContextProvider = userContextProvider; } Loading @@ -134,7 +131,7 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> @Override protected void handleClick(@Nullable Expandable expandable) { if (ScreenCaptureRecordFeaturesInteractor.Companion.getShouldShowNewToolbar()) { if (ScreenCaptureRecordFeaturesInteractor.INSTANCE.getShouldShowNewToolbar()) { UserHandle userHandle = UserHandle.of(getCurrentTileUser()); mActivityStarter.postQSRunnableDismissingKeyguard( () -> mScreenCaptureUiInteractor.show( Loading packages/SystemUI/src/com/android/systemui/screencapture/domain/interactor/ScreenCaptureUiInteractor.kt +23 −1 Original line number Diff line number Diff line Loading @@ -16,18 +16,40 @@ package com.android.systemui.screencapture.domain.interactor import android.content.res.Resources import com.android.dream.lowlight.dagger.qualifiers.Application import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.res.R import com.android.systemui.screencapture.common.shared.model.ScreenCaptureActivityIntentParameters import com.android.systemui.screencapture.common.shared.model.ScreenCaptureType import com.android.systemui.screencapture.common.shared.model.ScreenCaptureUiState import com.android.systemui.screencapture.data.repository.ScreenCaptureUiRepository import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.onConfigChanged import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.stateIn @SysUISingleton class ScreenCaptureUiInteractor @Inject constructor(private val repository: ScreenCaptureUiRepository) { constructor( @Main private val resources: Resources, @Application private val scope: CoroutineScope, configurationController: ConfigurationController, private val repository: ScreenCaptureUiRepository, ) { val isLargeScreen: Flow<Boolean?> = configurationController.onConfigChanged .onStart { emit(resources.configuration) } .map { resources.getBoolean(R.bool.config_enableLargeScreenScreencapture) } .stateIn(scope, SharingStarted.WhileSubscribed(), null) fun uiState(type: ScreenCaptureType): Flow<ScreenCaptureUiState> = repository.uiState(type) Loading packages/SystemUI/src/com/android/systemui/screencapture/record/domain/interactor/ScreenCaptureRecordFeaturesInteractor.kt +7 −33 Original line number Diff line number Diff line Loading @@ -16,37 +16,12 @@ package com.android.systemui.screencapture.record.domain.interactor import android.content.res.Resources import com.android.dream.lowlight.dagger.qualifiers.Application import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.res.R import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.onConfigChanged import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.stateIn @SysUISingleton class ScreenCaptureRecordFeaturesInteractor @Inject constructor( @Main private val resources: Resources, @Application private val scope: CoroutineScope, configurationController: ConfigurationController, ) { val isLargeScreen: Flow<Boolean?> = configurationController.onConfigChanged .onStart { emit(resources.configuration) } .map { resources.getBoolean(R.bool.config_enableLargeScreenScreencapture) } .stateIn(scope, SharingStarted.WhileSubscribed(), null) object ScreenCaptureRecordFeaturesInteractor { companion object { val isNewScreenRecordToolbarEnabled: Boolean get() = Flags.newScreenRecordToolbar() Loading @@ -56,4 +31,3 @@ constructor( val shouldShowNewToolbar: Boolean get() = isNewScreenRecordToolbarEnabled || isLargeScreenScreencaptureEnabled } } Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/qs/tiles/ScreenRecordTileTest.java +0 −3 Original line number Diff line number Diff line Loading @@ -64,7 +64,6 @@ import com.android.systemui.qs.pipeline.domain.interactor.PanelInteractor; import com.android.systemui.qs.tileimpl.QSTileImpl; import com.android.systemui.res.R; import com.android.systemui.screencapture.domain.interactor.ScreenCaptureUiInteractorKosmosKt; import com.android.systemui.screencapture.record.domain.interactor.ScreenCaptureRecordFeaturesInteractorKosmosKt; import com.android.systemui.screenrecord.ScreenRecordUxController; import com.android.systemui.settings.UserContextProvider; import com.android.systemui.statusbar.phone.KeyguardDismissUtil; Loading Loading @@ -160,8 +159,6 @@ public class ScreenRecordTileTest extends SysuiTestCase { mDialogTransitionAnimator, mPanelInteractor, mMediaProjectionMetricsLogger, ScreenCaptureRecordFeaturesInteractorKosmosKt .getScreenCaptureRecordFeaturesInteractor(mKosmos), ScreenCaptureUiInteractorKosmosKt.getScreenCaptureUiInteractor(mKosmos), mUserContextProvider ); Loading
packages/SystemUI/multivalentTests/src/com/android/systemui/screencapture/record/domain/interactor/ScreenCaptureRecordFeaturesInteractorTest.kt→packages/SystemUI/multivalentTests/src/com/android/systemui/screencapture/domain/interactor/ScreenCaptureUiInteractorTest.kt +3 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.systemui.screencapture.record.domain.interactor package com.android.systemui.screencapture.domain.interactor import android.content.testableContext import android.platform.test.flag.junit.SetFlagsRule Loading @@ -33,13 +33,13 @@ import org.junit.runner.RunWith @SmallTest @RunWith(AndroidJUnit4::class) class ScreenCaptureRecordFeaturesInteractorTest : SysuiTestCase() { class ScreenCaptureUiInteractorTest : SysuiTestCase() { @get:Rule val setFlagsRule = SetFlagsRule() private val kosmos = testKosmos() private val underTest by lazy { kosmos.screenCaptureRecordFeaturesInteractor } private val underTest by lazy { kosmos.screenCaptureUiInteractor } @Test fun isLargeScreenReturnsConfigValue() = Loading
packages/SystemUI/src/com/android/systemui/qs/tiles/ScreenRecordTile.java +1 −4 Original line number Diff line number Diff line Loading @@ -83,7 +83,6 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> private final MediaProjectionMetricsLogger mMediaProjectionMetricsLogger; private final UserContextProvider mUserContextProvider; private final ScreenCaptureUiInteractor mScreenCaptureUiInteractor; private final ScreenCaptureRecordFeaturesInteractor mScreenCaptureRecordFeaturesInteractor; private long mMillisUntilFinished = 0; Loading @@ -105,7 +104,6 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> DialogTransitionAnimator dialogTransitionAnimator, PanelInteractor panelInteractor, MediaProjectionMetricsLogger mediaProjectionMetricsLogger, ScreenCaptureRecordFeaturesInteractor screenCaptureRecordFeaturesInteractor, ScreenCaptureUiInteractor screenCaptureUiInteractor, UserContextProvider userContextProvider ) { Loading @@ -119,7 +117,6 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> mDialogTransitionAnimator = dialogTransitionAnimator; mPanelInteractor = panelInteractor; mMediaProjectionMetricsLogger = mediaProjectionMetricsLogger; mScreenCaptureRecordFeaturesInteractor = screenCaptureRecordFeaturesInteractor; mScreenCaptureUiInteractor = screenCaptureUiInteractor; mUserContextProvider = userContextProvider; } Loading @@ -134,7 +131,7 @@ public class ScreenRecordTile extends QSTileImpl<QSTile.BooleanState> @Override protected void handleClick(@Nullable Expandable expandable) { if (ScreenCaptureRecordFeaturesInteractor.Companion.getShouldShowNewToolbar()) { if (ScreenCaptureRecordFeaturesInteractor.INSTANCE.getShouldShowNewToolbar()) { UserHandle userHandle = UserHandle.of(getCurrentTileUser()); mActivityStarter.postQSRunnableDismissingKeyguard( () -> mScreenCaptureUiInteractor.show( Loading
packages/SystemUI/src/com/android/systemui/screencapture/domain/interactor/ScreenCaptureUiInteractor.kt +23 −1 Original line number Diff line number Diff line Loading @@ -16,18 +16,40 @@ package com.android.systemui.screencapture.domain.interactor import android.content.res.Resources import com.android.dream.lowlight.dagger.qualifiers.Application import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.res.R import com.android.systemui.screencapture.common.shared.model.ScreenCaptureActivityIntentParameters import com.android.systemui.screencapture.common.shared.model.ScreenCaptureType import com.android.systemui.screencapture.common.shared.model.ScreenCaptureUiState import com.android.systemui.screencapture.data.repository.ScreenCaptureUiRepository import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.onConfigChanged import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.stateIn @SysUISingleton class ScreenCaptureUiInteractor @Inject constructor(private val repository: ScreenCaptureUiRepository) { constructor( @Main private val resources: Resources, @Application private val scope: CoroutineScope, configurationController: ConfigurationController, private val repository: ScreenCaptureUiRepository, ) { val isLargeScreen: Flow<Boolean?> = configurationController.onConfigChanged .onStart { emit(resources.configuration) } .map { resources.getBoolean(R.bool.config_enableLargeScreenScreencapture) } .stateIn(scope, SharingStarted.WhileSubscribed(), null) fun uiState(type: ScreenCaptureType): Flow<ScreenCaptureUiState> = repository.uiState(type) Loading
packages/SystemUI/src/com/android/systemui/screencapture/record/domain/interactor/ScreenCaptureRecordFeaturesInteractor.kt +7 −33 Original line number Diff line number Diff line Loading @@ -16,37 +16,12 @@ package com.android.systemui.screencapture.record.domain.interactor import android.content.res.Resources import com.android.dream.lowlight.dagger.qualifiers.Application import com.android.systemui.Flags import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.res.R import com.android.systemui.statusbar.policy.ConfigurationController import com.android.systemui.statusbar.policy.onConfigChanged import javax.inject.Inject import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.stateIn @SysUISingleton class ScreenCaptureRecordFeaturesInteractor @Inject constructor( @Main private val resources: Resources, @Application private val scope: CoroutineScope, configurationController: ConfigurationController, ) { val isLargeScreen: Flow<Boolean?> = configurationController.onConfigChanged .onStart { emit(resources.configuration) } .map { resources.getBoolean(R.bool.config_enableLargeScreenScreencapture) } .stateIn(scope, SharingStarted.WhileSubscribed(), null) object ScreenCaptureRecordFeaturesInteractor { companion object { val isNewScreenRecordToolbarEnabled: Boolean get() = Flags.newScreenRecordToolbar() Loading @@ -56,4 +31,3 @@ constructor( val shouldShowNewToolbar: Boolean get() = isNewScreenRecordToolbarEnabled || isLargeScreenScreencaptureEnabled } }