Skip to content
Commit ae7902fc authored by Felipe Leme's avatar Felipe Leme
Browse files

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
parent 5d1af8b4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment