Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5928e70c authored by Walter Jang's avatar Walter Jang
Browse files

Hide the custom contacts view pref if no accounts

Test: manually test it's hidden w/ no accounts

Bug: 32555062
Change-Id: If4fa0195df3c65367947069f28532537d98ff799
parent 4ac5629e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -268,12 +268,13 @@ public class DisplayOptionsPreferenceFragment extends PreferenceFragment
            getPreferenceScreen().removePreference(findPreference(KEY_DISPLAY_ORDER));
        }

        // Remove the "Default account" setting if there aren't any writable accounts
        // Remove the default account and custom view settings there aren't any writable accounts
        final AccountTypeManager accountTypeManager = AccountTypeManager.getInstance(getContext());
        final List<AccountWithDataSet> accounts = accountTypeManager.getAccounts(
                /* contactWritableOnly */ true);
        if (accounts.isEmpty()) {
            getPreferenceScreen().removePreference(findPreference(KEY_DEFAULT_ACCOUNT));
            getPreferenceScreen().removePreference(findPreference(KEY_CUSTOM_CONTACTS_FILTER));
        }

        final boolean isPhone = TelephonyManagerCompat.isVoiceCapable(