Loading viewcapturelib/src/com/android/app/viewcapture/NoOpViewCapture.kt 0 → 100644 +21 −0 Original line number Diff line number Diff line package com.android.app.viewcapture import android.media.permission.SafeCloseable import android.os.HandlerThread import android.view.View import android.view.Window /** * We don't want to enable the ViewCapture for release builds, since it currently only serves * 1p apps, and has memory / cpu load that we don't want to risk negatively impacting release builds */ class NoOpViewCapture: ViewCapture(0, 0, createAndStartNewLooperExecutor("NoOpViewCapture", HandlerThread.MIN_PRIORITY)) { override fun startCapture(view: View?, name: String?): SafeCloseable { return SafeCloseable { } } override fun startCapture(window: Window?): SafeCloseable { return SafeCloseable { } } } No newline at end of file viewcapturelib/src/com/android/app/viewcapture/SettingsAwareViewCapture.kt +1 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ internal constructor(private val context: Context, executor: Executor) @JvmStatic fun getInstance(context: Context): ViewCapture = when { INSTANCE != null -> INSTANCE!! !android.os.Build.IS_DEBUGGABLE -> NoOpViewCapture() Looper.myLooper() == Looper.getMainLooper() -> SettingsAwareViewCapture( context.applicationContext, createAndStartNewLooperExecutor("SAViewCapture", Loading viewcapturelib/src/com/android/app/viewcapture/ViewCapture.java +2 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ public abstract class ViewCapture { } @AnyThread public void dumpTo(OutputStream os, Context context) protected void dumpTo(OutputStream os, Context context) throws InterruptedException, ExecutionException, IOException { if (mIsEnabled) getExportedData(context).writeTo(os); } Loading Loading @@ -382,6 +382,7 @@ public abstract class ViewCapture { } void attachToRoot() { if (mRoot == null) return; mIsActive = true; if (mRoot.isAttachedToWindow()) { safelyEnableOnDrawListener(); Loading Loading
viewcapturelib/src/com/android/app/viewcapture/NoOpViewCapture.kt 0 → 100644 +21 −0 Original line number Diff line number Diff line package com.android.app.viewcapture import android.media.permission.SafeCloseable import android.os.HandlerThread import android.view.View import android.view.Window /** * We don't want to enable the ViewCapture for release builds, since it currently only serves * 1p apps, and has memory / cpu load that we don't want to risk negatively impacting release builds */ class NoOpViewCapture: ViewCapture(0, 0, createAndStartNewLooperExecutor("NoOpViewCapture", HandlerThread.MIN_PRIORITY)) { override fun startCapture(view: View?, name: String?): SafeCloseable { return SafeCloseable { } } override fun startCapture(window: Window?): SafeCloseable { return SafeCloseable { } } } No newline at end of file
viewcapturelib/src/com/android/app/viewcapture/SettingsAwareViewCapture.kt +1 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,7 @@ internal constructor(private val context: Context, executor: Executor) @JvmStatic fun getInstance(context: Context): ViewCapture = when { INSTANCE != null -> INSTANCE!! !android.os.Build.IS_DEBUGGABLE -> NoOpViewCapture() Looper.myLooper() == Looper.getMainLooper() -> SettingsAwareViewCapture( context.applicationContext, createAndStartNewLooperExecutor("SAViewCapture", Loading
viewcapturelib/src/com/android/app/viewcapture/ViewCapture.java +2 −1 Original line number Diff line number Diff line Loading @@ -173,7 +173,7 @@ public abstract class ViewCapture { } @AnyThread public void dumpTo(OutputStream os, Context context) protected void dumpTo(OutputStream os, Context context) throws InterruptedException, ExecutionException, IOException { if (mIsEnabled) getExportedData(context).writeTo(os); } Loading Loading @@ -382,6 +382,7 @@ public abstract class ViewCapture { } void attachToRoot() { if (mRoot == null) return; mIsActive = true; if (mRoot.isAttachedToWindow()) { safelyEnableOnDrawListener(); Loading