use of org.thoughtcrime.securesms.contacts.ContactIdentityManager in project Signal-Android by WhisperSystems.
the class AdvancedPreferenceFragment method initializeIdentitySelection.
private void initializeIdentitySelection() {
ContactIdentityManager identity = ContactIdentityManager.getInstance(getActivity());
Preference preference = this.findPreference(TextSecurePreferences.IDENTITY_PREF);
if (identity.isSelfIdentityAutoDetected()) {
this.getPreferenceScreen().removePreference(preference);
} else {
Uri contactUri = identity.getSelfIdentityUri();
if (contactUri != null) {
String contactName = ContactAccessor.getInstance().getNameFromContact(getActivity(), contactUri);
preference.setSummary(String.format(getString(R.string.ApplicationPreferencesActivity_currently_s), contactName));
}
preference.setOnPreferenceClickListener(new IdentityPreferenceClickListener());
}
}
Aggregations