From 938db80ec52fc02fd54027628772d528db0fe3c7 Mon Sep 17 00:00:00 2001 From: Michael Kolb <kolby@google.com> Date: Tue, 11 Oct 2011 10:49:05 -0700 Subject: [PATCH] Fix intent handling from other apps in recovery case Bug: 5433940 When browser had a crash recovery state, the view intent from the other app was dropped. Change-Id: I8eaafa7ad792fa2048ad33886b7394c31ca97e21 --- src/com/android/browser/Controller.java | 11 ++++++----- src/com/android/browser/CrashRecoveryHandler.java | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 81ba9411..686cfcda 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -262,13 +262,13 @@ public class Controller void start(final Bundle icicle, final Intent intent) { boolean noCrashRecovery = intent.getBooleanExtra(NO_CRASH_RECOVERY, false); if (icicle != null || noCrashRecovery) { - doStart(icicle, intent); + doStart(icicle, intent, false); } else { mCrashRecoveryHandler.startRecovery(intent); } } - void doStart(final Bundle icicle, final Intent intent) { + void doStart(final Bundle icicle, final Intent intent, final boolean fromCrash) { // Unless the last browser usage was within 24 hours, destroy any // remaining incognito tabs. @@ -296,13 +296,14 @@ public class Controller GoogleAccountLogin.startLoginIfNeeded(mActivity, new Runnable() { @Override public void run() { - onPreloginFinished(icicle, intent, currentTabId, restoreIncognitoTabs); + onPreloginFinished(icicle, intent, currentTabId, restoreIncognitoTabs, + fromCrash); } }); } private void onPreloginFinished(Bundle icicle, Intent intent, long currentTabId, - boolean restoreIncognitoTabs) { + boolean restoreIncognitoTabs, boolean fromCrash) { if (currentTabId == -1) { BackgroundHandler.execute(new PruneThumbnails(mActivity, null)); final Bundle extra = intent.getExtras(); @@ -346,7 +347,7 @@ public class Controller setActiveTab(mTabControl.getCurrentTab()); // Handle the intent if needed. If icicle != null, we are restoring // and the intent will be stale - ignore it. - if (icicle == null) { + if (icicle == null || fromCrash) { mIntentHandler.onNewIntent(intent); } } diff --git a/src/com/android/browser/CrashRecoveryHandler.java b/src/com/android/browser/CrashRecoveryHandler.java index c2fbbd2f..396985ab 100644 --- a/src/com/android/browser/CrashRecoveryHandler.java +++ b/src/com/android/browser/CrashRecoveryHandler.java @@ -233,7 +233,7 @@ public class CrashRecoveryHandler { } updateLastRecovered(mRecoveryState != null ? System.currentTimeMillis() : 0); - mController.doStart(mRecoveryState, intent); + mController.doStart(mRecoveryState, intent, true); mRecoveryState = null; } -- GitLab