Index: components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java |
diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java |
index 3af546bf3bf62115b4ff37c4ff207f4c58f6a54d..555029e8994a9128081f1fe5a3ab8ee0f5b6f129 100644 |
--- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java |
+++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java |
@@ -21,6 +21,8 @@ public final class VariationsSeedBridge { |
private static final String VARIATIONS_FIRST_RUN_SEED_BASE64 = "variations_seed_base64"; |
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 final String VARIATIONS_FIRST_RUN_SEED_NATIVE_STORED = |
+ "variations_seed_native_stored"; |
private static String getVariationsFirstRunSeedPref(Context context, String prefName) { |
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
@@ -41,6 +43,28 @@ public final class VariationsSeedBridge { |
.apply(); |
} |
+ /** |
+ * Returns the status of the variations first run fetch: was it successful or not. |
+ */ |
+ public static boolean hasJavaPref(Context context) { |
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
+ return !prefs.getString(VARIATIONS_FIRST_RUN_SEED_BASE64, "").equals(""); |
+ } |
+ |
+ /** |
+ * Returns the status of the variations first run fetch: was it successful or not. |
+ */ |
+ public static boolean hasNativePref(Context context) { |
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
+ return prefs.getBoolean(VARIATIONS_FIRST_RUN_SEED_NATIVE_STORED, false); |
+ } |
+ |
+ @CalledByNative |
+ private static void markVariationsSeedAsStored(Context context) { |
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
+ prefs.edit().putBoolean(VARIATIONS_FIRST_RUN_SEED_NATIVE_STORED, true).apply(); |
+ } |
+ |
@CalledByNative |
private static byte[] getVariationsFirstRunSeedData(Context context) { |
return Base64.decode( |