Fix account picker crash when there is no account before.
Bug: 33497222 Test: make RunSettingsRoboTests Change-Id: I06adb4e0a4afcb359a4f7e8b15f13f67c28d5b46
This commit is contained in:
@@ -170,8 +170,13 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
||||
|
||||
public void setAccounts(Account accounts[]) {
|
||||
if (!Arrays.equals(mAccounts, accounts)) {
|
||||
int index = ArrayUtils.indexOf(accounts, mAccounts[mSelectedAccountIndex]);
|
||||
mSelectedAccountIndex = index != -1 ? index : 0;
|
||||
if (mAccounts.length == 0) {
|
||||
mSelectedAccountIndex = 0;
|
||||
} else {
|
||||
final int index = ArrayUtils.indexOf(accounts, mAccounts[mSelectedAccountIndex]);
|
||||
mSelectedAccountIndex = index != -1 ? index : 0;
|
||||
}
|
||||
|
||||
mAccounts = accounts;
|
||||
mSupportFeatureProvider.refreshOperationRules();
|
||||
refreshEscalationCards();
|
||||
|
||||
Reference in New Issue
Block a user