本文整理汇总了Java中org.thoughtcrime.securesms.DatabaseUpgradeActivity类的典型用法代码示例。如果您正苦于以下问题:Java DatabaseUpgradeActivity类的具体用法?Java DatabaseUpgradeActivity怎么用?Java DatabaseUpgradeActivity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DatabaseUpgradeActivity类属于org.thoughtcrime.securesms包,在下文中一共展示了DatabaseUpgradeActivity类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMasterSecret
import org.thoughtcrime.securesms.DatabaseUpgradeActivity; //导入依赖的package包/类
public void setMasterSecret(final MasterSecret masterSecret) {
synchronized (KeyCachingService.class) {
KeyCachingService.masterSecret = masterSecret;
foregroundService();
broadcastNewSecret();
startTimeoutIfAppropriate();
if (!TextSecurePreferences.isPasswordDisabled(this)) {
ApplicationContext.getInstance(this).getJobManager().add(new MasterSecretDecryptJob(this));
}
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
if (!DatabaseUpgradeActivity.isUpdate(KeyCachingService.this)) {
MessageNotifier.updateNotification(KeyCachingService.this, masterSecret);
}
return null;
}
}.execute();
}
}
示例2: setMasterSecret
import org.thoughtcrime.securesms.DatabaseUpgradeActivity; //导入依赖的package包/类
public void setMasterSecret(final MasterSecret masterSecret) {
synchronized (KeyCachingService.class) {
KeyCachingService.masterSecret = masterSecret;
foregroundService();
broadcastNewSecret();
startTimeoutIfAppropriate();
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... params) {
if (!DatabaseUpgradeActivity.isUpdate(KeyCachingService.this)) {
ApplicationContext.getInstance(KeyCachingService.this)
.getJobManager()
.setEncryptionKeys(new EncryptionKeys(ParcelUtil.serialize(masterSecret)));
MessageNotifier.updateNotification(KeyCachingService.this, masterSecret);
}
return null;
}
}.execute();
}
}