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

Commit 8250a0a2 authored by Nick Chameyev's avatar Nick Chameyev
Browse files

[Partial Screensharing] Enable recent tasks

Enables recent tasks in media projection app
selector activity and updates screenshot
test goldens.

Bug: 240119797
Test: screenshot test
Change-Id: I33f617bdb5fd90c5489ea55b3b14003f2de0570f
parent 59b7cd4e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.testing.screenshot
import android.app.Activity
import android.graphics.Color
import android.view.View
import android.view.Window
import android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
import androidx.core.view.WindowInsetsCompat
import androidx.core.view.WindowInsetsControllerCompat
@@ -51,13 +52,14 @@ class ExternalViewScreenshotTestRule(emulationSpec: DeviceEmulationSpec) : TestR

    /**
     * Compare the content of the [view] with the golden image identified by [goldenIdentifier] in
     * the context of [emulationSpec].
     * the context of [emulationSpec]. Window must be specified to capture views that render
     * hardware buffers.
     */
    fun screenshotTest(goldenIdentifier: String, view: View) {
    fun screenshotTest(goldenIdentifier: String, view: View, window: Window? = null) {
        view.removeElevationRecursively()

        ScreenshotRuleAsserter.Builder(screenshotRule)
            .setScreenshotProvider { view.toBitmap() }
            .setScreenshotProvider { view.toBitmap(window) }
            .withMatcher(matcher)
            .build()
            .assertGoldenImage(goldenIdentifier)
@@ -94,6 +96,6 @@ class ExternalViewScreenshotTestRule(emulationSpec: DeviceEmulationSpec) : TestR
            activity.currentFocus?.clearFocus()
        }

        screenshotTest(goldenIdentifier, rootView)
        screenshotTest(goldenIdentifier, rootView, activity.window)
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -182,8 +182,7 @@ class MediaProjectionAppSelectorActivity(

    override fun shouldGetOnlyDefaultActivities() = false

    // TODO(b/240924732) flip the flag when the recents selector is ready
    override fun shouldShowContentPreview() = false
    override fun shouldShowContentPreview() = true

    override fun createContentPreviewView(parent: ViewGroup): ViewGroup =
        recentsViewController.createView(parent)