Another attempt fix for account preference screen.
Fix: 34219500 Test: RunSettingsRoboTests Change-Id: I316e36496fc9d7eca9c718275c0f113b181d7f1e
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user