From 526e1689065cef6baa09411219f61fc6b1b0b8f2 Mon Sep 17 00:00:00 2001 From: Stefan Andonian Date: Mon, 30 Jan 2023 22:51:26 +0000 Subject: [PATCH] Move ViewCapture On/Off controls to QuickSettings Tile. Rather than use a feature flag for this feature, the on/off state will be stored as a system setting and will be changed via a QuickSettings tile. Bug: b/264452057 Test: Verified that the new QuickSettings tile doesn't crash via normal interactions (pressing, long-pressing, etc.). Also verified that ViewCapture is turned on when the QuickSettings tile is in the enabled state and is turned off when it is in the disabled state. Change-Id: I90551511ac2766dc30c51a25aec2c96e3e552ce9 --- .../com/android/launcher3/uioverrides/QuickstepLauncher.java | 4 ++-- .../src/com/android/quickstep/TouchInteractionService.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index abbd01ddfc..55378785d3 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -86,7 +86,7 @@ import androidx.annotation.BinderThread; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import com.android.app.viewcapture.ViewCapture; +import com.android.app.viewcapture.SettingsAwareViewCapture; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; @@ -556,7 +556,7 @@ public class QuickstepLauncher extends Launcher { addMultiWindowModeChangedListener(mDepthController); initUnfoldTransitionProgressProvider(); if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) { - mViewCapture = ViewCapture.getInstance().startCapture(getWindow()); + mViewCapture = SettingsAwareViewCapture.getInstance(this).startCapture(getWindow()); } getWindow().addPrivateFlags(PRIVATE_FLAG_OPTIMIZE_MEASURE); } diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index d19f124687..687ed36677 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -68,7 +68,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import com.android.app.viewcapture.ViewCapture; +import com.android.app.viewcapture.SettingsAwareViewCapture; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.LauncherPrefs; import com.android.launcher3.R; @@ -1208,7 +1208,7 @@ public class TouchInteractionService extends Service mTaskbarManager.dumpLogs("", pw); if (FeatureFlags.CONTINUOUS_VIEW_TREE_CAPTURE.get()) { - ViewCapture.getInstance().dump(pw, fd, this); + SettingsAwareViewCapture.getInstance(this).dump(pw, fd, this); } } }