Merge "Clean-up unused dependencies from TaskContainer and RecentsDependencies" into main

This commit is contained in:
Treehugger Robot
2025-02-18 05:54:05 -08:00
committed by Android (Google) Code Review
4 changed files with 1 additions and 123 deletions
@@ -31,7 +31,6 @@ import com.android.quickstep.recents.domain.usecase.GetTaskUseCase
import com.android.quickstep.recents.domain.usecase.GetThumbnailPositionUseCase
import com.android.quickstep.recents.domain.usecase.IsThumbnailValidUseCase
import com.android.quickstep.recents.domain.usecase.OrganizeDesktopTasksUseCase
import com.android.quickstep.recents.usecase.GetThumbnailUseCase
import com.android.quickstep.recents.viewmodel.RecentsViewData
import com.android.quickstep.task.viewmodel.TaskOverlayViewModel
import com.android.systemui.shared.recents.model.Task
@@ -42,7 +41,7 @@ import kotlinx.coroutines.SupervisorJob
internal typealias RecentsScopeId = String
class RecentsDependencies private constructor(private val appContext: Context) {
class RecentsDependencies private constructor(appContext: Context) {
private val scopes = mutableMapOf<RecentsScopeId, RecentsDependenciesScope>()
init {
@@ -185,7 +184,6 @@ class RecentsDependencies private constructor(private val appContext: Context) {
IsThumbnailValidUseCase::class.java ->
IsThumbnailValidUseCase(rotationStateRepository = inject())
GetTaskUseCase::class.java -> GetTaskUseCase(repository = inject())
GetThumbnailUseCase::class.java -> GetThumbnailUseCase(taskRepository = inject())
GetSysUiStatusNavFlagsUseCase::class.java -> GetSysUiStatusNavFlagsUseCase()
GetThumbnailPositionUseCase::class.java ->
GetThumbnailPositionUseCase(
@@ -1,26 +0,0 @@
/*
* 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.quickstep.recents.usecase
import android.graphics.Bitmap
import com.android.quickstep.recents.data.RecentTasksRepository
/** Use case for retrieving thumbnail. */
class GetThumbnailUseCase(private val taskRepository: RecentTasksRepository) {
/** Returns the latest thumbnail associated with [taskId] if loaded, or null otherwise */
fun run(taskId: Int): Bitmap? = taskRepository.getCurrentThumbnailById(taskId)?.thumbnail
}
@@ -25,8 +25,6 @@ import com.android.launcher3.util.SplitConfigurationOptions
import com.android.launcher3.util.TransformingTouchDelegate
import com.android.quickstep.TaskOverlayFactory
import com.android.quickstep.ViewUtils.addAccessibleChildToList
import com.android.quickstep.recents.di.RecentsDependencies
import com.android.quickstep.recents.di.getScope
import com.android.quickstep.recents.ui.mapper.TaskUiStateMapper
import com.android.quickstep.recents.ui.viewmodel.TaskData
import com.android.quickstep.task.thumbnail.TaskThumbnailView
@@ -57,13 +55,6 @@ class TaskContainer(
init {
if (enableRefactorTaskThumbnail()) {
require(snapshotView is TaskThumbnailView)
RecentsDependencies.getScope(snapshotView).apply {
val taskViewScope = RecentsDependencies.getScope(taskView)
linkTo(taskViewScope)
val taskContainerScope = RecentsDependencies.getScope(this@TaskContainer)
linkTo(taskContainerScope)
}
} else {
require(snapshotView is TaskThumbnailViewDeprecated)
}
@@ -116,8 +107,6 @@ class TaskContainer(
snapshotView.scaleY = 1f
overlay.destroy()
if (enableRefactorTaskThumbnail()) {
RecentsDependencies.getInstance().removeScope(snapshotView)
RecentsDependencies.getInstance().removeScope(this)
isThumbnailValid = false
} else {
thumbnailViewDeprecated.setShowSplashForSplitSelection(false)