本文整理匯總了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;
}
示例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;
}
示例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();
}