Fix issue for new account not being shown in work profile.

When refreshing the UI, we tried to only create profile data for new
profile, and skip the initialization for existing profiles. However,
the authentication helper will not get the updated account list, since
the account update listener is being paused. Re-create the
authentication helper to get the latest list of enabled accounts.

Change-Id: Ie29699456e5b32747e8158d51382afaa2c0c5908
Fix: 38302246
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2017-05-16 17:23:55 -07:00
parent 9a0299cd52
commit 71090678c0
2 changed files with 41 additions and 0 deletions

View File

@@ -299,6 +299,11 @@ public class AccountPreferenceController extends PreferenceController
final ProfileData data = mProfiles.get(userInfo.id);
if (data != null) {
data.pendingRemoval = false;
if (userInfo.isEnabled()) {
// recreate the authentication helper to refresh the list of enabled accounts
data.authenticatorHelper =
new AuthenticatorHelper(mContext, userInfo.getUserHandle(), this);
}
return;
}
final Context context = mContext;