From: Chen Xu Date: Tue, 30 Jul 2019 22:02:00 +0000 (-0700) Subject: use packageManager @SystemAPI X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6a2926cd44d420dd96b47da7074d073c065a6296;p=android-x86%2Fframeworks-base.git use packageManager @SystemAPI Bug: 137202333 Test: Build Merged-In: I1c0cb7840cb7d68fd720723eec96aa51aefc1df8 Change-Id: I1c0cb7840cb7d68fd720723eec96aa51aefc1df8 (cherry picked from commit 4b5f423c5c1b0df63ad5b232351682ab79389580) --- diff --git a/telephony/java/com/android/internal/telephony/SmsApplication.java b/telephony/java/com/android/internal/telephony/SmsApplication.java index 98f52cbf93da..6df54571a5c6 100644 --- a/telephony/java/com/android/internal/telephony/SmsApplication.java +++ b/telephony/java/com/android/internal/telephony/SmsApplication.java @@ -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 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) { diff --git a/telephony/java/com/android/internal/telephony/TelephonyPermissions.java b/telephony/java/com/android/internal/telephony/TelephonyPermissions.java index 7a0ab9ca6a28..52fc8cec0f14 100644 --- a/telephony/java/com/android/internal/telephony/TelephonyPermissions.java +++ b/telephony/java/com/android/internal/telephony/TelephonyPermissions.java @@ -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;