Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3430)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java

Issue 2647763006: Fix race between onFlowIsKnown and native init in FRE code. (Closed)
Patch Set: . Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
index 7a1c7640d5f73acf3e914cc52095265c84029053..f7882d95925655f18801d0492067a33b0a66740f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivity.java
@@ -100,6 +100,7 @@ public class FirstRunActivity extends AsyncInitializationActivity implements Fir
private String mResultSignInAccountName;
private boolean mResultShowSignInSettings;
+ private boolean mFlowIsKnown;
private boolean mPostNativePageSequenceCreated;
private boolean mNativeSideIsInitialized;
private Set<FirstRunPage> mPagesToNotifyOfNativeInit;
@@ -194,6 +195,7 @@ public class FirstRunActivity extends AsyncInitializationActivity implements Fir
mFirstRunFlowSequencer = new FirstRunFlowSequencer(this, mFreProperties) {
@Override
public void onFlowIsKnown(Bundle freProperties) {
+ mFlowIsKnown = true;
if (freProperties == null) {
completeFirstRunExperience();
return;
@@ -201,14 +203,16 @@ public class FirstRunActivity extends AsyncInitializationActivity implements Fir
mFreProperties = freProperties;
mShowWelcomePage = mFreProperties.getBoolean(SHOW_WELCOME_PAGE);
-
- createPageSequence();
-
if (TextUtils.isEmpty(mResultSignInAccountName)) {
mResultSignInAccountName = mFreProperties.getString(
AccountFirstRunFragment.FORCE_SIGNIN_ACCOUNT_TO);
}
+ createPageSequence();
+ if (mNativeSideIsInitialized) {
+ createPostNativePageSequence();
+ }
+
if (mPages.size() == 0) {
completeFirstRunExperience();
return;
@@ -219,6 +223,10 @@ public class FirstRunActivity extends AsyncInitializationActivity implements Fir
stopProgressionIfNotAcceptedTermsOfService();
mPager.setAdapter(mPagerAdapter);
+ if (mNativeSideIsInitialized) {
+ skipPagesIfNecessary();
+ }
+
recordFreProgressHistogram(mFreProgressStates.get(0));
}
};
@@ -234,7 +242,9 @@ public class FirstRunActivity extends AsyncInitializationActivity implements Fir
if (mDeferredCompleteFRE) {
completeFirstRunExperience();
mDeferredCompleteFRE = false;
- } else {
+ } else if (mFlowIsKnown) {
+ // Note: If mFlowIsKnown is false, then we're not ready to create the post native page
+ // sequence - in that case this will be done when onFlowIsKnown() gets called.
createPostNativePageSequence();
if (mPagesToNotifyOfNativeInit != null) {
for (FirstRunPage page : mPagesToNotifyOfNativeInit) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698