summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Andonian <andonian@google.com>2023-03-17 00:45:38 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-03-17 00:45:38 +0000
commit604f29c47a345b9a41f0b6a89af1a1fdf7602b31 (patch)
tree29589b6a113e4cdcce315c4448b782691922524b
parent2f005b2b64df80148c17444ebc9b68b2e4250c7f (diff)
parent9eee407596b4a78dc0c8cadaf2eaad17e1ca377f (diff)
downloadsystemui-604f29c47a345b9a41f0b6a89af1a1fdf7602b31.tar.gz
Do not leak launcher context from the SettingsAwareViewCapture. am: 9eee407596
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/libs/systemui/+/22102493 Change-Id: Ia65828bcf3a5afaa09a6d95ecfbe40ef8de9e427 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--viewcapturelib/src/com/android/app/viewcapture/SettingsAwareViewCapture.kt5
1 files changed, 3 insertions, 2 deletions
diff --git a/viewcapturelib/src/com/android/app/viewcapture/SettingsAwareViewCapture.kt b/viewcapturelib/src/com/android/app/viewcapture/SettingsAwareViewCapture.kt
index ff9a3e0..c84d4d5 100644
--- a/viewcapturelib/src/com/android/app/viewcapture/SettingsAwareViewCapture.kt
+++ b/viewcapturelib/src/com/android/app/viewcapture/SettingsAwareViewCapture.kt
@@ -68,8 +68,9 @@ internal constructor(private val context: Context, choreographer: Choreographer,
@JvmStatic
fun getInstance(context: Context): ViewCapture = when {
INSTANCE != null -> INSTANCE!!
- Looper.myLooper() == Looper.getMainLooper() -> SettingsAwareViewCapture(context,
- Choreographer.getInstance(), createAndStartNewLooperExecutor("SAViewCapture",
+ Looper.myLooper() == Looper.getMainLooper() -> SettingsAwareViewCapture(
+ context.applicationContext, Choreographer.getInstance(),
+ createAndStartNewLooperExecutor("SAViewCapture",
Process.THREAD_PRIORITY_FOREGROUND)).also { INSTANCE = it }
else -> try {
MAIN_EXECUTOR.submit { getInstance(context) }.get()