diff options
author | Anthony Hugh <ahugh@google.com> | 2020-08-04 14:52:03 -0700 |
---|---|---|
committer | Anthony Hugh <ahugh@google.com> | 2020-08-11 19:06:49 +0000 |
commit | b56228e0c024b604c9e428e4e2b882c5b0ca2bfd (patch) | |
tree | 921057eee70c50840a44b96a1350fc62729e0df5 /tools/aapt2/java/JavaClassGenerator.cpp | |
parent | b0c1ac5b2efdf26733ef2182e1ba8c2143b8fa55 (diff) |
Update PermissionManagerService to handle pre-created users
Pre-created users are not being returned by the call to
UserManagerService.getUserIds(). This is causing PermissionManager to
ignore recording pre-grants when a new pre-created user is created.
This CL fixes the issue by using a user ID set that contians pre-created
users. Presumably the call to getUserIds() was previously done for
performance reasons. I have added some system tracing to see if
performance is a bottle neck here with the new API call.
I ran the test 5 times on an automotive emulator:
[1] Start system trace
[2] adb shell pm -create-user --pre-create-only
[3] Stop system trace
Average time to getUsers() before changes: .389ms
Average time to getUsers() after changes: 1.82ms
Given that this is an infrequent operation and less than 5ms change,
performance hit looks negligible.
Bug: b/160901158
Test: Manually. Run `adb shell pm -create-user --pre-create-only`.
Create a new user and check to see that Assistant has pre-granted
permissions via `adb shell dumpsys package
com.google.android.carassistant`
Change-Id: I52caeb3a71e560d09fcbc167b46becebf779fc3a
Merged-In: I52caeb3a71e560d09fcbc167b46becebf779fc3a
(cherry picked from commit 432a0377250246632927252c9d2b92411717be52)
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator.cpp')
0 files changed, 0 insertions, 0 deletions