Fix IsolatedUidAllocator for non-primary users.

The UID allocator stores complete UIDs, not app IDs. When removing a UID
from the range, we should therefore also use the UID, not the app ID.

Also added a test to cover this scenario, which passes with this change.

Bug: 146313311
Test: atest ActivityManagerTest
Change-Id: I1118ec73dcee5987e12f35aabce5cfa8cbe407a1
(cherry picked from commit c9a0df2d88884617b86c09a0ab86363200d6a66d)
2 files changed