當前位置: 首頁>>代碼示例>>Java>>正文


Java TextSecurePreferences.setLastExperienceVersionCode方法代碼示例

本文整理匯總了Java中org.thoughtcrime.securesms.util.TextSecurePreferences.setLastExperienceVersionCode方法的典型用法代碼示例。如果您正苦於以下問題:Java TextSecurePreferences.setLastExperienceVersionCode方法的具體用法?Java TextSecurePreferences.setLastExperienceVersionCode怎麽用?Java TextSecurePreferences.setLastExperienceVersionCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.thoughtcrime.securesms.util.TextSecurePreferences的用法示例。


在下文中一共展示了TextSecurePreferences.setLastExperienceVersionCode方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getExperienceUpgrade

import org.thoughtcrime.securesms.util.TextSecurePreferences; //導入方法依賴的package包/類
public static Optional<ExperienceUpgrade> getExperienceUpgrade(Context context) {
  final int currentVersionCode = Util.getCurrentApkReleaseVersion(context);
  final int lastSeenVersion    = TextSecurePreferences.getLastExperienceVersionCode(context);
  Log.w(TAG, "getExperienceUpgrade(" + lastSeenVersion + ")");

  if (lastSeenVersion >= currentVersionCode) {
    TextSecurePreferences.setLastExperienceVersionCode(context, currentVersionCode);
    return Optional.absent();
  }

  Optional<ExperienceUpgrade> eligibleUpgrade = Optional.absent();
  for (ExperienceUpgrade upgrade : ExperienceUpgrade.values()) {
    if (lastSeenVersion < upgrade.getVersion()) eligibleUpgrade = Optional.of(upgrade);
  }

  return eligibleUpgrade;
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:18,代碼來源:ExperienceUpgradeActivity.java

示例2: doInBackground

import org.thoughtcrime.securesms.util.TextSecurePreferences; //導入方法依賴的package包/類
@Override
protected Void doInBackground(String... params) {
  String passphrase = params[0];
  masterSecret      = MasterSecretUtil.generateMasterSecret(PassphraseCreateActivity.this,
                                                            passphrase);

  MasterSecretUtil.generateAsymmetricMasterSecret(PassphraseCreateActivity.this, masterSecret);
  IdentityKeyUtil.generateIdentityKeys(PassphraseCreateActivity.this);
  VersionTracker.updateLastSeenVersion(PassphraseCreateActivity.this);
  TextSecurePreferences.setLastExperienceVersionCode(PassphraseCreateActivity.this, Util.getCurrentApkReleaseVersion(PassphraseCreateActivity.this));
  TextSecurePreferences.setPasswordDisabled(PassphraseCreateActivity.this, true);

  return null;
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:15,代碼來源:PassphraseCreateActivity.java

示例3: onContinue

import org.thoughtcrime.securesms.util.TextSecurePreferences; //導入方法依賴的package包/類
private void onContinue(Optional<ExperienceUpgrade> seenUpgrade) {
  ServiceUtil.getNotificationManager(this).cancel(NOTIFICATION_ID);
  int latestVersion = seenUpgrade.isPresent() ? seenUpgrade.get().getVersion()
                                              : Util.getCurrentApkReleaseVersion(this);
  TextSecurePreferences.setLastExperienceVersionCode(this, latestVersion);
  startActivity((Intent)getIntent().getParcelableExtra("next_intent"));
  finish();
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:9,代碼來源:ExperienceUpgradeActivity.java


注:本文中的org.thoughtcrime.securesms.util.TextSecurePreferences.setLastExperienceVersionCode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。