Skip to content

Commit

Permalink
Removing dayzero changes and update onboarding with new flag
Browse files Browse the repository at this point in the history
  • Loading branch information
deeppandya committed Dec 16, 2024
1 parent 295c6f5 commit c814ac8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
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
2 changes: 1 addition & 1 deletion browser/brave_browser_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ BASE_FEATURE(kBraveDayZeroExperiment,
"BraveDayZeroExperiment",
base::FEATURE_DISABLED_BY_DEFAULT);

// Enable new onabording on android
// Enable new onboarding on Android
BASE_FEATURE(kNewAndroidOnboarding,
"NewAndroidOnboarding",
base::FEATURE_DISABLED_BY_DEFAULT);
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 @@ -45,6 +46,7 @@
&net::features::kBraveForgetFirstPartyStorage, \
&brave_shields::features::kBraveShowStrictFingerprintingMode, \
&brave_shields::features::kBraveLocalhostAccessPermission, \
&features::kNewAndroidOnboarding, \
&brave_shields::features::kBlockAllCookiesToggle

// clang-format on
Expand Down

0 comments on commit c814ac8

Please sign in to comment.