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

Commit c2f12bf9 authored by Matt Casey's avatar Matt Casey
Browse files

Remove unused ScreenshotData.contextUrl field.

Assist content is hadled outside of screenshot data.

Also a minor tweak to make the kotlin more idiomatic and use real int
constants in tests (resolving an IDE warning).

Bug: NONE code cleanups.
Flag: EXEMPT code cleanups.
Test: atest com.android.systemui.screenshot
Change-Id: I13aa753b8821e56d54f3c56b59b62b6487c55d20
parent a8cd8b7c
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -4,10 +4,10 @@ import android.content.ComponentName
import android.graphics.Bitmap
import android.graphics.Insets
import android.graphics.Rect
import android.net.Uri
import android.os.Process
import android.os.UserHandle
import android.view.Display
import android.view.WindowManager
import android.view.WindowManager.ScreenshotSource
import android.view.WindowManager.ScreenshotType
import androidx.annotation.VisibleForTesting
@@ -26,11 +26,9 @@ data class ScreenshotData(
    var insets: Insets,
    var bitmap: Bitmap?,
    var displayId: Int,
    /** App-provided URL representing the content the user was looking at in the screenshot. */
    var contextUrl: Uri? = null,
) {
    val packageNameString: String
        get() = if (topComponent == null) "" else topComponent!!.packageName
    val packageNameString
        get() = topComponent?.packageName ?: ""

    fun getUserOrDefault(): UserHandle {
        return userHandle ?: Process.myUserHandle()
@@ -54,8 +52,8 @@ data class ScreenshotData(
        @VisibleForTesting
        fun forTesting() =
            ScreenshotData(
                type = 0,
                source = 0,
                type = WindowManager.TAKE_SCREENSHOT_FULLSCREEN,
                source = ScreenshotSource.SCREENSHOT_KEY_CHORD,
                userHandle = null,
                topComponent = null,
                screenBounds = null,