summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Matt Casey <mrcasey@google.com> 2024-10-01 14:53:57 +0000
committer Matt Casey <mrcasey@google.com> 2024-10-01 19:25:46 +0000
commitc2f12bf92a40b91f9726ebf8bfdad357366f28c6 (patch)
tree8fd80ec96504b281b14e79e4852ad1604ebb3381
parenta8cd8b7cbeaade64e6ba81fd889ca90a7250a52a (diff)
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
-rw-r--r--packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotData.kt12
1 files changed, 5 insertions, 7 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotData.kt b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotData.kt
index 4fdd90bdcded..b5d45a488997 100644
--- a/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotData.kt
+++ b/packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotData.kt
@@ -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,