Skip to content

Commit

Permalink
Removed Use Sync staging server at QA preferences (#26804)
Browse files Browse the repository at this point in the history
This fixes CI build failure appeared at `v1.75.58` and resolved deps violation

Fixes brave/brave-browser#42596
  • Loading branch information
AlexeyBarabash authored Nov 29, 2024
1 parent 6f4d958 commit 81f1d67
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import androidx.preference.Preference;
import androidx.preference.Preference.OnPreferenceChangeListener;

import org.jni_zero.CalledByNative;

import org.chromium.base.ContextUtils;
import org.chromium.base.FileUtils;
import org.chromium.base.Log;
Expand Down Expand Up @@ -56,7 +54,6 @@
public class BraveQAPreferences extends BravePreferenceFragment
implements OnPreferenceChangeListener, BraveRewardsObserver {
private static final String PREF_USE_REWARDS_STAGING_SERVER = "use_rewards_staging_server";
private static final String PREF_USE_SYNC_STAGING_SERVER = "use_sync_staging_server";
private static final String PREF_QA_MAXIMIZE_INITIAL_ADS_NUMBER =
"qa_maximize_initial_ads_number";
private static final String PREF_QA_DEBUG_NTP = "qa_debug_ntp";
Expand All @@ -75,7 +72,6 @@ public class BraveQAPreferences extends BravePreferenceFragment
private ChromeSwitchPreference mLinkSubscriptionOnStaging;
private ChromeSwitchPreference mBraveDormantFeatureEngagement;
private ChromeSwitchPreference mIsStagingServer;
private ChromeSwitchPreference mIsSyncStagingServer;
private ChromeSwitchPreference mMaximizeAdsNumber;
private ChromeSwitchPreference mDebugNTP;
private ChromeSwitchPreference mVlogRewards;
Expand Down Expand Up @@ -119,13 +115,6 @@ public void onCreate(Bundle savedInstanceState) {
UserPrefs.get(ProfileManager.getLastUsedRegularProfile())
.getBoolean(BravePref.USE_REWARDS_STAGING_SERVER));

mIsSyncStagingServer =
(ChromeSwitchPreference) findPreference(PREF_USE_SYNC_STAGING_SERVER);
if (mIsSyncStagingServer != null) {
mIsSyncStagingServer.setOnPreferenceChangeListener(this);
}
mIsSyncStagingServer.setChecked(isSyncStagingUsed());

mMaximizeAdsNumber =
(ChromeSwitchPreference) findPreference(PREF_QA_MAXIMIZE_INITIAL_ADS_NUMBER);
if (mMaximizeAdsNumber != null) {
Expand Down Expand Up @@ -268,7 +257,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
} else if (PREF_QA_MAXIMIZE_INITIAL_ADS_NUMBER.equals(preference.getKey())) {
enableMaximumAdsNumber((boolean) newValue);
} else if (PREF_QA_DEBUG_NTP.equals(preference.getKey())
|| PREF_USE_SYNC_STAGING_SERVER.equals(preference.getKey())
|| PREF_QA_VLOG_REWARDS.equals(preference.getKey())
|| LinkSubscriptionUtils.PREF_LINK_SUBSCRIPTION_ON_STAGING.equals(
preference.getKey())
Expand Down Expand Up @@ -304,11 +292,6 @@ private static String getPreferenceString(String preferenceName) {
return sharedPreferences.getString(preferenceName, "");
}

@CalledByNative
public static boolean isSyncStagingUsed() {
return getPreferenceValue(PREF_USE_SYNC_STAGING_SERVER);
}

public static boolean shouldVlogRewards() {
return getPreferenceValue(PREF_QA_VLOG_REWARDS);
}
Expand Down
6 changes: 0 additions & 6 deletions android/java/res/xml/qa_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@
android:summaryOn="@string/text_on"
android:summaryOff="@string/text_off" />

<org.chromium.components.browser_ui.settings.ChromeSwitchPreference
android:key="use_sync_staging_server"
android:title="Use Sync staging server"
android:summaryOn="@string/text_on"
android:summaryOff="@string/text_off" />

<org.chromium.components.browser_ui.settings.ChromeSwitchPreference
android:key="qa_maximize_initial_ads_number"
android:title="Maximize initial ads number"
Expand Down
1 change: 0 additions & 1 deletion build/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ generate_jni("jni_headers") {
"//brave/android/java/org/chromium/chrome/browser/playlist/PlaylistServiceFactoryAndroid.java",
"//brave/android/java/org/chromium/chrome/browser/preferences/BravePrefServiceBridge.java",
"//brave/android/java/org/chromium/chrome/browser/preferences/website/BraveShieldsContentSettings.java",
"//brave/android/java/org/chromium/chrome/browser/settings/developer/BraveQAPreferences.java",
"//brave/android/java/org/chromium/chrome/browser/shields/FilterListServiceFactory.java",
"//brave/android/java/org/chromium/chrome/browser/shields/UrlSanitizerServiceFactory.java",
"//brave/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java",
Expand Down
1 change: 0 additions & 1 deletion build/android/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ brave_jni_headers_sources = [
"//brave/android/java/org/chromium/chrome/browser/playlist/PlaylistServiceFactoryAndroid.java",
"//brave/android/java/org/chromium/chrome/browser/preferences/BravePrefServiceBridge.java",
"//brave/android/java/org/chromium/chrome/browser/preferences/website/BraveShieldsContentSettings.java",
"//brave/android/java/org/chromium/chrome/browser/settings/developer/BraveQAPreferences.java",
"//brave/android/java/org/chromium/chrome/browser/shields/FilterListServiceFactory.java",
"//brave/android/java/org/chromium/chrome/browser/shields/UrlSanitizerServiceFactory.java",
"//brave/android/java/org/chromium/chrome/browser/signin/BraveSigninManager.java",
Expand Down
1 change: 0 additions & 1 deletion chromium_src/components/sync/service/DEPS
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
include_rules = [
"+brave/components/brave_sync",
"+brave/components/sync/service",
"+brave/build/android/jni_headers/BraveQAPreferences_jni.h",
]
15 changes: 0 additions & 15 deletions chromium_src/components/sync/service/sync_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
#include "components/sync/base/command_line_switches.h"
#include "components/sync/base/sync_util.h"

#if BUILDFLAG(IS_ANDROID)
#include "base/android/jni_android.h"
#include "brave/build/android/jni_headers/BraveQAPreferences_jni.h"
#endif

namespace syncer {

GURL BraveGetSyncServiceURL(const base::CommandLine& command_line,
Expand Down Expand Up @@ -53,16 +48,6 @@ GURL BraveGetSyncServiceURL(const base::CommandLine& command_line,
}
}
}
#else
const char kBraveSyncServiceStagingURL[] =
"https://sync-v2.bravesoftware.com/v2";

JNIEnv* env = base::android::AttachCurrentThread();
bool b_use_staging_sync_server =
Java_BraveQAPreferences_isSyncStagingUsed(env);
if (b_use_staging_sync_server) {
return GURL(kBraveSyncServiceStagingURL);
}
#endif

// Default logic.
Expand Down
4 changes: 0 additions & 4 deletions components/sync/service/sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ brave_components_sync_service_deps = [
"//brave/components/brave_sync:prefs",
"//brave/components/constants",
]

if (is_android) {
brave_components_sync_service_deps += [ "//brave/build/android:jni_headers" ]
}

0 comments on commit 81f1d67

Please sign in to comment.