Adding tests to verify `getNumberOfEntries` and `listEntriesBatched`.

1. Try to list large number of aliases such that aliases list would
   exceed the binder transaction size limit. Test should successfully
   list the aliases using `listEntriesBatched` API.

2. Import keys from multiple processes having same user context. Try to
   list the aliases in all the processes with and without providing
   `startingPastAlias`. Test should list aliases using
   `listEntriesBatched` in all the processes using any of the alias as
   `startingPastAlias` and match with expected list of aliases. Test
   should also list all the aliases without providing
   `startingPastAlias`.

3. Try to list aliases with empty keystore using `listEntriesBatched`
   API. Test should successfully query the Keystore for aliases and
   vrify that keystore is empty.

4. Test to list aliases using domain as SELINUX using
   `listEntriesBatched` API.

5. Import multiple number of keys in an app context and try to list the
   aliases using imported keys aliases as `startingPastAlias` and verify
   the retrived the list of aliases matches the expected list of alises
   in all the cases.

6.  Try to list the key entries with domain SELINUX from user context
    where user doesn't possesses `GET_INFO` permission for specified
    namespace. Test should fail to list key entries with error response
    code `PERMISSION_DENIED`.

7. Try to list key entries with domain BLOB. Test should fail with error
   response code `INVALID_ARGUMENT`.

8.  Try to get the total number of keystore entries with domain SELINUX
    from user context where user doesn't possesses `GET_INFO` permission
    for specified namespace. Test should fail to get the count with
    error response code `PERMISSION_DENIED`.

9. Try to get the count of total number of entries in keystore with
   domain BLOB. Test should fail with error response code
   `INVALID_ARGUMENT`.

Bug: 194359114
Test: atest keystore2_client_test
Change-Id: I7dd52230cd602a1ae33e3f9f2a22d2dd2c447df7
3 files changed