Loading packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +3 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,8 @@ import com.android.systemui.keyguard.ui.view.layout.sections.KeyguardSectionsMod import com.android.systemui.log.dagger.LogModule; import com.android.systemui.log.dagger.MonitorLog; import com.android.systemui.log.table.TableLogBuffer; import com.android.systemui.mediaprojection.appselector.MediaProjectionModule; import com.android.systemui.mediaprojection.MediaProjectionModule; import com.android.systemui.mediaprojection.appselector.MediaProjectionActivitiesModule; import com.android.systemui.mediaprojection.taskswitcher.MediaProjectionTaskSwitcherModule; import com.android.systemui.model.SceneContainerPlugin; import com.android.systemui.model.SysUiState; Loading Loading @@ -225,6 +226,7 @@ import javax.inject.Named; KeyguardSectionsModule.class, LetterboxModule.class, LogModule.class, MediaProjectionActivitiesModule.class, MediaProjectionModule.class, MediaProjectionTaskSwitcherModule.class, MotionToolModule.class, Loading packages/SystemUI/src/com/android/systemui/mediaprojection/MediaProjectionModule.kt 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.mediaprojection import com.android.systemui.mediaprojection.data.repository.MediaProjectionManagerRepository import com.android.systemui.mediaprojection.data.repository.MediaProjectionRepository import dagger.Binds import dagger.Module @Module interface MediaProjectionModule { @Binds fun mediaRepository(impl: MediaProjectionManagerRepository): MediaProjectionRepository } packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorComponent.kt +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ import kotlinx.coroutines.SupervisorJob subcomponents = [MediaProjectionAppSelectorComponent::class], includes = [MediaProjectionDevicePolicyModule::class] ) interface MediaProjectionModule { interface MediaProjectionActivitiesModule { @Binds @IntoMap @ClassKey(MediaProjectionAppSelectorActivity::class) Loading packages/SystemUI/src/com/android/systemui/mediaprojection/taskswitcher/data/model/MediaProjectionState.kt→packages/SystemUI/src/com/android/systemui/mediaprojection/data/model/MediaProjectionState.kt +2 −2 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.systemui.mediaprojection.taskswitcher.data.model package com.android.systemui.mediaprojection.data.model import android.app.ActivityManager.RunningTaskInfo Loading packages/SystemUI/src/com/android/systemui/mediaprojection/taskswitcher/data/repository/MediaProjectionManagerRepository.kt→packages/SystemUI/src/com/android/systemui/mediaprojection/data/repository/MediaProjectionManagerRepository.kt +11 −6 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.systemui.mediaprojection.taskswitcher.data.repository package com.android.systemui.mediaprojection.data.repository import android.app.ActivityManager.RunningTaskInfo import android.media.projection.MediaProjectionInfo Loading @@ -24,20 +24,21 @@ import android.util.Log import android.view.ContentRecordingSession import android.view.ContentRecordingSession.RECORD_CONTENT_DISPLAY import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.mediaprojection.MediaProjectionServiceHelper import com.android.systemui.mediaprojection.taskswitcher.data.model.MediaProjectionState import com.android.systemui.mediaprojection.data.model.MediaProjectionState import com.android.systemui.mediaprojection.taskswitcher.data.repository.TasksRepository import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.shareIn import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch import kotlinx.coroutines.withContext Loading Loading @@ -88,7 +89,11 @@ constructor( mediaProjectionManager.addCallback(callback, handler) awaitClose { mediaProjectionManager.removeCallback(callback) } } .shareIn(scope = applicationScope, started = SharingStarted.Lazily, replay = 1) .stateIn( scope = applicationScope, started = SharingStarted.Lazily, initialValue = MediaProjectionState.NotProjecting, ) private suspend fun stateForSession(session: ContentRecordingSession?): MediaProjectionState { if (session == null) { Loading Loading
packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +3 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,8 @@ import com.android.systemui.keyguard.ui.view.layout.sections.KeyguardSectionsMod import com.android.systemui.log.dagger.LogModule; import com.android.systemui.log.dagger.MonitorLog; import com.android.systemui.log.table.TableLogBuffer; import com.android.systemui.mediaprojection.appselector.MediaProjectionModule; import com.android.systemui.mediaprojection.MediaProjectionModule; import com.android.systemui.mediaprojection.appselector.MediaProjectionActivitiesModule; import com.android.systemui.mediaprojection.taskswitcher.MediaProjectionTaskSwitcherModule; import com.android.systemui.model.SceneContainerPlugin; import com.android.systemui.model.SysUiState; Loading Loading @@ -225,6 +226,7 @@ import javax.inject.Named; KeyguardSectionsModule.class, LetterboxModule.class, LogModule.class, MediaProjectionActivitiesModule.class, MediaProjectionModule.class, MediaProjectionTaskSwitcherModule.class, MotionToolModule.class, Loading
packages/SystemUI/src/com/android/systemui/mediaprojection/MediaProjectionModule.kt 0 → 100644 +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.systemui.mediaprojection import com.android.systemui.mediaprojection.data.repository.MediaProjectionManagerRepository import com.android.systemui.mediaprojection.data.repository.MediaProjectionRepository import dagger.Binds import dagger.Module @Module interface MediaProjectionModule { @Binds fun mediaRepository(impl: MediaProjectionManagerRepository): MediaProjectionRepository }
packages/SystemUI/src/com/android/systemui/mediaprojection/appselector/MediaProjectionAppSelectorComponent.kt +1 −1 Original line number Diff line number Diff line Loading @@ -65,7 +65,7 @@ import kotlinx.coroutines.SupervisorJob subcomponents = [MediaProjectionAppSelectorComponent::class], includes = [MediaProjectionDevicePolicyModule::class] ) interface MediaProjectionModule { interface MediaProjectionActivitiesModule { @Binds @IntoMap @ClassKey(MediaProjectionAppSelectorActivity::class) Loading
packages/SystemUI/src/com/android/systemui/mediaprojection/taskswitcher/data/model/MediaProjectionState.kt→packages/SystemUI/src/com/android/systemui/mediaprojection/data/model/MediaProjectionState.kt +2 −2 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.systemui.mediaprojection.taskswitcher.data.model package com.android.systemui.mediaprojection.data.model import android.app.ActivityManager.RunningTaskInfo Loading
packages/SystemUI/src/com/android/systemui/mediaprojection/taskswitcher/data/repository/MediaProjectionManagerRepository.kt→packages/SystemUI/src/com/android/systemui/mediaprojection/data/repository/MediaProjectionManagerRepository.kt +11 −6 Original line number Diff line number Diff line /* * Copyright (C) 2023 The Android Open Source Project * Copyright (C) 2024 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading @@ -14,7 +14,7 @@ * limitations under the License. */ package com.android.systemui.mediaprojection.taskswitcher.data.repository package com.android.systemui.mediaprojection.data.repository import android.app.ActivityManager.RunningTaskInfo import android.media.projection.MediaProjectionInfo Loading @@ -24,20 +24,21 @@ import android.util.Log import android.view.ContentRecordingSession import android.view.ContentRecordingSession.RECORD_CONTENT_DISPLAY import com.android.systemui.common.coroutine.ChannelExt.trySendWithFailureLogging import com.android.systemui.common.coroutine.ConflatedCallbackFlow.conflatedCallbackFlow import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Application import com.android.systemui.dagger.qualifiers.Background import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.mediaprojection.MediaProjectionServiceHelper import com.android.systemui.mediaprojection.taskswitcher.data.model.MediaProjectionState import com.android.systemui.mediaprojection.data.model.MediaProjectionState import com.android.systemui.mediaprojection.taskswitcher.data.repository.TasksRepository import com.android.systemui.utils.coroutines.flow.conflatedCallbackFlow import javax.inject.Inject import kotlinx.coroutines.CoroutineDispatcher import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.SharingStarted import kotlinx.coroutines.flow.shareIn import kotlinx.coroutines.flow.stateIn import kotlinx.coroutines.launch import kotlinx.coroutines.withContext Loading Loading @@ -88,7 +89,11 @@ constructor( mediaProjectionManager.addCallback(callback, handler) awaitClose { mediaProjectionManager.removeCallback(callback) } } .shareIn(scope = applicationScope, started = SharingStarted.Lazily, replay = 1) .stateIn( scope = applicationScope, started = SharingStarted.Lazily, initialValue = MediaProjectionState.NotProjecting, ) private suspend fun stateForSession(session: ContentRecordingSession?): MediaProjectionState { if (session == null) { Loading