use of org.chromium.chrome.browser.preferences.PrefServiceBridge.AboutVersionStrings in project AndroidChromium by JackyAndroid.
the class DataReductionPromoUtils method saveFreOrSecondRunPromoDisplayed.
/**
* Saves shared prefs indicating that the data reduction proxy first run experience or second
* run promo screen has been displayed at the current time.
*/
public static void saveFreOrSecondRunPromoDisplayed() {
AboutVersionStrings versionStrings = PrefServiceBridge.getInstance().getAboutVersionStrings();
ContextUtils.getAppSharedPreferences().edit().putBoolean(SHARED_PREF_DISPLAYED_FRE_OR_SECOND_RUN_PROMO, true).putLong(SHARED_PREF_DISPLAYED_FRE_OR_SECOND_PROMO_TIME_MS, System.currentTimeMillis()).putString(SHARED_PREF_DISPLAYED_FRE_OR_SECOND_PROMO_VERSION, versionStrings.getApplicationVersion()).apply();
}
use of org.chromium.chrome.browser.preferences.PrefServiceBridge.AboutVersionStrings in project AndroidChromium by JackyAndroid.
the class AboutChromePreferences method onCreate.
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getActivity().setTitle(R.string.prefs_about_chrome);
addPreferencesFromResource(R.xml.about_chrome_preferences);
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN) {
ChromeBasePreference deprecationWarning = new ChromeBasePreference(new ContextThemeWrapper(getActivity(), R.style.DeprecationWarningPreferenceTheme));
deprecationWarning.setOrder(-1);
deprecationWarning.setTitle(R.string.deprecation_warning);
deprecationWarning.setIcon(R.drawable.exclamation_triangle);
getPreferenceScreen().addPreference(deprecationWarning);
}
PrefServiceBridge prefServiceBridge = PrefServiceBridge.getInstance();
AboutVersionStrings versionStrings = prefServiceBridge.getAboutVersionStrings();
Preference p = findPreference(PREF_APPLICATION_VERSION);
p.setSummary(getApplicationVersion(getActivity(), versionStrings.getApplicationVersion()));
p = findPreference(PREF_OS_VERSION);
p.setSummary(versionStrings.getOSVersion());
p = findPreference(PREF_LEGAL_INFORMATION);
int currentYear = Calendar.getInstance().get(Calendar.YEAR);
p.setSummary(getString(R.string.legal_information_summary, currentYear));
}
use of org.chromium.chrome.browser.preferences.PrefServiceBridge.AboutVersionStrings in project AndroidChromium by JackyAndroid.
the class DataReductionPromoUtils method saveInfoBarPromoDisplayed.
/**
* Saves shared prefs indicating that the data reduction proxy infobar promo has been displayed
* at the current time.
*/
public static void saveInfoBarPromoDisplayed() {
AboutVersionStrings versionStrings = PrefServiceBridge.getInstance().getAboutVersionStrings();
ContextUtils.getAppSharedPreferences().edit().putBoolean(SHARED_PREF_DISPLAYED_INFOBAR_PROMO, true).putString(SHARED_PREF_DISPLAYED_INFOBAR_PROMO_VERSION, versionStrings.getApplicationVersion()).apply();
}
Aggregations