From e45e60140e3d65de8f80e9351071b187d3a54946 Mon Sep 17 00:00:00 2001 From: Vadim Tryshev Date: Mon, 12 Nov 2018 16:11:55 -0800 Subject: [PATCH] Fix showing strange Launcher on pressing Home. Bug: 118441555 Test: manual, race condition repro, TaplTests Change-Id: I8b09895558f8baa72eb3a794724170417fadfda6 --- src/com/android/launcher3/states/InternalStateHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/launcher3/states/InternalStateHandler.java b/src/com/android/launcher3/states/InternalStateHandler.java index c6370c5c5f..d326ff384a 100644 --- a/src/com/android/launcher3/states/InternalStateHandler.java +++ b/src/com/android/launcher3/states/InternalStateHandler.java @@ -36,6 +36,7 @@ import java.lang.ref.WeakReference; public abstract class InternalStateHandler extends Binder { public static final String EXTRA_STATE_HANDLER = "launcher.state_handler"; + public static final String EXTRA_FROM_HOME_KEY = "android.intent.extra.FROM_HOME_KEY"; private static final Scheduler sScheduler = new Scheduler(); @@ -76,6 +77,10 @@ public abstract class InternalStateHandler extends Binder { Launcher launcher, Intent intent, boolean alreadyOnHome, boolean explicitIntent) { boolean result = false; if (intent != null && intent.getExtras() != null) { + // If we know that this the intent comes from pressing Home, defer to the default + // processing. + if (intent.hasExtra(EXTRA_FROM_HOME_KEY)) return false; + IBinder stateBinder = intent.getExtras().getBinder(EXTRA_STATE_HANDLER); if (stateBinder instanceof InternalStateHandler) { InternalStateHandler handler = (InternalStateHandler) stateBinder;