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

Commit e3505039 authored by Mark Renouf's avatar Mark Renouf
Browse files

Move ScreenshotProxyService, etc to proxy/*, unify naming

The service implementation is internal and usage should only be
through the injectable interface 'ScreenshotProxy'. This also unifies
the naming to be consistent with the interface and client wrapper.

Flag: NONE straight rename no functional changes
Test: N/A
Bug: 339223847

Change-Id: Ie06aeabfb67f93fddd01981865a03a88c67fc625
parent d986d3e1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -458,7 +458,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