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

Commit c7804c13 authored by Fan Zhang's avatar Fan Zhang
Browse files

Another attempt fix for account preference screen.

Fix: 34219500
Test: RunSettingsRoboTests

Change-Id: I316e36496fc9d7eca9c718275c0f113b181d7f1e
parent ce6bf59a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -63,7 +63,6 @@ import java.util.List;
import static android.content.Intent.EXTRA_USER;
import static android.os.UserManager.DISALLOW_MODIFY_ACCOUNTS;
import static android.os.UserManager.DISALLOW_REMOVE_MANAGED_PROFILE;
import static android.os.UserManager.DISALLOW_REMOVE_USER;
import static android.provider.Settings.EXTRA_AUTHORITIES;

public class AccountPreferenceController extends PreferenceController
@@ -405,7 +404,8 @@ public class AccountPreferenceController extends PreferenceController
    }

    private void updateAccountTypes(ProfileData profileData) {
        if (mParent.getPreferenceManager() == null) {
        if (mParent.getPreferenceManager() == null
                || profileData.preferenceGroup.getPreferenceManager() == null) {
            // This could happen if activity is finishing
            return;
        }
+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.os.UserManager;
import android.support.v14.preference.PreferenceFragment;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceGroup;
import android.support.v7.preference.PreferenceManager;
import android.support.v7.preference.PreferenceScreen;

import com.android.settings.AccessiblePreferenceCategory;
@@ -324,6 +325,7 @@ public class AccountPreferenceControllerTest {
        when(mAccountManager.getAuthenticatorTypesAsUser(anyInt())).thenReturn(authDescs);

        AccessiblePreferenceCategory preferenceGroup = mock(AccessiblePreferenceCategory.class);
        when(preferenceGroup.getPreferenceManager()).thenReturn(mock(PreferenceManager.class));
        when(mAccountHelper.createAccessiblePreferenceCategory(any(Context.class))).thenReturn(
            preferenceGroup);