use @SystemAPI for creating UserHandle

Bug: 137202333
Test: Build & Unit test
Change-Id: Id2a696bed6a80c92291c8f968f3aaa8db6bb83df
This commit is contained in:
Chen Xu
2019-08-05 11:39:13 -07:00
parent 3a5492c398
commit 59d76e97bb
2 changed files with 2 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ public class CallerInfoAsyncQuery {
final Context otherContext; final Context otherContext;
try { try {
otherContext = context.createPackageContextAsUser(context.getPackageName(), otherContext = context.createPackageContextAsUser(context.getPackageName(),
/* flags =*/ 0, new UserHandle(currentUser)); /* flags =*/ 0, UserHandle.of(currentUser));
return otherContext.getContentResolver(); return otherContext.getContentResolver();
} catch (NameNotFoundException e) { } catch (NameNotFoundException e) {
Rlog.e(LOG_TAG, "Can't find self package", e); Rlog.e(LOG_TAG, "Can't find self package", e);

View File

@@ -806,7 +806,7 @@ public final class SmsApplication {
if (userId != UserHandle.USER_SYSTEM) { if (userId != UserHandle.USER_SYSTEM) {
try { try {
userContext = mContext.createPackageContextAsUser(mContext.getPackageName(), 0, userContext = mContext.createPackageContextAsUser(mContext.getPackageName(), 0,
new UserHandle(userId)); UserHandle.of(userId));
} catch (NameNotFoundException nnfe) { } catch (NameNotFoundException nnfe) {
if (DEBUG_MULTIUSER) { if (DEBUG_MULTIUSER) {
Log.w(LOG_TAG, "Unable to create package context for user " + userId); Log.w(LOG_TAG, "Unable to create package context for user " + userId);