From b67a15ddd9de4c49432dc4a4ba086e5bb1ef7323 Mon Sep 17 00:00:00 2001 From: Tracy Zhou Date: Tue, 15 Oct 2019 20:51:51 +0000 Subject: [PATCH] Revert "Merging ub-launcher3-master, build 5938524" This reverts commit 7cb721fa819992391045e70e5c109d8d43099a78. Reason for revert: Change-Id: I10ebd177cc98be896282147df481b05f28241758 --- Android.mk | 6 +- .../GoLauncherAppTransitionManagerImpl.java | 14 +- .../uioverrides/RecentsUiFactory.java | 2 +- .../AppToOverviewAnimationProvider.java | 29 +- ... => FallbackActivityControllerHelper.java} | 20 +- ...face.java => GoActivityControlHelper.java} | 4 +- ... => LauncherActivityControllerHelper.java} | 9 +- .../quickstep/OverviewCommandHelper.java | 20 +- .../quickstep/TouchInteractionService.java | 45 +- .../launcher3/icons/BaseIconFactory.java | 12 +- .../launcher3/icons/cache/BaseIconCache.java | 14 +- .../launcher3/icons/cache/CachingLogic.java | 7 +- .../icons/cache/IconCacheUpdateHandler.java | 4 +- .../LauncherAppTransitionManagerImpl.java | 19 +- .../launcher3/LauncherInitListenerEx.java | 2 +- .../uioverrides/RecentsUiFactory.java | 43 +- .../states/BackgroundAppState.java | 2 +- .../FlingAndHoldTouchController.java | 32 +- .../QuickSwitchTouchController.java | 4 +- .../AppToOverviewAnimationProvider.java | 38 +- .../android/quickstep/BaseSwipeUpHandler.java | 152 ++--- ... => FallbackActivityControllerHelper.java} | 20 +- ... => LauncherActivityControllerHelper.java} | 66 +-- .../quickstep/OverviewCommandHelper.java | 52 +- .../QuickstepTestInformationHandler.java | 58 +- .../android/quickstep/RecentsActivity.java | 30 +- .../quickstep/RecentsAnimationWrapper.java} | 164 +++--- .../android/quickstep/SwipeSharedState.java | 75 +-- .../android/quickstep/TaskSystemShortcut.java | 21 +- .../com/android/quickstep/TaskViewUtils.java | 58 +- .../quickstep/TouchInteractionService.java | 523 +++++++++++------- .../src/com/android/quickstep/ViewUtils.java | 74 --- .../WindowTransformSwipeHandler.java | 183 +++--- .../fallback/FallbackRecentsView.java | 2 +- .../AccessibilityInputConsumer.java | 51 +- ...sumer.java => AssistantTouchConsumer.java} | 87 +-- .../inputconsumers/DelegateInputConsumer.java | 1 - .../DeviceLockedInputConsumer.java | 77 ++- .../FallbackNoButtonInputConsumer.java | 58 +- .../inputconsumers}/InputConsumer.java | 4 +- .../OtherActivityInputConsumer.java | 53 +- .../inputconsumers/OverviewInputConsumer.java | 19 +- .../OverviewWithoutFocusInputConsumer.java | 18 +- .../QuickCaptureInputConsumer.java | 221 -------- .../ResetGestureInputConsumer.java | 1 - .../ScreenPinnedInputConsumer.java | 29 +- ...onHelper.java => ClipAnimationHelper.java} | 164 +++--- .../quickstep}/util/ObjectWrapper.java | 2 +- .../util/RecentsAnimationListenerSet.java} | 117 ++-- .../util/StaggeredWorkspaceAnim.java | 52 +- .../util/SwipeAnimationTargetSet.java | 119 ++++ .../quickstep/views/LauncherRecentsView.java | 148 +---- .../views/RecentsExtraViewContainer.java | 54 -- .../android/quickstep/views/RecentsView.java | 121 +--- .../android/quickstep/views/TaskMenuView.java | 2 - .../quickstep/views/TaskThumbnailView.java | 67 +-- .../launcher3/LauncherAnimationRunner.java | 10 +- .../launcher3/LauncherInitListener.java | 31 +- .../QuickstepAppTransitionManagerImpl.java | 97 ++-- .../uioverrides/BackButtonAlphaHandler.java | 19 +- .../uioverrides/DejankBinderTracker.java | 4 +- .../launcher3/uioverrides/UiFactory.java | 25 +- .../PortraitStatesTouchController.java | 23 +- .../StatusBarTouchController.java | 26 +- ...erface.java => ActivityControlHelper.java} | 25 +- .../quickstep/BaseRecentsActivity.java | 8 +- .../com/android/quickstep/GestureState.java | 36 -- .../quickstep/OverviewComponentObserver.java | 34 +- .../quickstep/OverviewInteractionState.java | 146 +++++ .../quickstep/RecentsActivityTracker.java | 130 +++++ .../RecentsAnimationDeviceState.java | 426 -------------- .../quickstep/RecentsAnimationTargets.java | 53 -- .../com/android/quickstep/RecentsModel.java | 59 +- .../quickstep/SysUINavigationMode.java | 2 +- .../com/android/quickstep/SystemUiProxy.java | 285 ---------- .../src/com/android/quickstep/TaskUtils.java | 9 +- .../logging/StatsLogCompatManager.java | 115 +--- .../quickstep/util/ActivityInitListener.java | 60 -- .../util/RemoteAnimationProvider.java | 9 +- .../RemoteAnimationTargetSet.java} | 12 +- .../util/RemoteFadeOutAnimationListener.java | 8 +- .../quickstep/views/ShelfScrimView.java | 2 +- .../quickstep/AppPredictionsUITests.java | 4 +- .../quickstep/FallbackRecentsTest.java | 71 +-- .../quickstep/NavigationModeSwitchRule.java | 2 +- .../StartLauncherViaGestureTests.java | 5 + .../android/quickstep/TaplTestsQuickstep.java | 58 +- .../quickstep/ViewInflationDuringSwipeUp.java | 280 ---------- res/anim/slide_in_right.xml | 9 - .../launcher3/config/FlagOverrideRule.java | 93 ++-- .../config/FlagOverrideSampleTest.java | 10 +- .../launcher3/logging/FileLogTest.java | 31 +- .../model/BaseModelUpdateTaskTestCase.java | 13 +- .../model/CacheDataUpdatedTaskTest.java | 4 + .../model/DbDowngradeHelperTest.java | 4 +- .../PackageInstallStateChangedTaskTest.java | 5 +- .../launcher3/util/TestLauncherProvider.java | 2 +- .../launcher3/AbstractFloatingView.java | 4 +- .../launcher3/BaseDraggingActivity.java | 4 +- src/com/android/launcher3/BubbleTextView.java | 34 +- src/com/android/launcher3/DeviceProfile.java | 10 +- src/com/android/launcher3/Hotseat.java | 3 +- .../launcher3/InstallShortcutReceiver.java | 17 +- src/com/android/launcher3/Launcher.java | 28 +- .../android/launcher3/LauncherAppState.java | 65 ++- src/com/android/launcher3/LauncherModel.java | 118 ++-- .../android/launcher3/LauncherProvider.java | 54 +- .../LauncherProviderChangeListener.java | 11 + .../android/launcher3/LauncherRootView.java | 10 +- .../launcher3/LauncherStateManager.java | 15 + src/com/android/launcher3/PagedView.java | 22 +- src/com/android/launcher3/PromiseAppInfo.java | 8 +- .../launcher3/SecondaryDropTarget.java | 10 +- .../launcher3/SessionCommitReceiver.java | 17 +- src/com/android/launcher3/Utilities.java | 8 +- .../launcher3/WidgetPreviewLoader.java | 4 +- src/com/android/launcher3/Workspace.java | 12 +- .../android/launcher3/WorkspaceItemInfo.java | 2 +- .../allapps/AllAppsContainerView.java | 30 +- .../launcher3/allapps/DiscoveryBounce.java | 4 +- .../compat/AccessibilityManagerCompat.java | 23 +- .../launcher3/compat/LauncherAppsCompat.java | 93 ++++ .../compat/LauncherAppsCompatVL.java | 216 ++++++++ .../LauncherAppsCompatVO.java} | 70 ++- .../compat/LauncherAppsCompatVQ.java | 29 +- .../compat/PackageInstallerCompat.java | 118 ++++ .../compat/PackageInstallerCompatVL.java | 287 ++++++++++ .../ShortcutConfigActivityInfo.java | 67 +-- .../launcher3/config/FeatureFlags.java | 11 +- .../launcher3/dragndrop/AddItemActivity.java | 7 +- .../dragndrop/BaseItemDragListener.java | 9 +- .../launcher3/dragndrop/DragLayer.java | 3 +- .../PinShortcutRequestActivityInfo.java | 10 +- .../android/launcher3/folder/FolderIcon.java | 2 +- .../graphics/DragPreviewProvider.java | 7 - .../launcher3/graphics/DrawableFactory.java | 7 +- .../launcher3/icons/ComponentWithLabel.java | 9 +- .../android/launcher3/icons/IconCache.java | 28 +- .../launcher3/icons/LauncherIcons.java | 10 +- .../launcher3/icons/ShortcutCachingLogic.java | 67 +++ .../android/launcher3/logging/FileLog.java | 10 +- .../model/AddWorkspaceItemsTask.java | 8 +- .../android/launcher3/model/AllAppsList.java | 35 +- .../model/GridSizeMigrationTask.java | 10 +- .../android/launcher3/model/LoaderCursor.java | 8 +- .../android/launcher3/model/LoaderTask.java | 52 +- .../model/PackageInstallStateChangedTask.java | 10 +- .../launcher3/model/PackageUpdatedTask.java | 13 +- .../model/SdCardAvailableReceiver.java | 6 +- .../android/launcher3/model/WidgetItem.java | 2 +- .../notification/NotificationItemView.java | 4 +- .../launcher3/pm/InstallSessionTracker.java | 129 ----- .../launcher3/pm/PackageInstallInfo.java | 60 -- .../launcher3/pm/PackageInstallerCompat.java | 219 -------- .../popup/PopupContainerWithArrow.java | 8 - .../states/InternalStateHandler.java | 145 +++++ .../launcher3/states/RotationHelper.java | 5 +- .../testing/TestInformationHandler.java | 70 +-- .../launcher3/testing/TestProtocol.java | 10 +- .../launcher3/touch/ItemClickHandler.java | 4 +- .../touch/ItemLongClickListener.java | 13 - .../launcher3/touch/SwipeDetector.java | 279 +++++----- .../launcher3/util/ActivityTracker.java | 143 ----- .../launcher3/util/PackageManagerHelper.java | 54 +- .../util/SimpleBroadcastReceiver.java | 48 -- .../launcher3/util/UiThreadHelper.java | 13 +- .../launcher3/views/FloatingIconView.java | 13 +- .../android/launcher3/views/ScrimView.java | 1 - .../widget/PendingAddShortcutInfo.java | 2 +- .../android/launcher3/widget/WidgetCell.java | 12 +- .../widget/custom/CustomWidgetManager.java | 45 +- .../systemui/plugins/CustomWidgetPlugin.java | 17 + .../plugins/OverviewScreenshotActions.java | 41 -- .../systemui/plugins/RecentsExtraCard.java | 42 -- .../android/launcher3/model/WidgetsModel.java | 13 +- .../launcher3/uioverrides/UiFactory.java | 3 +- tests/AndroidManifest-common.xml | 12 +- tests/res/layout/test_layout_widget_list.xml | 20 - .../launcher3/compat/PromiseIconUiTest.java | 1 - .../launcher3/model/LoaderCursorTest.java | 55 +- .../launcher3/provider/RestoreDbTaskTest.java | 7 +- .../CustomShortcutConfigActivity.java | 66 --- .../testcomponent/ListViewService.java | 95 ---- .../testcomponent/TestCommandProvider.java | 131 ----- .../testcomponent/TestCommandReceiver.java | 105 +++- .../launcher3/touch/SwipeDetectorTest.java | 8 +- .../launcher3/ui/AbstractLauncherUiTest.java | 58 +- .../ui/DefaultLayoutProviderTest.java | 7 +- .../launcher3/ui/TaplTestsLauncher3.java | 16 - .../ui/widget/AddConfigWidgetTest.java | 6 +- .../launcher3/ui/widget/AddWidgetTest.java | 5 +- .../launcher3/ui/widget/BindWidgetTest.java | 71 ++- .../util/rule/TestStabilityRule.java | 122 ++-- .../com/android/launcher3/tapl/AllApps.java | 55 +- .../android/launcher3/tapl/Background.java | 48 +- .../android/launcher3/tapl/BaseOverview.java | 4 +- .../tapl/com/android/launcher3/tapl/Home.java | 6 - .../tapl/LauncherInstrumentation.java | 131 ++--- .../android/launcher3/tapl/TestHelpers.java | 20 +- .../com/android/launcher3/tapl/Widgets.java | 40 +- .../com/android/launcher3/tapl/Workspace.java | 12 +- 201 files changed, 4009 insertions(+), 5716 deletions(-) rename go/quickstep/src/com/android/quickstep/{FallbackActivityInterface.java => FallbackActivityControllerHelper.java} (85%) rename go/quickstep/src/com/android/quickstep/{GoActivityInterface.java => GoActivityControlHelper.java} (93%) rename go/quickstep/src/com/android/quickstep/{LauncherActivityInterface.java => LauncherActivityControllerHelper.java} (92%) rename quickstep/recents_ui_overrides/src/com/android/quickstep/{FallbackActivityInterface.java => FallbackActivityControllerHelper.java} (93%) rename quickstep/recents_ui_overrides/src/com/android/quickstep/{LauncherActivityInterface.java => LauncherActivityControllerHelper.java} (91%) rename quickstep/{src/com/android/quickstep/RecentsAnimationController.java => recents_ui_overrides/src/com/android/quickstep/RecentsAnimationWrapper.java} (58%) delete mode 100644 quickstep/recents_ui_overrides/src/com/android/quickstep/ViewUtils.java rename quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/{AssistantInputConsumer.java => AssistantTouchConsumer.java} (78%) rename quickstep/{src/com/android/quickstep => recents_ui_overrides/src/com/android/quickstep/inputconsumers}/InputConsumer.java (95%) delete mode 100644 quickstep/recents_ui_overrides/src/com/android/quickstep/inputconsumers/QuickCaptureInputConsumer.java rename quickstep/recents_ui_overrides/src/com/android/quickstep/util/{AppWindowAnimationHelper.java => ClipAnimationHelper.java} (88%) rename {src/com/android/launcher3 => quickstep/recents_ui_overrides/src/com/android/quickstep}/util/ObjectWrapper.java (96%) rename quickstep/{src/com/android/quickstep/RecentsAnimationCallbacks.java => recents_ui_overrides/src/com/android/quickstep/util/RecentsAnimationListenerSet.java} (50%) create mode 100644 quickstep/recents_ui_overrides/src/com/android/quickstep/util/SwipeAnimationTargetSet.java delete mode 100644 quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsExtraViewContainer.java rename quickstep/src/com/android/quickstep/{BaseActivityInterface.java => ActivityControlHelper.java} (87%) delete mode 100644 quickstep/src/com/android/quickstep/GestureState.java create mode 100644 quickstep/src/com/android/quickstep/OverviewInteractionState.java create mode 100644 quickstep/src/com/android/quickstep/RecentsActivityTracker.java delete mode 100644 quickstep/src/com/android/quickstep/RecentsAnimationDeviceState.java delete mode 100644 quickstep/src/com/android/quickstep/RecentsAnimationTargets.java delete mode 100644 quickstep/src/com/android/quickstep/SystemUiProxy.java delete mode 100644 quickstep/src/com/android/quickstep/util/ActivityInitListener.java rename quickstep/src/com/android/quickstep/{RemoteAnimationTargets.java => util/RemoteAnimationTargetSet.java} (87%) delete mode 100644 quickstep/tests/src/com/android/quickstep/ViewInflationDuringSwipeUp.java delete mode 100644 res/anim/slide_in_right.xml create mode 100644 src/com/android/launcher3/LauncherProviderChangeListener.java create mode 100644 src/com/android/launcher3/compat/LauncherAppsCompat.java create mode 100644 src/com/android/launcher3/compat/LauncherAppsCompatVL.java rename src/com/android/launcher3/{pm/PinRequestHelper.java => compat/LauncherAppsCompatVO.java} (59%) rename quickstep/recents_ui_overrides/src/com/android/quickstep/util/ActiveGestureLog.java => src/com/android/launcher3/compat/LauncherAppsCompatVQ.java (51%) create mode 100644 src/com/android/launcher3/compat/PackageInstallerCompat.java create mode 100644 src/com/android/launcher3/compat/PackageInstallerCompatVL.java rename src/com/android/launcher3/{pm => compat}/ShortcutConfigActivityInfo.java (66%) create mode 100644 src/com/android/launcher3/icons/ShortcutCachingLogic.java delete mode 100644 src/com/android/launcher3/pm/InstallSessionTracker.java delete mode 100644 src/com/android/launcher3/pm/PackageInstallInfo.java delete mode 100644 src/com/android/launcher3/pm/PackageInstallerCompat.java create mode 100644 src/com/android/launcher3/states/InternalStateHandler.java delete mode 100644 src/com/android/launcher3/util/ActivityTracker.java delete mode 100644 src/com/android/launcher3/util/SimpleBroadcastReceiver.java delete mode 100644 src_plugins/com/android/systemui/plugins/OverviewScreenshotActions.java delete mode 100644 src_plugins/com/android/systemui/plugins/RecentsExtraCard.java delete mode 100644 tests/res/layout/test_layout_widget_list.xml delete mode 100644 tests/src/com/android/launcher3/testcomponent/CustomShortcutConfigActivity.java delete mode 100644 tests/src/com/android/launcher3/testcomponent/ListViewService.java delete mode 100644 tests/src/com/android/launcher3/testcomponent/TestCommandProvider.java diff --git a/Android.mk b/Android.mk index 3d1d996dfd..985612fbfb 100644 --- a/Android.mk +++ b/Android.mk @@ -145,7 +145,7 @@ LOCAL_USE_AAPT2 := true LOCAL_AAPT2_ONLY := true LOCAL_MODULE_TAGS := optional -LOCAL_STATIC_JAVA_LIBRARIES := SystemUISharedLibLauncherWrapper launcherprotosnano +LOCAL_STATIC_JAVA_LIBRARIES := SystemUISharedLib launcherprotosnano ifneq (,$(wildcard frameworks/base)) LOCAL_PRIVATE_PLATFORM_APIS := true else @@ -216,7 +216,7 @@ include $(CLEAR_VARS) LOCAL_USE_AAPT2 := true LOCAL_MODULE_TAGS := optional -LOCAL_STATIC_JAVA_LIBRARIES := SystemUISharedLibLauncherWrapper launcherprotosnano +LOCAL_STATIC_JAVA_LIBRARIES := SystemUISharedLib launcherprotosnano ifneq (,$(wildcard frameworks/base)) LOCAL_PRIVATE_PLATFORM_APIS := true else @@ -262,7 +262,7 @@ include $(CLEAR_VARS) LOCAL_USE_AAPT2 := true LOCAL_MODULE_TAGS := optional -LOCAL_STATIC_JAVA_LIBRARIES := SystemUISharedLibLauncherWrapper launcherprotosnano +LOCAL_STATIC_JAVA_LIBRARIES := SystemUISharedLib launcherprotosnano ifneq (,$(wildcard frameworks/base)) LOCAL_PRIVATE_PLATFORM_APIS := true else diff --git a/go/quickstep/src/com/android/launcher3/GoLauncherAppTransitionManagerImpl.java b/go/quickstep/src/com/android/launcher3/GoLauncherAppTransitionManagerImpl.java index 3953fd0279..bcb1f5c3b4 100644 --- a/go/quickstep/src/com/android/launcher3/GoLauncherAppTransitionManagerImpl.java +++ b/go/quickstep/src/com/android/launcher3/GoLauncherAppTransitionManagerImpl.java @@ -40,9 +40,7 @@ public final class GoLauncherAppTransitionManagerImpl extends QuickstepAppTransi @Override protected void composeRecentsLaunchAnimator(AnimatorSet anim, View v, - RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, - boolean launcherClosing) { + RemoteAnimationTargetCompat[] targets, boolean launcherClosing) { // Stubbed. Recents launch animation will come from the recents view itself and will not // use remote animations. } @@ -76,23 +74,21 @@ public final class GoLauncherAppTransitionManagerImpl extends QuickstepAppTransi } @Override - public void onCreateAnimation(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, + public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, AnimationResult result) { boolean isGoingToRecents = - taskIsATargetWithMode(appTargets, mLauncher.getTaskId(), MODE_OPENING) + taskIsATargetWithMode(targetCompats, mLauncher.getTaskId(), MODE_OPENING) && (mLauncher.getStateManager().getState() == LauncherState.OVERVIEW); if (isGoingToRecents) { IconRecentsView recentsView = mLauncher.getOverviewPanel(); if (!recentsView.isReadyForRemoteAnim()) { recentsView.setOnReadyForRemoteAnimCallback(() -> - postAsyncCallback(mHandler, () -> onCreateAnimation(appTargets, - wallpaperTargets, result)) + postAsyncCallback(mHandler, () -> onCreateAnimation(targetCompats, result)) ); return; } } - super.onCreateAnimation(appTargets, wallpaperTargets, result); + super.onCreateAnimation(targetCompats, result); } } } diff --git a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java index f2aa842d12..ae8fd82241 100644 --- a/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java +++ b/go/quickstep/src/com/android/launcher3/uioverrides/RecentsUiFactory.java @@ -89,5 +89,5 @@ public abstract class RecentsUiFactory { return RotationMode.NORMAL; } - public static void clearSwipeSharedState(Launcher launcher, boolean finishAnimation) { } + public static void clearSwipeSharedState(boolean finishAnimation) {} } diff --git a/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java index 6b50088221..92900f2168 100644 --- a/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java +++ b/go/quickstep/src/com/android/quickstep/AppToOverviewAnimationProvider.java @@ -32,6 +32,7 @@ import android.util.Log; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.LauncherAnimationRunner; import com.android.quickstep.util.RemoteAnimationProvider; +import com.android.quickstep.util.RemoteAnimationTargetSet; import com.android.quickstep.views.IconRecentsView; import com.android.systemui.shared.system.ActivityOptionsCompat; import com.android.systemui.shared.system.RemoteAnimationAdapterCompat; @@ -46,12 +47,12 @@ final class AppToOverviewAnimationProvider imple RemoteAnimationProvider { private static final String TAG = "AppToOverviewAnimationProvider"; - private final BaseActivityInterface mHelper; + private final ActivityControlHelper mHelper; private final int mTargetTaskId; private IconRecentsView mRecentsView; private AppToOverviewAnimationListener mAnimationReadyListener; - AppToOverviewAnimationProvider(BaseActivityInterface helper, int targetTaskId) { + AppToOverviewAnimationProvider(ActivityControlHelper helper, int targetTaskId) { mHelper = helper; mTargetTaskId = targetTaskId; } @@ -75,7 +76,7 @@ final class AppToOverviewAnimationProvider imple if (mAnimationReadyListener != null) { mAnimationReadyListener.onActivityReady(activity); } - BaseActivityInterface.AnimationFactory factory = + ActivityControlHelper.AnimationFactory factory = mHelper.prepareRecentsUI(activity, wasVisible, false /* animate activity */, (controller) -> { controller.dispatchOnStart(); @@ -85,7 +86,7 @@ final class AppToOverviewAnimationProvider imple anim.start(); }); factory.onRemoteAnimationReceived(null); - factory.createActivityInterface(getRecentsLaunchDuration()); + factory.createActivityController(getRecentsLaunchDuration()); mRecentsView = activity.getOverviewPanel(); return false; } @@ -94,12 +95,11 @@ final class AppToOverviewAnimationProvider imple * Create remote window animation from the currently running app to the overview panel. Should * be called after {@link #onActivityReady}. * - * @param appTargets the target apps + * @param targetCompats the target apps * @return animation from app to overview */ @Override - public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets) { + public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] targetCompats) { if (mAnimationReadyListener != null) { mAnimationReadyListener.onWindowAnimationCreated(); } @@ -112,14 +112,14 @@ final class AppToOverviewAnimationProvider imple return anim; } - RemoteAnimationTargets targets = - new RemoteAnimationTargets(appTargets, wallpaperTargets, MODE_CLOSING); - mRecentsView.setTransitionedFromApp(!targets.isAnimatingHome()); + RemoteAnimationTargetSet targetSet = + new RemoteAnimationTargetSet(targetCompats, MODE_CLOSING); + mRecentsView.setTransitionedFromApp(!targetSet.isAnimatingHome()); RemoteAnimationTargetCompat recentsTarget = null; RemoteAnimationTargetCompat closingAppTarget = null; - for (RemoteAnimationTargetCompat target : appTargets) { + for (RemoteAnimationTargetCompat target : targetCompats) { if (target.mode == MODE_OPENING) { recentsTarget = target; } else if (target.mode == MODE_CLOSING && target.taskId == mTargetTaskId) { @@ -157,17 +157,16 @@ final class AppToOverviewAnimationProvider imple false /* startAtFrontOfQueue */) { @Override - public void onCreateAnimation(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets, + public void onCreateAnimation(RemoteAnimationTargetCompat[] targetCompats, AnimationResult result) { IconRecentsView recentsView = mRecentsView; if (!recentsView.isReadyForRemoteAnim()) { recentsView.setOnReadyForRemoteAnimCallback(() -> postAsyncCallback(handler, - () -> onCreateAnimation(appTargets, wallpaperTargets, result)) + () -> onCreateAnimation(targetCompats, result)) ); return; } - result.setAnimation(createWindowAnimation(appTargets, wallpaperTargets), context); + result.setAnimation(createWindowAnimation(targetCompats), context); } }; return ActivityOptionsCompat.makeRemoteAnimation( diff --git a/go/quickstep/src/com/android/quickstep/FallbackActivityInterface.java b/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java similarity index 85% rename from go/quickstep/src/com/android/quickstep/FallbackActivityInterface.java rename to go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java index 2af8441853..057b48bb2b 100644 --- a/go/quickstep/src/com/android/quickstep/FallbackActivityInterface.java +++ b/go/quickstep/src/com/android/quickstep/FallbackActivityControllerHelper.java @@ -26,21 +26,21 @@ import androidx.annotation.Nullable; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.userevent.nano.LauncherLogProto; -import com.android.quickstep.util.ActivityInitListener; +import com.android.quickstep.util.RemoteAnimationTargetSet; import com.android.quickstep.views.IconRecentsView; import java.util.function.BiPredicate; import java.util.function.Consumer; /** - * {@link BaseActivityInterface} for recents when the default launcher is different than the + * {@link ActivityControlHelper} for recents when the default launcher is different than the * currently running one and apps should interact with the {@link RecentsActivity} as opposed * to the in-launcher one. */ -public final class FallbackActivityInterface extends - GoActivityInterface { +public final class FallbackActivityControllerHelper extends + GoActivityControlHelper { - public FallbackActivityInterface() { } + public FallbackActivityControllerHelper() { } @Override public AnimationFactory prepareRecentsUI(RecentsActivity activity, boolean activityVisible, @@ -58,17 +58,17 @@ public final class FallbackActivityInterface extends boolean isAnimatingToRecents = false; @Override - public void onRemoteAnimationReceived(RemoteAnimationTargets targets) { + public void onRemoteAnimationReceived(RemoteAnimationTargetSet targets) { isAnimatingToRecents = targets != null && targets.isAnimatingHome(); if (!isAnimatingToRecents) { rv.setAlpha(1); } - createActivityInterface(getSwipeUpDestinationAndLength( + createActivityController(getSwipeUpDestinationAndLength( activity.getDeviceProfile(), activity, new Rect())); } @Override - public void createActivityInterface(long transitionLength) { + public void createActivityController(long transitionLength) { if (!isAnimatingToRecents) { return; } @@ -85,13 +85,13 @@ public final class FallbackActivityInterface extends @Override public ActivityInitListener createActivityInitListener( BiPredicate onInitListener) { - return new ActivityInitListener(onInitListener, RecentsActivity.ACTIVITY_TRACKER); + return new RecentsActivityTracker(onInitListener); } @Nullable @Override public RecentsActivity getCreatedActivity() { - return RecentsActivity.ACTIVITY_TRACKER.getCreatedActivity(); + return RecentsActivityTracker.getCurrentActivity(); } @Nullable diff --git a/go/quickstep/src/com/android/quickstep/GoActivityInterface.java b/go/quickstep/src/com/android/quickstep/GoActivityControlHelper.java similarity index 93% rename from go/quickstep/src/com/android/quickstep/GoActivityInterface.java rename to go/quickstep/src/com/android/quickstep/GoActivityControlHelper.java index 5ce0f4cdf5..274a347cbb 100644 --- a/go/quickstep/src/com/android/quickstep/GoActivityInterface.java +++ b/go/quickstep/src/com/android/quickstep/GoActivityControlHelper.java @@ -13,8 +13,8 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat; * * @param activity that contains the overview */ -public abstract class GoActivityInterface implements - BaseActivityInterface { +public abstract class GoActivityControlHelper implements + ActivityControlHelper { @Override public void onTransitionCancelled(T activity, boolean activityVisible) { diff --git a/go/quickstep/src/com/android/quickstep/LauncherActivityInterface.java b/go/quickstep/src/com/android/quickstep/LauncherActivityControllerHelper.java similarity index 92% rename from go/quickstep/src/com/android/quickstep/LauncherActivityInterface.java rename to go/quickstep/src/com/android/quickstep/LauncherActivityControllerHelper.java index 5bff8e8060..b0d9cda6bc 100644 --- a/go/quickstep/src/com/android/quickstep/LauncherActivityInterface.java +++ b/go/quickstep/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -30,10 +30,10 @@ import java.util.function.BiPredicate; import java.util.function.Consumer; /** - * {@link BaseActivityInterface} for the in-launcher recents. + * {@link ActivityControlHelper} for the in-launcher recents. * TODO: Implement the app to overview animation functionality */ -public final class LauncherActivityInterface extends GoActivityInterface { +public final class LauncherActivityControllerHelper extends GoActivityControlHelper { @Override public AnimationFactory prepareRecentsUI(Launcher activity, @@ -43,7 +43,8 @@ public final class LauncherActivityInterface extends GoActivityInterfacegetOverviewPanel().setUsingRemoteAnimation(true); //TODO: Implement this based off where the recents view needs to be for app => recents anim. return new AnimationFactory() { - public void createActivityInterface(long transitionLength) { + @Override + public void createActivityController(long transitionLength) { callback.accept(activity.getStateManager().createAnimationToNewWorkspace( fromState, OVERVIEW, transitionLength)); } @@ -54,7 +55,7 @@ public final class LauncherActivityInterface extends GoActivityInterface onInitListener) { return new LauncherInitListener(onInitListener); } diff --git a/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java b/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java index a436ce7033..216972cba2 100644 --- a/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java +++ b/go/quickstep/src/com/android/quickstep/OverviewCommandHelper.java @@ -27,8 +27,8 @@ import android.view.ViewConfiguration; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.logging.UserEventDispatcher; import com.android.launcher3.userevent.nano.LauncherLogProto; +import com.android.quickstep.ActivityControlHelper.ActivityInitListener; import com.android.quickstep.AppToOverviewAnimationProvider.AppToOverviewAnimationListener; -import com.android.quickstep.util.ActivityInitListener; import com.android.quickstep.views.IconRecentsView; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.LatencyTrackerCompat; @@ -40,28 +40,26 @@ import com.android.systemui.shared.system.LatencyTrackerCompat; public class OverviewCommandHelper { private final Context mContext; - private final RecentsAnimationDeviceState mDeviceState; + private final ActivityManagerWrapper mAM; private final RecentsModel mRecentsModel; private final OverviewComponentObserver mOverviewComponentObserver; private long mLastToggleTime; - public OverviewCommandHelper(Context context, RecentsAnimationDeviceState deviceState, - OverviewComponentObserver observer) { + public OverviewCommandHelper(Context context, OverviewComponentObserver observer) { mContext = context; - mDeviceState = deviceState; + mAM = ActivityManagerWrapper.getInstance(); mRecentsModel = RecentsModel.INSTANCE.get(mContext); mOverviewComponentObserver = observer; } public void onOverviewToggle() { // If currently screen pinning, do not enter overview - if (mDeviceState.isScreenPinningActive()) { + if (mAM.isScreenPinningActive()) { return; } - ActivityManagerWrapper.getInstance() - .closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); + mAM.closeSystemWindows(CLOSE_SYSTEM_WINDOWS_REASON_RECENTS); MAIN_EXECUTOR.execute(new RecentsActivityCommand<>()); } @@ -101,15 +99,15 @@ public class OverviewCommandHelper { private class RecentsActivityCommand implements Runnable { - protected final BaseActivityInterface mHelper; + protected final ActivityControlHelper mHelper; private final long mCreateTime; private final long mToggleClickedTime = SystemClock.uptimeMillis(); private boolean mUserEventLogged; - private ActivityInitListener mListener; + private ActivityInitListener mListener; public RecentsActivityCommand() { - mHelper = mOverviewComponentObserver.getActivityInterface(); + mHelper = mOverviewComponentObserver.getActivityControlHelper(); mCreateTime = SystemClock.elapsedRealtime(); // Preload the plan diff --git a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java index f743663326..19dd82f7f7 100644 --- a/go/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/go/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -34,9 +34,6 @@ import android.view.MotionEvent; import com.android.launcher3.Utilities; import com.android.launcher3.compat.UserManagerCompat; -import com.android.launcher3.util.DefaultDisplay; -import com.android.quickstep.RecentsAnimationDeviceState; -import com.android.quickstep.SystemUiProxy; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; @@ -47,6 +44,15 @@ import com.android.systemui.shared.recents.ISystemUiProxy; public class TouchInteractionService extends Service { private static final String TAG = "GoTouchInteractionService"; + private boolean mIsUserUnlocked; + private BroadcastReceiver mUserUnlockedReceiver = new BroadcastReceiver() { + @Override + public void onReceive(Context context, Intent intent) { + if (Intent.ACTION_USER_UNLOCKED.equals(intent.getAction())) { + initWhenUserUnlocked(); + } + } + }; private final IBinder mMyBinder = new IOverviewProxy.Stub() { @@ -57,26 +63,26 @@ public class TouchInteractionService extends Service { public void onInitialize(Bundle bundle) throws RemoteException { ISystemUiProxy iSystemUiProxy = ISystemUiProxy.Stub .asInterface(bundle.getBinder(KEY_EXTRA_SYSUI_PROXY)); - SystemUiProxy.INSTANCE.get(TouchInteractionService.this).setProxy(iSystemUiProxy); + mRecentsModel.setSystemUiProxy(iSystemUiProxy); } @Override public void onOverviewToggle() { - if (mDeviceState.isUserUnlocked()) { + if (mIsUserUnlocked) { mOverviewCommandHelper.onOverviewToggle(); } } @Override public void onOverviewShown(boolean triggeredFromAltTab) { - if (mDeviceState.isUserUnlocked()) { + if (mIsUserUnlocked) { mOverviewCommandHelper.onOverviewShown(triggeredFromAltTab); } } @Override public void onOverviewHidden(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { - if (mDeviceState.isUserUnlocked() && triggeredFromAltTab && !triggeredFromHomeKey) { + if (mIsUserUnlocked && triggeredFromAltTab && !triggeredFromHomeKey) { // onOverviewShownFromAltTab hides the overview and ends at the target app mOverviewCommandHelper.onOverviewHidden(); } @@ -84,7 +90,7 @@ public class TouchInteractionService extends Service { @Override public void onTip(int actionType, int viewType) { - if (mDeviceState.isUserUnlocked()) { + if (mIsUserUnlocked) { mOverviewCommandHelper.onTip(actionType, viewType); } } @@ -121,7 +127,7 @@ public class TouchInteractionService extends Service { public void onMotionEvent(MotionEvent ev) { } public void onBind(ISystemUiProxy iSystemUiProxy) { - SystemUiProxy.INSTANCE.get(TouchInteractionService.this).setProxy(iSystemUiProxy); + mRecentsModel.setSystemUiProxy(iSystemUiProxy); } }; @@ -134,30 +140,35 @@ public class TouchInteractionService extends Service { private RecentsModel mRecentsModel; private OverviewComponentObserver mOverviewComponentObserver; private OverviewCommandHelper mOverviewCommandHelper; - private RecentsAnimationDeviceState mDeviceState; @Override public void onCreate() { super.onCreate(); - mDeviceState = new RecentsAnimationDeviceState(this); - mDeviceState.runOnUserUnlocked(this::onUserUnlocked); + if (UserManagerCompat.getInstance(this).isUserUnlocked(Process.myUserHandle())) { + initWhenUserUnlocked(); + } else { + mIsUserUnlocked = false; + registerReceiver(mUserUnlockedReceiver, new IntentFilter(Intent.ACTION_USER_UNLOCKED)); + } sConnected = true; } - public void onUserUnlocked() { + private void initWhenUserUnlocked() { mRecentsModel = RecentsModel.INSTANCE.get(this); - mOverviewComponentObserver = new OverviewComponentObserver(this, mDeviceState); - mOverviewCommandHelper = new OverviewCommandHelper(this, mDeviceState, + mOverviewComponentObserver = new OverviewComponentObserver(this); + mOverviewCommandHelper = new OverviewCommandHelper(this, mOverviewComponentObserver); + mIsUserUnlocked = true; + Utilities.unregisterReceiverSafely(this, mUserUnlockedReceiver); } @Override public void onDestroy() { - if (mDeviceState.isUserUnlocked()) { + if (mIsUserUnlocked) { mOverviewComponentObserver.onDestroy(); } - mDeviceState.destroy(); + Utilities.unregisterReceiverSafely(this, mUserUnlockedReceiver); sConnected = false; super.onDestroy(); } diff --git a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java index 5c4f37ca98..e1b71a0b5f 100644 --- a/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java +++ b/iconloaderlib/src/com/android/launcher3/icons/BaseIconFactory.java @@ -22,7 +22,6 @@ import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Process; import android.os.UserHandle; - import androidx.annotation.NonNull; /** @@ -36,8 +35,6 @@ public class BaseIconFactory implements AutoCloseable { static final boolean ATLEAST_OREO = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O; static final boolean ATLEAST_P = Build.VERSION.SDK_INT >= Build.VERSION_CODES.P; - private static final float ICON_BADGE_SCALE = 0.444f; - private final Rect mOldBounds = new Rect(); protected final Context mContext; private final Canvas mCanvas; @@ -254,7 +251,7 @@ public class BaseIconFactory implements AutoCloseable { * Adds the {@param badge} on top of {@param target} using the badge dimensions. */ public void badgeWithDrawable(Canvas target, Drawable badge) { - int badgeSize = getBadgeSizeForIconSize(mIconBitmapSize); + int badgeSize = mContext.getResources().getDimensionPixelSize(R.dimen.profile_badge_size); badge.setBounds(mIconBitmapSize - badgeSize, mIconBitmapSize - badgeSize, mIconBitmapSize, mIconBitmapSize); badge.draw(target); @@ -334,13 +331,6 @@ public class BaseIconFactory implements AutoCloseable { iconDpi); } - /** - * Returns the correct badge size given an icon size - */ - public static int getBadgeSizeForIconSize(int iconSize) { - return (int) (ICON_BADGE_SCALE * iconSize); - } - /** * An extension of {@link BitmapDrawable} which returns the bitmap pixel size as intrinsic size. * This allows the badging to be done based on the action bitmap size rather than diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java index 93f0538bd5..c100f05963 100644 --- a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java +++ b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java @@ -273,7 +273,7 @@ public abstract class BaseIconCache { if (entry.icon == null) return; entry.title = cachingLogic.getLabel(object); entry.contentDescription = mPackageManager.getUserBadgedLabel(entry.title, user); - if (cachingLogic.addToMemCache()) mCache.put(key, entry); + mCache.put(key, entry); ContentValues values = newContentValues(entry, entry.title.toString(), componentName.getPackageName(), cachingLogic.getKeywords(object, mLocaleList)); @@ -312,12 +312,20 @@ public abstract class BaseIconCache { @NonNull ComponentName componentName, @NonNull UserHandle user, @NonNull Supplier infoProvider, @NonNull CachingLogic cachingLogic, boolean usePackageIcon, boolean useLowResIcon) { + return cacheLocked(componentName, user, infoProvider, cachingLogic, usePackageIcon, + useLowResIcon, true); + } + + protected CacheEntry cacheLocked( + @NonNull ComponentName componentName, @NonNull UserHandle user, + @NonNull Supplier infoProvider, @NonNull CachingLogic cachingLogic, + boolean usePackageIcon, boolean useLowResIcon, boolean addToMemCache) { assertWorkerThread(); ComponentKey cacheKey = new ComponentKey(componentName, user); CacheEntry entry = mCache.get(cacheKey); if (entry == null || (entry.isLowRes() && !useLowResIcon)) { entry = new CacheEntry(); - if (cachingLogic.addToMemCache()) { + if (addToMemCache) { mCache.put(cacheKey, entry); } @@ -374,7 +382,7 @@ public abstract class BaseIconCache { * Adds a default package entry in the cache. This entry is not persisted and will be removed * when the cache is flushed. */ - protected synchronized void cachePackageInstallInfo(String packageName, UserHandle user, + public synchronized void cachePackageInstallInfo(String packageName, UserHandle user, Bitmap icon, CharSequence title) { removeFromMemCacheLocked(packageName, user); diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java b/iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java index e40a9c2c96..16bc7ae834 100644 --- a/iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java +++ b/iconloaderlib/src/com/android/launcher3/icons/cache/CachingLogic.java @@ -17,6 +17,7 @@ package com.android.launcher3.icons.cache; import android.content.ComponentName; import android.content.Context; +import android.content.pm.PackageInfo; import android.os.LocaleList; import android.os.UserHandle; @@ -43,9 +44,9 @@ public interface CachingLogic { } /** - * Returns true the object should be added to mem cache; otherwise returns false. + * Returns the timestamp the entry was last updated in cache. */ - default boolean addToMemCache() { - return true; + default long getLastUpdatedTime(T object, PackageInfo info) { + return info.lastUpdateTime; } } diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java b/iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java index 8224966d87..bcdbce5e29 100644 --- a/iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java +++ b/iconloaderlib/src/com/android/launcher3/icons/cache/IconCacheUpdateHandler.java @@ -171,7 +171,8 @@ public class IconCacheUpdateHandler { long updateTime = c.getLong(indexLastUpdate); int version = c.getInt(indexVersion); T app = componentMap.remove(component); - if (version == info.versionCode && updateTime == info.lastUpdateTime + if (version == info.versionCode + && updateTime == cachingLogic.getLastUpdatedTime(app, info) && TextUtils.equals(c.getString(systemStateIndex), mIconCache.getIconSystemState(info.packageName))) { @@ -231,7 +232,6 @@ public class IconCacheUpdateHandler { } } - /** * A runnable that updates invalid icons and adds missing icons in the DB for the provided * LauncherActivityInfo list. Items are updated/added one at a time, so that the diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java index d84248419e..711594386f 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java @@ -30,17 +30,17 @@ import android.animation.ObjectAnimator; import android.content.Context; import android.view.View; -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.anim.SpringAnimationBuilder; -import com.android.quickstep.util.AppWindowAnimationHelper; +import com.android.quickstep.util.ClipAnimationHelper; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + /** * A {@link QuickstepAppTransitionManagerImpl} that also implements recents transitions from * {@link RecentsView}. @@ -64,16 +64,15 @@ public final class LauncherAppTransitionManagerImpl extends QuickstepAppTransiti @Override protected void composeRecentsLaunchAnimator(@NonNull AnimatorSet anim, @NonNull View v, - @NonNull RemoteAnimationTargetCompat[] appTargets, - @NonNull RemoteAnimationTargetCompat[] wallpaperTargets, boolean launcherClosing) { + @NonNull RemoteAnimationTargetCompat[] targets, boolean launcherClosing) { RecentsView recentsView = mLauncher.getOverviewPanel(); boolean skipLauncherChanges = !launcherClosing; - TaskView taskView = findTaskViewToLaunch(mLauncher, v, appTargets); + TaskView taskView = findTaskViewToLaunch(mLauncher, v, targets); - AppWindowAnimationHelper helper = new AppWindowAnimationHelper(mLauncher); - anim.play(getRecentsWindowAnimator(taskView, skipLauncherChanges, appTargets, - wallpaperTargets, helper).setDuration(RECENTS_LAUNCH_DURATION)); + ClipAnimationHelper helper = new ClipAnimationHelper(mLauncher); + anim.play(getRecentsWindowAnimator(taskView, skipLauncherChanges, targets, helper) + .setDuration(RECENTS_LAUNCH_DURATION)); Animator childStateAnimation = null; // Found a visible recents task that matches the opening app, lets launch the app from there diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherInitListenerEx.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherInitListenerEx.java index 76050d57bd..c5c4add6b2 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherInitListenerEx.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/LauncherInitListenerEx.java @@ -27,7 +27,7 @@ public class LauncherInitListenerEx extends LauncherInitListener { } @Override - public boolean init(Launcher launcher, boolean alreadyOnHome) { + protected boolean init(Launcher launcher, boolean alreadyOnHome) { PredictionUiStateManager.INSTANCE.get(launcher).switchClient(Client.OVERVIEW); return super.init(launcher, alreadyOnHome); } diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java index 4c04b29598..8597f98390 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/RecentsUiFactory.java @@ -18,7 +18,6 @@ package com.android.launcher3.uioverrides; import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.OVERVIEW; -import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TILE; import static com.android.quickstep.SysUINavigationMode.Mode.NO_BUTTON; import android.content.Context; @@ -49,8 +48,8 @@ import com.android.quickstep.RecentsModel; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.SysUINavigationMode.Mode; import com.android.quickstep.TouchInteractionService; -import com.android.quickstep.SystemUiProxy; import com.android.quickstep.views.RecentsView; +import com.android.systemui.shared.recents.ISystemUiProxy; import java.util.ArrayList; @@ -59,16 +58,21 @@ import java.util.ArrayList; */ public abstract class RecentsUiFactory { - private static final String TAG = RecentsUiFactory.class.getSimpleName(); - public static final boolean GO_LOW_RAM_RECENTS_ENABLED = false; - /** - * Reusable command for applying the shelf height on the background thread. - */ - public static final AsyncCommand SET_SHELF_HEIGHT = (context, arg1, arg2) -> { - SystemUiProxy.INSTANCE.get(context).setShelfHeight(arg1 != 0, arg2); - }; + private static final String TAG = RecentsUiFactory.class.getSimpleName(); + + private static AsyncCommand newSetShelfHeightCmd(Context context) { + return (visible, height) -> { + ISystemUiProxy sysUiProxy = RecentsModel.INSTANCE.get(context).getSystemUiProxy(); + if (sysUiProxy == null) return; + try { + sysUiProxy.setShelfHeight(visible != 0, height); + } catch (RemoteException e) { + Log.e(TAG, "Error setShelfHeight", e); + } + }; + } public static RotationMode ROTATION_LANDSCAPE = new RotationMode(-90) { @Override @@ -191,15 +195,11 @@ public abstract class RecentsUiFactory { return new RecentsViewStateController(launcher); } - /** Clears the swipe shared state for the current swipe gesture. */ - public static void clearSwipeSharedState(Launcher launcher, boolean finishAnimation) { - if (ENABLE_QUICKSTEP_LIVE_TILE.get()) { - launcher.getOverviewPanel().switchToScreenshot( - () -> TouchInteractionService.getSwipeSharedState().clearAllState( - finishAnimation)); - } else { - TouchInteractionService.getSwipeSharedState().clearAllState(finishAnimation); - } + /** + * Clears the swipe shared state for the current swipe gesture. + */ + public static void clearSwipeSharedState(boolean finishAnimation) { + TouchInteractionService.getSwipeSharedState().clearAllState(finishAnimation); } /** @@ -212,8 +212,9 @@ public abstract class RecentsUiFactory { DeviceProfile profile = launcher.getDeviceProfile(); boolean visible = (state == NORMAL || state == OVERVIEW) && launcher.isUserActive() && !profile.isVerticalBarLayout(); - UiThreadHelper.runAsyncCommand(launcher, SET_SHELF_HEIGHT, visible ? 1 : 0, - profile.hotseatBarSizePx); + UiThreadHelper.runAsyncCommand(launcher, newSetShelfHeightCmd(launcher), + visible ? 1 : 0, profile.hotseatBarSizePx); + if (state == NORMAL) { launcher.getOverviewPanel().setSwipeDownShouldLaunchApp(false); } diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java index e4e60a04b1..468b8afc97 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/states/BackgroundAppState.java @@ -78,7 +78,7 @@ public class BackgroundAppState extends OverviewState { } else { dummyTask = recentsView.getTaskViewAt(0); } - return recentsView.getTempAppWindowAnimationHelper().updateForFullscreenOverview(dummyTask) + return recentsView.getTempClipAnimationHelper().updateForFullscreenOverview(dummyTask) .getScaleAndTranslation(); } diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java index ee2e9519e5..4a3ad1d721 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/FlingAndHoldTouchController.java @@ -32,8 +32,8 @@ import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_FADE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_SCALE; import static com.android.launcher3.anim.AnimatorSetBuilder.ANIM_WORKSPACE_TRANSLATE; import static com.android.launcher3.anim.Interpolators.ACCEL; -import static com.android.launcher3.anim.Interpolators.DEACCEL; import static com.android.launcher3.anim.Interpolators.DEACCEL_3; +import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.OVERSHOOT_1_2; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_OVERVIEW_DISABLED; @@ -50,7 +50,7 @@ import com.android.launcher3.LauncherState; import com.android.launcher3.anim.AnimatorSetBuilder; import com.android.launcher3.anim.Interpolators; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch; -import com.android.quickstep.SystemUiProxy; +import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.util.MotionPauseDetector; import com.android.quickstep.views.RecentsView; @@ -120,7 +120,7 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { * having it as part of the existing animation to the target state. */ private boolean handlingOverviewAnim() { - int stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags(); + int stateFlags = OverviewInteractionState.INSTANCE.get(mLauncher).getSystemUiStateFlags(); return mStartState == NORMAL && (stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) == 0; } @@ -132,33 +132,16 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { // Fade in prediction icons quickly, then rest of all apps after reaching overview. float progressToReachOverview = NORMAL.getVerticalProgress(mLauncher) - OVERVIEW.getVerticalProgress(mLauncher); - builder.setInterpolator(ANIM_ALL_APPS_HEADER_FADE, Interpolators.clampToProgress( - ACCEL, - 0, - ALL_APPS_CONTENT_FADE_THRESHOLD)); - builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress( - ACCEL, - progressToReachOverview, - progressToReachOverview + ALL_APPS_CONTENT_FADE_THRESHOLD)); + builder.setInterpolator(ANIM_ALL_APPS_HEADER_FADE, Interpolators.clampToProgress(ACCEL, + 0, ALL_APPS_CONTENT_FADE_THRESHOLD)); + builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress(LINEAR, + progressToReachOverview, 1)); // Get workspace out of the way quickly, to prepare for potential pause. builder.setInterpolator(ANIM_WORKSPACE_SCALE, DEACCEL_3); builder.setInterpolator(ANIM_WORKSPACE_TRANSLATE, DEACCEL_3); builder.setInterpolator(ANIM_WORKSPACE_FADE, DEACCEL_3); return builder; - } else if (fromState == ALL_APPS && toState == NORMAL) { - AnimatorSetBuilder builder = new AnimatorSetBuilder(); - // Keep all apps/predictions opaque until the very end of the transition. - float progressToReachOverview = OVERVIEW.getVerticalProgress(mLauncher); - builder.setInterpolator(ANIM_ALL_APPS_FADE, Interpolators.clampToProgress( - DEACCEL, - progressToReachOverview - ALL_APPS_CONTENT_FADE_THRESHOLD, - progressToReachOverview)); - builder.setInterpolator(ANIM_ALL_APPS_HEADER_FADE, Interpolators.clampToProgress( - DEACCEL, - 1 - ALL_APPS_CONTENT_FADE_THRESHOLD, - 1)); - return builder; } return super.getAnimatorSetBuilderForStates(fromState, toState); } @@ -181,7 +164,6 @@ public class FlingAndHoldTouchController extends PortraitStatesTouchController { AnimatorSetBuilder builder = new AnimatorSetBuilder(); builder.setInterpolator(ANIM_VERTICAL_PROGRESS, OVERSHOOT_1_2); - builder.setInterpolator(ANIM_ALL_APPS_FADE, DEACCEL_3); if ((OVERVIEW.getVisibleElements(mLauncher) & HOTSEAT_ICONS) != 0) { builder.setInterpolator(ANIM_HOTSEAT_SCALE, OVERSHOOT_1_2); builder.setInterpolator(ANIM_HOTSEAT_TRANSLATE, OVERSHOOT_1_2); diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java index 5c3b55d6c4..6576ec5737 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/QuickSwitchTouchController.java @@ -45,9 +45,9 @@ import com.android.launcher3.touch.AbstractStateChangeTouchController; import com.android.launcher3.touch.SwipeDetector; import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction; +import com.android.quickstep.OverviewInteractionState; import com.android.quickstep.SysUINavigationMode; import com.android.quickstep.SysUINavigationMode.Mode; -import com.android.quickstep.SystemUiProxy; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; @@ -82,7 +82,7 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll @Override protected LauncherState getTargetState(LauncherState fromState, boolean isDragTowardPositive) { - int stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags(); + int stateFlags = OverviewInteractionState.INSTANCE.get(mLauncher).getSystemUiStateFlags(); if ((stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0) { return NORMAL; } diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java index 8a11ac80aa..ad90e1686e 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/AppToOverviewAnimationProvider.java @@ -30,8 +30,9 @@ import android.view.View; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; import com.android.launcher3.anim.AnimationSuccessListener; -import com.android.quickstep.util.AppWindowAnimationHelper; +import com.android.quickstep.util.ClipAnimationHelper; import com.android.quickstep.util.RemoteAnimationProvider; +import com.android.quickstep.util.RemoteAnimationTargetSet; import com.android.quickstep.views.RecentsView; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; @@ -48,14 +49,14 @@ final class AppToOverviewAnimationProvider imple private static final long RECENTS_LAUNCH_DURATION = 250; private static final String TAG = "AppToOverviewAnimationProvider"; - private final BaseActivityInterface mHelper; + private final ActivityControlHelper mHelper; // The id of the currently running task that is transitioning to overview. private final int mTargetTaskId; private T mActivity; private RecentsView mRecentsView; - AppToOverviewAnimationProvider(BaseActivityInterface helper, int targetTaskId) { + AppToOverviewAnimationProvider(ActivityControlHelper helper, int targetTaskId) { mHelper = helper; mTargetTaskId = targetTaskId; } @@ -69,7 +70,7 @@ final class AppToOverviewAnimationProvider imple boolean onActivityReady(T activity, Boolean wasVisible) { activity.getOverviewPanel().showCurrentTask(mTargetTaskId); AbstractFloatingView.closeAllOpenViews(activity, wasVisible); - BaseActivityInterface.AnimationFactory factory = + ActivityControlHelper.AnimationFactory factory = mHelper.prepareRecentsUI(activity, wasVisible, false /* animate activity */, (controller) -> { controller.dispatchOnStart(); @@ -79,7 +80,7 @@ final class AppToOverviewAnimationProvider imple anim.start(); }); factory.onRemoteAnimationReceived(null); - factory.createActivityInterface(RECENTS_LAUNCH_DURATION); + factory.createActivityController(RECENTS_LAUNCH_DURATION); factory.setRecentsAttachedToAppWindow(true, false); mActivity = activity; mRecentsView = mActivity.getOverviewPanel(); @@ -89,12 +90,11 @@ final class AppToOverviewAnimationProvider imple /** * Create remote window animation from the currently running app to the overview panel. * - * @param appTargets the target apps + * @param targetCompats the target apps * @return animation from app to overview */ @Override - public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] appTargets, - RemoteAnimationTargetCompat[] wallpaperTargets) { + public AnimatorSet createWindowAnimation(RemoteAnimationTargetCompat[] targetCompats) { if (mRecentsView != null) { mRecentsView.setRunningTaskIconScaledDown(true); } @@ -114,18 +114,18 @@ final class AppToOverviewAnimationProvider imple return anim; } - RemoteAnimationTargets targets = new RemoteAnimationTargets(appTargets, - wallpaperTargets, MODE_CLOSING); + RemoteAnimationTargetSet targetSet = + new RemoteAnimationTargetSet(targetCompats, MODE_CLOSING); // Use the top closing app to determine the insets for the animation - RemoteAnimationTargetCompat runningTaskTarget = targets.findTask(mTargetTaskId); + RemoteAnimationTargetCompat runningTaskTarget = targetSet.findTask(mTargetTaskId); if (runningTaskTarget == null) { Log.e(TAG, "No closing app"); anim.play(ValueAnimator.ofInt(0, 1).setDuration(RECENTS_LAUNCH_DURATION)); return anim; } - final AppWindowAnimationHelper clipHelper = new AppWindowAnimationHelper(mActivity); + final ClipAnimationHelper clipHelper = new ClipAnimationHelper(mActivity); // At this point, the activity is already started and laid-out. Get the home-bounds // relative to the screen using the rootView of the activity. @@ -141,22 +141,20 @@ final class AppToOverviewAnimationProvider imple clipHelper.updateTargetRect(targetRect); clipHelper.prepareAnimation(mActivity.getDeviceProfile(), false /* isOpening */); - AppWindowAnimationHelper.TransformParams params = new AppWindowAnimationHelper.TransformParams() + ClipAnimationHelper.TransformParams params = new ClipAnimationHelper.TransformParams() .setSyncTransactionApplier(new SyncRtSurfaceTransactionApplierCompat(rootView)); ValueAnimator valueAnimator = ValueAnimator.ofFloat(0, 1); valueAnimator.setDuration(RECENTS_LAUNCH_DURATION); valueAnimator.setInterpolator(TOUCH_RESPONSE_INTERPOLATOR); valueAnimator.addUpdateListener((v) -> { - params.setProgress((float) v.getAnimatedValue()) - .setTargetSet(targets) - .setLauncherOnTop(true); - clipHelper.applyTransform(params); + params.setProgress((float) v.getAnimatedValue()); + clipHelper.applyTransform(targetSet, params); }); - if (targets.isAnimatingHome()) { + if (targetSet.isAnimatingHome()) { // If we are animating home, fade in the opening targets - RemoteAnimationTargets openingSet = new RemoteAnimationTargets(appTargets, - wallpaperTargets, MODE_OPENING); + RemoteAnimationTargetSet openingSet = + new RemoteAnimationTargetSet(targetCompats, MODE_OPENING); TransactionCompat transaction = new TransactionCompat(); valueAnimator.addUpdateListener((v) -> { diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java index e1e994c6a6..7196f7c6f3 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/BaseSwipeUpHandler.java @@ -25,6 +25,7 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_QUICKSTEP_LIVE_TI import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.launcher3.views.FloatingIconView.SHAPE_PROGRESS_DURATION; +import static com.android.quickstep.TouchInteractionService.TOUCH_INTERACTION_LOG; import android.animation.Animator; import android.annotation.TargetApi; @@ -56,22 +57,22 @@ import com.android.launcher3.anim.AnimationSuccessListener; import com.android.launcher3.anim.AnimatorPlaybackController; import com.android.launcher3.graphics.RotationMode; import com.android.launcher3.views.FloatingIconView; -import com.android.quickstep.BaseActivityInterface.HomeAnimationFactory; +import com.android.quickstep.ActivityControlHelper.ActivityInitListener; +import com.android.quickstep.ActivityControlHelper.HomeAnimationFactory; import com.android.quickstep.SysUINavigationMode.Mode; -import com.android.quickstep.util.ActiveGestureLog; -import com.android.quickstep.util.ActivityInitListener; -import com.android.quickstep.util.AppWindowAnimationHelper; -import com.android.quickstep.util.AppWindowAnimationHelper.TransformParams; +import com.android.quickstep.inputconsumers.InputConsumer; +import com.android.quickstep.util.ClipAnimationHelper; +import com.android.quickstep.util.ClipAnimationHelper.TransformParams; import com.android.quickstep.util.RectFSpringAnim; -import com.android.quickstep.RecentsAnimationCallbacks.RecentsAnimationListener; +import com.android.quickstep.util.RemoteAnimationTargetSet; +import com.android.quickstep.util.SwipeAnimationTargetSet; +import com.android.quickstep.util.SwipeAnimationTargetSet.SwipeAnimationListener; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; -import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.InputConsumerController; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat; -import java.util.ArrayList; import java.util.function.Consumer; /** @@ -79,7 +80,7 @@ import java.util.function.Consumer; */ @TargetApi(Build.VERSION_CODES.Q) public abstract class BaseSwipeUpHandler - implements RecentsAnimationListener { + implements SwipeAnimationListener { private static final String TAG = "BaseSwipeUpHandler"; protected static final Rect TEMP_RECT = new Rect(); @@ -97,11 +98,11 @@ public abstract class BaseSwipeUpHandler mActivityInterface; + protected final ActivityControlHelper mActivityControlHelper; protected final RecentsModel mRecentsModel; protected final int mRunningTaskId; - protected final AppWindowAnimationHelper mAppWindowAnimationHelper; + protected final ClipAnimationHelper mClipAnimationHelper; protected final TransformParams mTransformParams = new TransformParams(); private final Vibrator mVibrator; @@ -114,13 +115,7 @@ public abstract class BaseSwipeUpHandler mRecentsAnimationStartCallbacks = new ArrayList<>(); + protected final RecentsAnimationWrapper mRecentsAnimationWrapper; protected T mActivity; protected Q mRecentsView; @@ -135,20 +130,21 @@ public abstract class BaseSwipeUpHandler { mTransformParams.setSyncTransactionApplier(applier); - runOnRecentsAnimationStart(() -> - mRecentsAnimationTargets.addDependentTransactionApplier(applier)); + mRecentsAnimationWrapper.runOnInit(() -> + mRecentsAnimationWrapper.targetSet.addDependentTransactionApplier(applier)); }); mRecentsView.setOnScrollChangeListener((v, scrollX, scrollY, oldScrollX, oldScrollY) -> { @@ -223,10 +219,8 @@ public abstract class BaseSwipeUpHandler - mRecentsView.setRecentsAnimationTargets(mRecentsAnimationController, - mRecentsAnimationTargets)); + mRecentsView.setRecentsAnimationWrapper(mRecentsAnimationWrapper); + mRecentsView.setClipAnimationHelper(mClipAnimationHelper); } protected void startNewTask(int successStateFlag, Consumer resultCallback) { @@ -238,7 +232,7 @@ public abstract class BaseSwipeUpHandler { + mRecentsAnimationWrapper.finish(true /* toRecents */, () -> { if (!mCanceled) { TaskView nextTask = mRecentsView.getTaskView(taskId); if (nextTask != null) { @@ -246,10 +240,10 @@ public abstract class BaseSwipeUpHandler { resultCallback.accept(success); if (!success) { - mActivityInterface.onLaunchTaskFailed(mActivity); + mActivityControlHelper.onLaunchTaskFailed(mActivity); nextTask.notifyTaskLaunchFailed(TAG); } else { - mActivityInterface.onLaunchTaskSuccess(mActivity); + mActivityControlHelper.onLaunchTaskSuccess(mActivity); } }, mMainThreadHandler); } @@ -259,40 +253,18 @@ public abstract class BaseSwipeUpHandler(mRecentsAnimationStartCallbacks)) { - action.run(); - } - mRecentsAnimationStartCallbacks.clear(); - } - } - - @Override - public void onRecentsAnimationCanceled(ThumbnailData thumbnailData) { - mRecentsAnimationController = null; - mRecentsAnimationTargets = null; - } - - @Override - public void onRecentsAnimationFinished(RecentsAnimationController controller) { - mRecentsAnimationController = null; - mRecentsAnimationTargets = null; + mRecentsAnimationWrapper.setController(targetSet); } private Rect getStackBounds(DeviceProfile dp) { @@ -345,16 +299,16 @@ public abstract class BaseSwipeUpHandler { +public final class FallbackActivityControllerHelper implements + ActivityControlHelper { - public FallbackActivityInterface() { } + public FallbackActivityControllerHelper() { } @Override public void onTransitionCancelled(RecentsActivity activity, boolean activityVisible) { @@ -137,17 +137,17 @@ public final class FallbackActivityInterface implements boolean isAnimatingToRecents = false; @Override - public void onRemoteAnimationReceived(RemoteAnimationTargets targets) { + public void onRemoteAnimationReceived(RemoteAnimationTargetSet targets) { isAnimatingToRecents = targets != null && targets.isAnimatingHome(); if (!isAnimatingToRecents) { rv.setContentAlpha(1); } - createActivityInterface(getSwipeUpDestinationAndLength( + createActivityController(getSwipeUpDestinationAndLength( activity.getDeviceProfile(), activity, new Rect())); } @Override - public void createActivityInterface(long transitionLength) { + public void createActivityController(long transitionLength) { AnimatorSet animatorSet = new AnimatorSet(); if (isAnimatingToRecents) { ObjectAnimator anim = ObjectAnimator.ofFloat(rv, CONTENT_ALPHA, 0, 1); @@ -177,13 +177,13 @@ public final class FallbackActivityInterface implements @Override public ActivityInitListener createActivityInitListener( BiPredicate onInitListener) { - return new ActivityInitListener(onInitListener, RecentsActivity.ACTIVITY_TRACKER); + return new RecentsActivityTracker(onInitListener); } @Nullable @Override public RecentsActivity getCreatedActivity() { - return BaseRecentsActivity.ACTIVITY_TRACKER.getCreatedActivity(); + return RecentsActivityTracker.getCurrentActivity(); } @Nullable diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java similarity index 91% rename from quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java rename to quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java index f6b3654e69..bbcd3b42db 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityInterface.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -38,6 +38,7 @@ import android.animation.TimeInterpolator; import android.content.Context; import android.graphics.Rect; import android.graphics.RectF; +import android.graphics.Region; import android.os.UserHandle; import android.view.MotionEvent; import android.view.View; @@ -49,6 +50,7 @@ import androidx.annotation.UiThread; import com.android.launcher3.DeviceProfile; import com.android.launcher3.Launcher; +import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherInitListenerEx; import com.android.launcher3.LauncherState; import com.android.launcher3.LauncherStateManager; @@ -59,23 +61,21 @@ import com.android.launcher3.uioverrides.states.OverviewState; import com.android.launcher3.userevent.nano.LauncherLogProto; import com.android.launcher3.views.FloatingIconView; import com.android.quickstep.SysUINavigationMode.Mode; -import com.android.quickstep.util.ActivityInitListener; import com.android.quickstep.util.LayoutUtils; import com.android.quickstep.util.StaggeredWorkspaceAnim; import com.android.quickstep.views.LauncherRecentsView; import com.android.quickstep.views.RecentsView; import com.android.quickstep.views.TaskView; import com.android.systemui.plugins.shared.LauncherOverlayManager; -import com.android.systemui.shared.recents.model.ThumbnailData; import com.android.systemui.shared.system.RemoteAnimationTargetCompat; import java.util.function.BiPredicate; import java.util.function.Consumer; /** - * {@link BaseActivityInterface} for the in-launcher recents. + * {@link ActivityControlHelper} for the in-launcher recents. */ -public final class LauncherActivityInterface implements BaseActivityInterface { +public final class LauncherActivityControllerHelper implements ActivityControlHelper { private Runnable mAdjustInterpolatorsRunnable; @@ -109,14 +109,6 @@ public final class LauncherActivityInterface implements BaseActivityInterface