When refreshing the Accounts settings UI, we uses the cached user info for checking user status. However, when the work profile is being updated, the UserInfo obejct for the user might be updated even the user id is the same. Using the cached data causes stale info to be returned for the user and results in the latest account data not being shown properly for the user. Update the cache to the latest user info retrieved from user manager. Change-Id: Ic0127842203f0288f2fdea6c6346cd11e42a8bf0 Fix: 38302246 Test: make RunSettingsRoboTests
Running Settings Robolectric tests
The full suite
$ croot
$ make RunSettingsRoboTests
Running a single test class
$ croot
$ make RunSettingsRoboTests ROBOTEST_FILTER=<ClassName>
For example:
make RunSettingsRoboTests ROBOTEST_FILTER=CodeInspectionTest
You can also use partial class name in ROBOTEST_FILTER. If the partial class name matches multiple file names, all of them will be executed.