Merge "Fix showing strange Launcher on pressing Home." into ub-launcher3-master

This commit is contained in:
Vadim Tryshev 2018-11-13 01:28:24 +00:00 committed by Android (Google) Code Review
commit 9d9310ba72
1 changed files with 5 additions and 0 deletions

View File

@ -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;