Refactor UserProfilePager

Simplify the grouping logic, and add test.

Bug: 292036686
Test: manual - tested w & w/o work profile
Test: unit test
Change-Id: Idb6a0c77488a03252ab2a89daacd9d3c3e61bae4
2 files changed