Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc166287 authored by Mark Renouf's avatar Mark Renouf Committed by Android (Google) Code Review
Browse files

Merge "Move ScreenshotProxyService, etc to proxy/*, unify naming" into main

parents 98d9d350 e3505039
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -459,7 +459,7 @@
                  android:label="@string/screenshot_scroll_label"
                  android:finishOnTaskLaunch="true" />

        <service android:name=".screenshot.ScreenshotProxyService"
        <service android:name=".screenshot.proxy.ScreenshotProxyService"
                 android:permission="com.android.systemui.permission.SELF"
                 android:exported="false" />

+4 −4
Original line number Diff line number Diff line
@@ -17,13 +17,13 @@
package com.android.systemui.screenshot

import android.content.Intent
import androidx.test.ext.junit.runners.AndroidJUnit4
import android.os.Process.myUserHandle
import android.platform.test.annotations.EnableFlags
import android.testing.TestableContext
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.android.systemui.Flags
import com.android.systemui.SysuiTestCase
import com.android.systemui.screenshot.proxy.SystemUiProxy
import com.android.systemui.screenshot.proxy.ScreenshotProxy
import com.android.systemui.settings.DisplayTracker
import com.android.systemui.shared.system.ActivityManagerWrapper
import com.android.systemui.statusbar.phone.CentralSurfaces
@@ -45,7 +45,7 @@ class ActionIntentExecutorTest : SysuiTestCase() {
    private val testableContext = TestableContext(mContext)

    private val activityManagerWrapper = mock<ActivityManagerWrapper>()
    private val systemUiProxy = mock<SystemUiProxy>()
    private val screenshotProxy = mock<ScreenshotProxy>()

    private val displayTracker = mock<DisplayTracker>()

@@ -55,7 +55,7 @@ class ActionIntentExecutorTest : SysuiTestCase() {
            activityManagerWrapper,
            testScope,
            mainDispatcher,
            systemUiProxy,
            screenshotProxy,
            displayTracker,
        )

+4 −4
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ import com.android.systemui.Flags
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dagger.qualifiers.Application
import com.android.systemui.dagger.qualifiers.Main
import com.android.systemui.screenshot.proxy.SystemUiProxy
import com.android.systemui.screenshot.proxy.ScreenshotProxy
import com.android.systemui.settings.DisplayTracker
import com.android.systemui.shared.system.ActivityManagerWrapper
import com.android.systemui.statusbar.phone.CentralSurfaces
@@ -55,7 +55,7 @@ constructor(
    private val activityManagerWrapper: ActivityManagerWrapper,
    @Application private val applicationScope: CoroutineScope,
    @Main private val mainDispatcher: CoroutineDispatcher,
    private val systemUiProxy: SystemUiProxy,
    private val screenshotProxy: ScreenshotProxy,
    private val displayTracker: DisplayTracker,
) {
    /**
@@ -89,7 +89,7 @@ constructor(
                CentralSurfaces.SYSTEM_DIALOG_REASON_SCREENSHOT
            )
        }
        systemUiProxy.dismissKeyguard()
        screenshotProxy.dismissKeyguard()
        var transitionOptions: ActivityOptions? = null
        if (transitionCoordinator?.decor?.isAttachedToWindow == true) {
            transitionCoordinator.startExit()
@@ -127,7 +127,7 @@ constructor(
    private suspend fun launchCrossProfileIntent(
        user: UserHandle,
        intent: Intent,
        bundle: Bundle?
        bundle: Bundle?,
    ) {
        val connector = getCrossProfileConnector(user)
        val completion = CompletableDeferred<Unit>()
+2 −2
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ import com.android.systemui.screenshot.appclips.AppClipsScreenshotHelperService;
import com.android.systemui.screenshot.appclips.AppClipsService;
import com.android.systemui.screenshot.message.MessageModule;
import com.android.systemui.screenshot.policy.ScreenshotPolicyModule;
import com.android.systemui.screenshot.proxy.SystemUiProxyModule;
import com.android.systemui.screenshot.proxy.ScreenshotProxyModule;
import com.android.systemui.screenshot.ui.viewmodel.ScreenshotViewModel;

import dagger.Binds;
@@ -50,7 +50,7 @@ import dagger.multibindings.IntoMap;
/**
 * Defines injectable resources for Screenshots
 */
@Module(includes = {ScreenshotPolicyModule.class, SystemUiProxyModule.class, MessageModule.class})
@Module(includes = {ScreenshotPolicyModule.class, ScreenshotProxyModule.class, MessageModule.class})
public abstract class ScreenshotModule {

    @Binds
+5 −5
Original line number Diff line number Diff line
@@ -22,21 +22,21 @@ import android.app.IActivityTaskManager
import com.android.systemui.dagger.qualifiers.Background
import com.android.systemui.screenshot.data.model.DisplayContentModel
import com.android.systemui.screenshot.data.model.SystemUiState
import com.android.systemui.screenshot.proxy.SystemUiProxy
import com.android.systemui.screenshot.proxy.ScreenshotProxy
import javax.inject.Inject
import kotlinx.coroutines.CoroutineDispatcher
import kotlinx.coroutines.withContext

/**
 * Implements DisplayTaskRepository using [IActivityTaskManager], along with [ProfileTypeRepository]
 * and [SystemUiProxy].
 * and [ScreenshotProxy].
 */
@SuppressLint("MissingPermission")
class DisplayContentRepositoryImpl
@Inject
constructor(
    private val atmService: IActivityTaskManager,
    private val systemUiProxy: SystemUiProxy,
    private val screenshotProxy: ScreenshotProxy,
    @Background private val background: CoroutineDispatcher,
) : DisplayContentRepository {

@@ -53,8 +53,8 @@ constructor(
    ): DisplayContentModel {
        return DisplayContentModel(
            displayId,
            SystemUiState(systemUiProxy.isNotificationShadeExpanded()),
            rootTasks
            SystemUiState(screenshotProxy.isNotificationShadeExpanded()),
            rootTasks,
        )
    }
}
Loading