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

Commit 233e3f2a authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12283639 from 70974f88 to 24Q4-release

Change-Id: Iff0fd755a6b375a631dc0bec71fe73ba37e00cfd
parents 71a6b90f 70974f88
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.os.Looper
import android.os.Process
import android.tracing.Flags
import android.util.Log
import android.view.WindowManager

/**
 * Factory to create polymorphic instances of ViewCapture according to build configurations and
@@ -68,5 +69,20 @@ class ViewCaptureFactory {
                }
            }.also { instance = it }
        }

        /** Returns an instance of [ViewCaptureAwareWindowManager]. */
        @JvmStatic
        fun getViewCaptureAwareWindowManagerInstance(
            context: Context,
            isViewCaptureTracingEnabled: Boolean
        ): ViewCaptureAwareWindowManager {
            val windowManager = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager
            val lazyViewCapture = lazy { getInstance(context) }
            return ViewCaptureAwareWindowManager(
                windowManager,
                lazyViewCapture,
                isViewCaptureTracingEnabled
            )
        }
    }
}