Only update cache for new user on user create #2

- Snapshots whole cache and enlarge the capacity to accommodate
  the new user. Removes the logic of copying over the prior
  cached values for the other users to improve the user creation
  performance.

  This CL focus on the improvements of the creation of multiple
  users such as the fourth, fifth or sixth user. No obvious
  improvement for the first user creation. The execution time of
  AppsFilter#onUserCreated got 60% improved in the creation of
  sixth user compared with rebuilding whole cache.

- Handle the user delete event to remove the cached values of
  the invalid user.

Test: atest --user-type secondary_user AppsFilterTest
Test: atest --user-type secondary_user AppEnumerationTests
Test: [create 2nd user; run as primary]
      atest AppsFilterTest AppEnumerationTests
Test: atest UserLifecycleTests#createUser
Bug: 187853334

Change-Id: Iab93083509093ac3225adf0df466154f86e95bf2
3 files changed