Commit 938db80e authored by Michael Kolb's avatar Michael Kolb
Browse files

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
parent 7d209c5d
......@@ -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);
}
}
......
......@@ -233,7 +233,7 @@ public class CrashRecoveryHandler {
}
updateLastRecovered(mRecoveryState != null
? System.currentTimeMillis() : 0);
mController.doStart(mRecoveryState, intent);
mController.doStart(mRecoveryState, intent, true);
mRecoveryState = null;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment