本文整理汇总了Java中org.whispersystems.libsignal.SignalProtocolAddress.getName方法的典型用法代码示例。如果您正苦于以下问题:Java SignalProtocolAddress.getName方法的具体用法?Java SignalProtocolAddress.getName怎么用?Java SignalProtocolAddress.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.whispersystems.libsignal.SignalProtocolAddress
的用法示例。
在下文中一共展示了SignalProtocolAddress.getName方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: archiveSiblingSessions
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
public static void archiveSiblingSessions(Context context, SignalProtocolAddress address) {
SessionStore sessionStore = new TextSecureSessionStore(context);
List<Integer> devices = sessionStore.getSubDeviceSessions(address.getName());
devices.add(1);
for (int device : devices) {
if (device != address.getDeviceId()) {
SignalProtocolAddress sibling = new SignalProtocolAddress(address.getName(), device);
if (sessionStore.containsSession(sibling)) {
SessionRecord sessionRecord = sessionStore.loadSession(sibling);
sessionRecord.archiveCurrentState();
sessionStore.storeSession(sibling, sessionRecord);
}
}
}
}
示例2: getSubDeviceSessions
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
private List<Integer> getSubDeviceSessions(SQLiteDatabase db, Account account, SignalProtocolAddress contact) {
List<Integer> devices = new ArrayList<>();
String[] columns = {SQLiteAxolotlStore.DEVICE_ID};
String[] selectionArgs = {account.getUuid(),
contact.getName()};
Cursor cursor = db.query(SQLiteAxolotlStore.SESSION_TABLENAME,
columns,
SQLiteAxolotlStore.ACCOUNT + " = ? AND "
+ SQLiteAxolotlStore.NAME + " = ?",
selectionArgs,
null, null, null);
while (cursor.moveToNext()) {
devices.add(cursor.getInt(
cursor.getColumnIndex(SQLiteAxolotlStore.DEVICE_ID)));
}
cursor.close();
return devices;
}
示例3: getSubDeviceSessions
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
private List<Integer> getSubDeviceSessions(SQLiteDatabase db, Account account, SignalProtocolAddress contact) {
List<Integer> devices = new ArrayList<>();
String[] columns = {SQLiteAxolotlStore.DEVICE_ID};
String[] selectionArgs = {account.getUuid(),
contact.getName()};
Cursor cursor = db.query(SQLiteAxolotlStore.SESSION_TABLENAME,
columns,
SQLiteAxolotlStore.ACCOUNT + " = ? AND "
+ SQLiteAxolotlStore.NAME + " = ?",
selectionArgs,
null, null, null);
while (cursor.moveToNext()) {
devices.add(cursor.getInt(
cursor.getColumnIndex(SQLiteAxolotlStore.DEVICE_ID)));
}
cursor.close();
return devices;
}
示例4: getCursorForSession
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
private Cursor getCursorForSession(Account account, SignalProtocolAddress contact) {
final SQLiteDatabase db = this.getReadableDatabase();
String[] selectionArgs = {account.getUuid(),
contact.getName(),
Integer.toString(contact.getDeviceId())};
return db.query(SQLiteAxolotlStore.SESSION_TABLENAME,
null,
SQLiteAxolotlStore.ACCOUNT + " = ? AND "
+ SQLiteAxolotlStore.NAME + " = ? AND "
+ SQLiteAxolotlStore.DEVICE_ID + " = ? ",
selectionArgs,
null, null, null);
}
示例5: deleteSession
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
private void deleteSession(SQLiteDatabase db, Account account, SignalProtocolAddress contact) {
String[] args = {account.getUuid(),
contact.getName(),
Integer.toString(contact.getDeviceId())};
db.delete(SQLiteAxolotlStore.SESSION_TABLENAME,
SQLiteAxolotlStore.ACCOUNT + " = ? AND "
+ SQLiteAxolotlStore.NAME + " = ? AND "
+ SQLiteAxolotlStore.DEVICE_ID + " = ? ",
args);
}
示例6: deleteAllSessions
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
public void deleteAllSessions(Account account, SignalProtocolAddress contact) {
SQLiteDatabase db = this.getWritableDatabase();
String[] args = {account.getUuid(), contact.getName()};
db.delete(SQLiteAxolotlStore.SESSION_TABLENAME,
SQLiteAxolotlStore.ACCOUNT + "=? AND "
+ SQLiteAxolotlStore.NAME + " = ?",
args);
}
示例7: getCursorForSession
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
private Cursor getCursorForSession(Account account, SignalProtocolAddress contact) {
final SQLiteDatabase db = this.getReadableDatabase();
String[] selectionArgs = {account.getUuid(),
contact.getName(),
Integer.toString(contact.getDeviceId())};
return db.query(SQLiteAxolotlStore.SESSION_TABLENAME,
null,
SQLiteAxolotlStore.ACCOUNT + " = ? AND "
+ SQLiteAxolotlStore.NAME + " = ? AND "
+ SQLiteAxolotlStore.DEVICE_ID + " = ? ",
selectionArgs,
null, null, null);
}
示例8: deleteSession
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
private void deleteSession(SQLiteDatabase db, Account account, SignalProtocolAddress contact) {
String[] args = {account.getUuid(),
contact.getName(),
Integer.toString(contact.getDeviceId())};
db.delete(SQLiteAxolotlStore.SESSION_TABLENAME,
SQLiteAxolotlStore.ACCOUNT + " = ? AND "
+ SQLiteAxolotlStore.NAME + " = ? AND "
+ SQLiteAxolotlStore.DEVICE_ID + " = ? ",
args);
}
示例9: deleteAllSessions
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
public void deleteAllSessions(Account account, SignalProtocolAddress contact) {
SQLiteDatabase db = this.getWritableDatabase();
String[] args = {account.getUuid(), contact.getName()};
db.delete(SQLiteAxolotlStore.SESSION_TABLENAME,
SQLiteAxolotlStore.ACCOUNT + "=? AND "
+ SQLiteAxolotlStore.NAME + " = ?",
args);
}
示例10: setSignalProtocolAddress
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
public SignalIdentity setSignalProtocolAddress(final SignalProtocolAddress address) {
this.name = address.getName();
this.deviceId = address.getDeviceId();
this.id = this.name + String.valueOf(this.deviceId);
return this;
}
示例11: getSessionName
import org.whispersystems.libsignal.SignalProtocolAddress; //导入方法依赖的package包/类
private String getSessionName(final SignalProtocolAddress address) {
final String recipientId = address.getName();
final int deviceId = address.getDeviceId();
return recipientId + (deviceId == SignalServiceAddress.DEFAULT_DEVICE_ID ? "" : "." + deviceId);
}