diff --git a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java index 810ed4b65d..8cb41ced6e 100644 --- a/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java +++ b/src/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java @@ -149,6 +149,7 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA super.onResume(); ((ApplicationPreferencesActivity) getActivity()).getSupportActionBar().setTitle(R.string.text_secure_normal__menu_settings); setCategorySummaries(); + setCategoryVisibility(); } private void setCategorySummaries() { @@ -164,6 +165,13 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA .setSummary(ChatsPreferenceFragment.getSummary(getActivity())); } + private void setCategoryVisibility() { + Preference devicePreference = this.findPreference(PREFERENCE_CATEGORY_DEVICES); + if (devicePreference != null && !TextSecurePreferences.isPushRegistered(getActivity())) { + getPreferenceScreen().removePreference(devicePreference); + } + } + private class CategoryClickListener implements Preference.OnPreferenceClickListener { private MasterSecret masterSecret; private String category;