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

Commit 6da5689e authored by George Lin's avatar George Lin Committed by Android (Google) Code Review
Browse files

Merge "Fix SurfaceControlViewHost holding surface view (3/4)" into main

parents 33685504 97468b73
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -124,8 +124,9 @@ constructor(
) {
    private var host: SurfaceControlViewHost

    private var _surfacePackage: SurfaceControlViewHost.SurfacePackage? = null
    val surfacePackage: SurfaceControlViewHost.SurfacePackage
        get() = checkNotNull(host.surfacePackage)
        get() = _surfacePackage ?: checkNotNull(host.surfacePackage).also { _surfacePackage = it }

    private var smartSpaceView: View? = null
    private var largeDateView: View? = null
@@ -155,7 +156,11 @@ constructor(
                    previewViewModel.hostToken?.let { InputTransferToken(it) },
                    TAG,
                )
            disposables += DisposableHandle { host.release() }
            disposables += DisposableHandle {
                _surfacePackage?.release()
                _surfacePackage = null
                host.release()
            }
        }
    }