diff --git a/packages/SystemUI/screenshot/src/com/android/systemui/testing/screenshot/ViewCapture.kt b/packages/SystemUI/screenshot/src/com/android/systemui/testing/screenshot/ViewCapture.kt index cdedc64ed0e9c..97665145ce764 100644 --- a/packages/SystemUI/screenshot/src/com/android/systemui/testing/screenshot/ViewCapture.kt +++ b/packages/SystemUI/screenshot/src/com/android/systemui/testing/screenshot/ViewCapture.kt @@ -93,8 +93,8 @@ fun View.toBitmap(window: Window? = null): Bitmap { Futures.addCallback( captureToBitmap(window), object : FutureCallback { - override fun onSuccess(result: Bitmap) { - continuation.resumeWith(Result.success(result)) + override fun onSuccess(result: Bitmap?) { + continuation.resumeWith(Result.success(result!!)) } override fun onFailure(t: Throwable) {