Cache the UserInfo for the system user on UserManagerService.
When the name of the system user (userId 0) is not explicitly set,
UserManagerService must return the localized string defined by
owner_name.
As UserInfo is mutable and its 'name' attribute is publically
acessible, UserManagerService currently creates a new UserInfo
(with the right 'name') for the system user every time it's needed,
which results in ~1200 unnecessary objects created at boot (and more
over time).
This CL improves the situation by caching 2 UserInfo objets for the
system user (one with the original name, and another with the
localized name).
Test: adb shell dumpsys user | grep "System user:"
Fixes: 161915546
Bug: 164159026
Change-Id: Ibbe4fed3e650845d8c365cb6c7a2dcb306738152
1 file changed