diff --git a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java index d74a13b40f..98fd44bc22 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +++ b/quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java @@ -34,7 +34,6 @@ import static com.android.launcher3.LauncherState.OVERVIEW_MODAL_TASK; import static com.android.launcher3.LauncherState.OVERVIEW_SPLIT_SELECT; import static com.android.launcher3.compat.AccessibilityManagerCompat.sendCustomAccessibilityEvent; import static com.android.launcher3.config.FeatureFlags.ENABLE_SPLIT_FROM_WORKSPACE_TO_WORKSPACE; -import static com.android.launcher3.config.FeatureFlags.RECEIVE_UNFOLD_EVENTS_FROM_SYSUI; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_APP_LAUNCH_TAP; import static com.android.launcher3.model.data.ItemInfo.NO_MATCHING_ID; import static com.android.launcher3.popup.QuickstepSystemShortcut.getSplitSelectShortcutByPosition; @@ -58,7 +57,6 @@ import static com.android.systemui.shared.system.ActivityManagerWrapper.CLOSE_SY import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.AnimatorSet; -import android.app.ActivityManager; import android.app.ActivityOptions; import android.content.Context; import android.content.Intent; @@ -68,8 +66,6 @@ import android.content.res.Configuration; import android.graphics.Color; import android.graphics.Rect; import android.graphics.RectF; -import android.hardware.SensorManager; -import android.hardware.devicestate.DeviceStateManager; import android.hardware.display.DisplayManager; import android.media.permission.SafeCloseable; import android.os.Build; @@ -157,7 +153,6 @@ import com.android.quickstep.TaskUtils; import com.android.quickstep.TouchInteractionService.TISBinder; import com.android.quickstep.util.GroupTask; import com.android.quickstep.util.LauncherUnfoldAnimationController; -import com.android.quickstep.util.ProxyScreenStatusProvider; import com.android.quickstep.util.QuickstepOnboardingPrefs; import com.android.quickstep.util.SplitSelectStateController; import com.android.quickstep.util.SplitToWorkspaceController; @@ -171,14 +166,11 @@ import com.android.quickstep.views.TaskView; import com.android.systemui.shared.recents.model.Task; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.unfold.RemoteUnfoldSharedComponent; -import com.android.systemui.unfold.UnfoldSharedComponent; import com.android.systemui.unfold.UnfoldTransitionFactory; import com.android.systemui.unfold.UnfoldTransitionProgressProvider; import com.android.systemui.unfold.config.ResourceUnfoldTransitionConfig; import com.android.systemui.unfold.config.UnfoldTransitionConfig; import com.android.systemui.unfold.progress.RemoteUnfoldTransitionReceiver; -import com.android.systemui.unfold.system.ActivityManagerActivityTypeProvider; -import com.android.systemui.unfold.system.DeviceStateManagerFoldProvider; import com.android.systemui.unfold.updates.RotationChangeProvider; import java.io.FileDescriptor; @@ -465,10 +457,7 @@ public class QuickstepLauncher extends Launcher { public void onDestroy() { mAppTransitionManager.onActivityDestroyed(); if (mUnfoldTransitionProgressProvider != null) { - if (FeatureFlags.RECEIVE_UNFOLD_EVENTS_FROM_SYSUI.get()) { - SystemUiProxy.INSTANCE.get(this).setUnfoldAnimationListener(null); - } - + SystemUiProxy.INSTANCE.get(this).setUnfoldAnimationListener(null); mUnfoldTransitionProgressProvider.destroy(); } @@ -905,43 +894,10 @@ public class QuickstepLauncher extends Launcher { private void initUnfoldTransitionProgressProvider() { final UnfoldTransitionConfig config = new ResourceUnfoldTransitionConfig(); if (config.isEnabled()) { - if (RECEIVE_UNFOLD_EVENTS_FROM_SYSUI.get()) { - initRemotelyCalculatedUnfoldAnimation(config); - } else { - initLocallyCalculatedUnfoldAnimation(config); - } - + initRemotelyCalculatedUnfoldAnimation(config); } } - /** Registers hinge angle listener and calculates the animation progress in this process. */ - private void initLocallyCalculatedUnfoldAnimation(UnfoldTransitionConfig config) { - UnfoldSharedComponent unfoldComponent = - UnfoldTransitionFactory.createUnfoldSharedComponent( - /* context= */ this, - config, - ProxyScreenStatusProvider.INSTANCE, - new DeviceStateManagerFoldProvider( - getSystemService(DeviceStateManager.class), /* context= */ this), - new ActivityManagerActivityTypeProvider( - getSystemService(ActivityManager.class)), - getSystemService(SensorManager.class), - getMainThreadHandler(), - getMainExecutor(), - /* backgroundExecutor= */ UI_HELPER_EXECUTOR, - /* tracingTagPrefix= */ "launcher", - getSystemService(DisplayManager.class) - ); - - mUnfoldTransitionProgressProvider = unfoldComponent.getUnfoldTransitionProvider() - .orElseThrow(() -> new IllegalStateException( - "Trying to create UnfoldTransitionProgressProvider when the " - + "transition is disabled")); - - initUnfoldAnimationController(mUnfoldTransitionProgressProvider, - unfoldComponent.getRotationChangeProvider()); - } - /** Receives animation progress from sysui process. */ private void initRemotelyCalculatedUnfoldAnimation(UnfoldTransitionConfig config) { RemoteUnfoldSharedComponent unfoldComponent = diff --git a/quickstep/src/com/android/quickstep/TouchInteractionService.java b/quickstep/src/com/android/quickstep/TouchInteractionService.java index 79c7329564..9e7964a4f6 100644 --- a/quickstep/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/src/com/android/quickstep/TouchInteractionService.java @@ -116,7 +116,6 @@ import com.android.quickstep.inputconsumers.TaskbarUnstashInputConsumer; import com.android.quickstep.inputconsumers.TrackpadStatusBarInputConsumer; import com.android.quickstep.util.ActiveGestureLog; import com.android.quickstep.util.ActiveGestureLog.CompoundString; -import com.android.quickstep.util.ProxyScreenStatusProvider; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; @@ -300,24 +299,6 @@ public class TouchInteractionService extends Service { tis -> tis.mDeviceState.setDeferredGestureRegion(region))); } - @BinderThread - @Override - public void onScreenTurnedOn() { - MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurnedOn); - } - - @BinderThread - @Override - public void onScreenTurningOn() { - MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurningOn); - } - - @BinderThread - @Override - public void onScreenTurningOff() { - MAIN_EXECUTOR.execute(ProxyScreenStatusProvider.INSTANCE::onScreenTurningOff); - } - @BinderThread @Override public void enterStageSplitFromRunningApp(boolean leftOrTop) { diff --git a/quickstep/src/com/android/quickstep/util/ProxyScreenStatusProvider.java b/quickstep/src/com/android/quickstep/util/ProxyScreenStatusProvider.java deleted file mode 100644 index 8f79ccf450..0000000000 --- a/quickstep/src/com/android/quickstep/util/ProxyScreenStatusProvider.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2021 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package com.android.quickstep.util; - -import androidx.annotation.NonNull; - -import com.android.systemui.unfold.updates.screen.ScreenStatusProvider; - -import java.util.ArrayList; -import java.util.List; - -/** - * Screen status provider implementation that exposes methods to provide screen - * status updates to listeners. It is used to receive screen turned on event from - * SystemUI to Launcher. - */ -public class ProxyScreenStatusProvider implements ScreenStatusProvider { - - public static final ProxyScreenStatusProvider INSTANCE = new ProxyScreenStatusProvider(); - private final List mListeners = new ArrayList<>(); - - /** - * Called when the screen is on and ready (windows are drawn and screen blocker is removed) - */ - public void onScreenTurnedOn() { - mListeners.forEach(ScreenListener::onScreenTurnedOn); - } - - /** Called when the screen is starting to turn on. */ - public void onScreenTurningOn() { - mListeners.forEach(ScreenListener::onScreenTurningOn); - } - - /** Called when the screen is starting to turn off. */ - public void onScreenTurningOff() { - mListeners.forEach(ScreenListener::onScreenTurningOff); - } - - @Override - public void addCallback(@NonNull ScreenListener listener) { - mListeners.add(listener); - } - - @Override - public void removeCallback(@NonNull ScreenListener listener) { - mListeners.remove(listener); - } -} diff --git a/src/com/android/launcher3/config/FeatureFlags.java b/src/com/android/launcher3/config/FeatureFlags.java index b836491e37..38aa387f87 100644 --- a/src/com/android/launcher3/config/FeatureFlags.java +++ b/src/com/android/launcher3/config/FeatureFlags.java @@ -297,11 +297,6 @@ public final class FeatureFlags { "ENABLE_APP_ICON_IN_INLINE_SHORTCUTS", DISABLED, "Show app icon for inline shortcut"); // TODO(Block 22): Clean up flags - public static final BooleanFlag RECEIVE_UNFOLD_EVENTS_FROM_SYSUI = getDebugFlag(270397209, - "RECEIVE_UNFOLD_EVENTS_FROM_SYSUI", ENABLED, - "Enables receiving unfold animation events from sysui instead of calculating " - + "them in launcher process using hinge sensor values."); - public static final BooleanFlag ENABLE_WIDGET_TRANSITION_FOR_RESIZING = getDebugFlag(268553314, "ENABLE_WIDGET_TRANSITION_FOR_RESIZING", DISABLED, "Enable widget transition animation when resizing the widgets");