Hide link device preference if we're a secondary device.

This commit is contained in:
Mikunj 2019-10-07 12:19:08 +11:00
parent da67bfab4c
commit a2e9271050

View File

@ -180,8 +180,12 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_PUBLIC_KEY));
this.findPreference(PREFERENCE_CATEGORY_QR_CODE)
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_QR_CODE));
this.findPreference(PREFERENCE_CATEGORY_LINK_DEVICE)
.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_LINK_DEVICE));
Preference linkDevicePreference = this.findPreference(PREFERENCE_CATEGORY_LINK_DEVICE);
// Hide if we're already a secondary device
linkDevicePreference.setVisible(!TextSecurePreferences.isSecondaryDevice(getContext()));
linkDevicePreference.setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_LINK_DEVICE));
this.findPreference(PREFERENCE_CATEGORY_SEED)
.setOnPreferenceClickListener(new CategoryClickListener((PREFERENCE_CATEGORY_SEED)));