Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New onboarding changes android #26999

Merged
merged 3 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions android/java/org/chromium/base/BraveFeatureList.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public abstract class BraveFeatureList {
public static final String BRAVE_SHOW_STRICT_FINGERPRINTING_MODE =
"BraveShowStrictFingerprintingMode";
public static final String BRAVE_DAY_ZERO_EXPERIMENT = "BraveDayZeroExperiment";
public static final String BRAVE_NEW_ANDROID_ONBOARDING = "NewAndroidOnboarding";
deeppandya marked this conversation as resolved.
Show resolved Hide resolved
public static final String BRAVE_FALLBACK_DOH_PROVIDER = "BraveFallbackDoHProvider";
public static final String BRAVE_BLOCK_ALL_COOKIES_TOGGLE = "BlockAllCookiesToggle";
public static final String BRAVE_SHIELDS_ELEMENT_PICKER = "BraveShieldsElementPicker";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@
import com.android.installreferrer.api.InstallReferrerStateListener;
import com.android.installreferrer.api.ReferrerDetails;

import org.chromium.base.BraveFeatureList;
import org.chromium.base.BravePreferenceKeys;
import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.BraveLocalState;
import org.chromium.chrome.browser.back_press.SecondaryActivityBackPressUma.SecondaryActivity;
import org.chromium.chrome.browser.customtabs.CustomTabActivity;
import org.chromium.chrome.browser.day_zero.DayZeroHelper;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.metrics.ChangeMetricsReportingStateCalledFrom;
import org.chromium.chrome.browser.metrics.UmaSessionStats;
import org.chromium.chrome.browser.onboarding.OnboardingPrefManager;
Expand Down Expand Up @@ -231,7 +232,11 @@ private void onClickViews() {
}

private boolean shouldForceDefaultBrowserPrompt() {
return !DayZeroHelper.getDayZeroExptFlag() && !isDefaultBrowser();
return isNewOnboardingEnabled() && !isDefaultBrowser();
}

private boolean isNewOnboardingEnabled() {
return ChromeFeatureList.isEnabled(BraveFeatureList.BRAVE_NEW_ANDROID_ONBOARDING);
}

private void setDefaultBrowserAndProceedToNextStep() {
Expand Down Expand Up @@ -260,7 +265,7 @@ private void nextOnboardingStep() {
if (mCurrentStep == 0) {
showIntroPage();
} else if (mCurrentStep == 1) {
if (DayZeroHelper.getDayZeroExptFlag()
if (!isNewOnboardingEnabled()
|| !BraveSetDefaultBrowserUtils.supportsDefaultRoleManager()) {
showBrowserSelectionPage();
} else if (!isDefaultBrowser()) {
Expand Down Expand Up @@ -317,8 +322,7 @@ public void run() {
},
200);

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU
&& DayZeroHelper.getDayZeroExptFlag()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU && !isNewOnboardingEnabled()) {
mRequestPermissionLauncher.launch(Manifest.permission.POST_NOTIFICATIONS);
} else {
startTimer(3000);
Expand Down
7 changes: 7 additions & 0 deletions browser/brave_browser_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ BASE_FEATURE(kBraveDayZeroExperiment,
"BraveDayZeroExperiment",
base::FEATURE_DISABLED_BY_DEFAULT);

#if BUILDFLAG(IS_ANDROID)
// Enable new onboarding on Android
BASE_FEATURE(kNewAndroidOnboarding,
"NewAndroidOnboarding",
base::FEATURE_DISABLED_BY_DEFAULT);
#endif // BUILDFLAG(IS_ANDROID)

// The variant of the "day zero" experiment. i.e. A, B, C, D, etc.
const base::FeatureParam<std::string> kBraveDayZeroExperimentVariant{
&kBraveDayZeroExperiment,
Expand Down
3 changes: 3 additions & 0 deletions browser/brave_browser_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ BASE_DECLARE_FEATURE(kBraveCopyCleanLinkFromJs);
BASE_DECLARE_FEATURE(kBraveOverrideDownloadDangerLevel);
BASE_DECLARE_FEATURE(kBraveWebViewRoundedCorners);
BASE_DECLARE_FEATURE(kBraveDayZeroExperiment);
#if BUILDFLAG(IS_ANDROID)
BASE_DECLARE_FEATURE(kNewAndroidOnboarding);
#endif // BUILDFLAG(IS_ANDROID)

extern const base::FeatureParam<std::string> kBraveDayZeroExperimentVariant;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "base/feature_override.h"
#include "brave/browser/android/background_video/features.h"
#include "brave/browser/android/safe_browsing/features.h"
#include "brave/browser/brave_browser_features.h"
#include "brave/components/ai_chat/core/common/features.h"
#include "brave/components/brave_news/common/features.h"
#include "brave/components/brave_rewards/common/features.h"
Expand Down Expand Up @@ -46,7 +47,8 @@
&brave_shields::features::kBraveShowStrictFingerprintingMode, \
&brave_shields::features::kBraveLocalhostAccessPermission, \
&brave_shields::features::kBlockAllCookiesToggle, \
&brave_shields::features::kBraveShieldsElementPicker
&brave_shields::features::kBraveShieldsElementPicker, \
&features::kNewAndroidOnboarding

// clang-format on

Expand Down
Loading