Make getUid a method on UserHandle itself instead of static

This commit addresses the API review feedback that getUid()
will be better to make it be a method on UserHandle itself
rather than a static method.

Update as it is and update the corresponding usages.

Fix: 184735865
Test: make update-api
Test: atest FrameworksNetTests
Test: atest CtsNetTestCasesLatestSdk
Change-Id: I33844309224d84764704255d251fadc8940202ca
This commit is contained in:
Chiachang Wang
2021-04-08 11:10:51 +08:00
parent e3fe4d0188
commit 612cc034a1
4 changed files with 14 additions and 14 deletions

View File

@@ -46,8 +46,8 @@ public final class UidRange implements Parcelable {
/** Creates a UidRange for the specified user. */
public static UidRange createForUser(UserHandle user) {
final UserHandle nextUser = UserHandle.of(user.getIdentifier() + 1);
final int start = UserHandle.getUid(user, 0 /* appId */);
final int end = UserHandle.getUid(nextUser, 0) - 1;
final int start = user.getUid(0 /* appId */);
final int end = nextUser.getUid(0 /* appId */) - 1;
return new UidRange(start, end);
}