Merge "use packageManager @SystemAPI"

This commit is contained in:
Chen Xu
2019-09-26 03:43:44 +00:00
committed by Gerrit Code Review
2 changed files with 3 additions and 3 deletions

View File

@@ -158,7 +158,7 @@ public final class SmsApplication {
ApplicationInfo appInfo;
try {
appInfo = pm.getApplicationInfoAsUser(mPackageName, 0,
UserHandle.getUserId(mUid));
UserHandle.getUserHandleForUid(mUid));
} catch (NameNotFoundException e) {
return null;
}
@@ -300,7 +300,7 @@ public final class SmsApplication {
Uri.fromParts(SCHEME_SMSTO, "", null));
List<ResolveInfo> respondServices = packageManager.queryIntentServicesAsUser(intent,
PackageManager.MATCH_DIRECT_BOOT_AWARE | PackageManager.MATCH_DIRECT_BOOT_UNAWARE,
userId);
UserHandle.getUserHandleForUid(userId));
for (ResolveInfo resolveInfo : respondServices) {
final ServiceInfo serviceInfo = resolveInfo.serviceInfo;
if (serviceInfo == null) {

View File

@@ -367,7 +367,7 @@ public final class TelephonyPermissions {
ApplicationInfo callingPackageInfo = null;
try {
callingPackageInfo = context.getPackageManager().getApplicationInfoAsUser(
callingPackage, 0, UserHandle.getUserId(uid));
callingPackage, 0, UserHandle.getUserHandleForUid(uid));
if (callingPackageInfo != null) {
if (callingPackageInfo.isSystemApp()) {
isPreinstalled = true;