diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java index 0c4cd43e72..f957c37505 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/TouchInteractionService.java @@ -31,6 +31,8 @@ import static com.android.systemui.shared.system.RemoteAnimationTargetCompat.ACT import android.annotation.TargetApi; import android.app.ActivityManager; import android.app.ActivityManager.RunningTaskInfo; +import android.app.PendingIntent; +import android.app.RemoteAction; import android.app.Service; import android.content.ComponentName; import android.content.Context; @@ -38,6 +40,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.content.res.Configuration; import android.graphics.Region; +import android.graphics.drawable.Icon; import android.os.Build; import android.os.Bundle; import android.os.IBinder; @@ -46,6 +49,7 @@ import android.util.Log; import android.view.Choreographer; import android.view.InputEvent; import android.view.MotionEvent; +import android.view.accessibility.AccessibilityManager; import androidx.annotation.BinderThread; import androidx.annotation.Nullable; @@ -53,6 +57,7 @@ import androidx.annotation.UiThread; import androidx.annotation.WorkerThread; import com.android.launcher3.BaseDraggingActivity; +import com.android.launcher3.R; import com.android.launcher3.Utilities; import com.android.launcher3.allapps.DiscoveryBounce; import com.android.launcher3.config.FeatureFlags; @@ -126,6 +131,12 @@ public class TouchInteractionService extends Service implements PluginListener mOverviewChangeListener = b -> { }; + private String mUpdateRegisteredPackage; private BaseActivityInterface mActivityInterface; private Intent mOverviewIntent; @@ -64,10 +68,10 @@ public final class OverviewComponentObserver { private boolean mIsDefaultHome; private boolean mIsHomeDisabled; + public OverviewComponentObserver(Context context, RecentsAnimationDeviceState deviceState) { mContext = context; mDeviceState = deviceState; - mCurrentHomeIntent = new Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_HOME) .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); @@ -95,6 +99,13 @@ public final class OverviewComponentObserver { updateOverviewTargets(); } + /** + * Sets a listener for changes in {@link #isHomeAndOverviewSame()} + */ + public void setOverviewChangeListener(Consumer overviewChangeListener) { + mOverviewChangeListener = overviewChangeListener; + } + public void onSystemUiStateChanged() { if (mDeviceState.isHomeDisabled() != mIsHomeDisabled) { updateOverviewTargets(); @@ -159,6 +170,7 @@ public final class OverviewComponentObserver { ACTION_PACKAGE_REMOVED)); } } + mOverviewChangeListener.accept(mIsHomeAndOverviewSame); } /** diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java index 043ea2fc10..6a35e800da 100644 --- a/src/com/android/launcher3/Launcher.java +++ b/src/com/android/launcher3/Launcher.java @@ -1443,6 +1443,8 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns, mLauncherCallbacks.onHomeIntent(internalStateHandled); } mOverlayManager.hideOverlay(isStarted() && !isForceInvisible()); + } else if (Intent.ACTION_ALL_APPS.equals(intent.getAction())) { + getStateManager().goToState(ALL_APPS, alreadyOnHome); } TraceHelper.INSTANCE.endSection(traceToken);