Loading viewcapturelib/src/com/android/app/viewcapture/ViewCaptureFactory.kt +16 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 ) } } } Loading
viewcapturelib/src/com/android/app/viewcapture/ViewCaptureFactory.kt +16 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -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 ) } } }