Index: chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
index c5c1564f934cc2c01e0cd420b0881b04861c3966..2e59c4a7a8be8d839ae808b14fe804a90159edf8 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/PrefServiceBridge.java |
@@ -219,6 +219,44 @@ public final class PrefServiceBridge { |
} |
} |
+ private static final String VARIATIONS_FIRST_RUN_SEED_SIGNATURE = "variations_seed_signature"; |
+ private static final String VARIATIONS_FIRST_RUN_SEED_COUNTRY = "variations_seed_country"; |
+ |
+ private static String getVariationsFirstRunSeedPref(Context context, String prefName) { |
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
+ return prefs.getString(prefName, new String()); |
+ } |
+ |
+ private static void setVariationsFirstRunSeedPref( |
+ Context context, String prefName, String data) { |
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
+ prefs.edit().putString(prefName, data).apply(); |
+ } |
+ |
+ private static byte[] sVariationsFirstRunSeedData; |
+ |
+ public static void setVariationsFirstRunSeed( |
+ Context context, byte[] rawSeed, String signature, String country) { |
+ sVariationsFirstRunSeedData = rawSeed; |
+ setVariationsFirstRunSeedPref(context, VARIATIONS_FIRST_RUN_SEED_SIGNATURE, signature); |
+ setVariationsFirstRunSeedPref(context, VARIATIONS_FIRST_RUN_SEED_COUNTRY, country); |
+ } |
+ |
+ @CalledByNative |
+ private static byte[] getVariationsFirstRunSeedData(Context context) { |
+ return sVariationsFirstRunSeedData; |
+ } |
+ |
+ @CalledByNative |
+ private static String getVariationsFirstRunSeedSignature(Context context) { |
+ return getVariationsFirstRunSeedPref(context, VARIATIONS_FIRST_RUN_SEED_SIGNATURE); |
+ } |
+ |
+ @CalledByNative |
+ private static String getVariationsFirstRunSeedCountry(Context context) { |
+ return getVariationsFirstRunSeedPref(context, VARIATIONS_FIRST_RUN_SEED_COUNTRY); |
+ } |
+ |
public boolean isAcceptCookiesEnabled() { |
return nativeGetAcceptCookiesEnabled(); |
} |